Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions math.sin broken?

  • Posted by Paul Roper on January 14, 2011 at 9:18 pm

    Hello

    Either I am dong something wrong, or my computer cannot do maths. I am trying to influence an expression’s value by a bell-shaped curve, so I thought I’d multiply it by the sin of a value. But my Math.sin function is begin very weird. To check it, I’ve made a couple of text layers to display the results; I have, on a text layer’s source text:

    thisComp.layer(“Tube”).transform.scale[0]/1.66667

    (“Tube”‘s scale goes from 0 to 150, hence the /1.66667 to keep it between 0 and 90)

    and my second layer’s text is:

    Math.sin(thisComp.layer(“text”).text.sourceText)

    …so when the input value is, for example, 18.67, my calculator tells me that sin(18.67) is 0.32, but After Effects think it’s -0.17702228.

    My input value is keyframed to smoothly go from 0 to 90, but on each frame, the Math.sin value to anywhere from -0.99 ish to 0.99 ish, whereas I was expecting a smooth, sinusoidal-shaped transition from 0 to 1 (which is what my calculator gives me and we remember from school!)

    Any thoughts???

    (It’s not an issue with the text layers themselves – when I used the formulae to control an angle, they produce the same results…that’s why I created the text layers to check what’s going on).

    Paul Roper replied 15 years, 4 months ago 1 Member · 1 Reply
  • 1 Reply
  • Paul Roper

    January 14, 2011 at 9:57 pm

    Ahhhhhhhhhhh…………radians, not degrees! That’s my problem! A quick degreesToRadians saved the day.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy