4.9.3.2 cosine - cos( x )

We use the cosine function to animate the Y position of the sphere. The cosine function in Xpressionist assumes the argument to be in degrees. We use time * 90 as an argument for the cosine function because we want the argument to create angular values between 0 and 360 in four seconds - like one full rotation:

sphere.YPosition = cos( time * 90 );

We preview the result:

The cosine function returns the same values as a sine function with a phase shift of 90°.

All other aspects of the cosine function are equal to the sine function.

Xpressionist 3.5