ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression 30 sin(10/π x + 30) + 30

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
John Granger
Expression 30 sin(10/π x + 30) + 30
on Jan 21, 2019 at 10:41:23 pm

I am trying to control the the y rotation value of an effect using the function: 30 sin(10/π x + 30) + 30 where x is equal to time. how can i make this into a proper expression? P.S. if someone could tell me a good place to teach myself how to program expressions that would be great.


Return to posts index

Dan Ebberts
Re: Expression 30 sin(10/π x + 30) + 30
on Jan 21, 2019 at 11:21:54 pm

If I'm interpreting it right, I think it would be like this:

30*Math.sin((10/Math.PI)*time + 30) + 30


Dan



Return to posts index

Dan Ebberts
Re: Expression 30 sin(10/π x + 30) + 30
on Jan 22, 2019 at 1:51:50 am

Looking at this a little more, if what you really want is an expression that oscillates between 0 and 60, at a rate of 5 oscillations per second and starts at 30 degrees, that would be like this:

30*Math.sin((10*Math.PI)*time + degreesToRadians(30)) + 30

or, in a more general form, like this:

amp = 30;
offset = 30;
freq = 5;
startAngle = 30;
amp*Math.sin(freq*Math.PI*2*time + degreesToRadians(startAngle)) + offset


Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]