Return the time of a round trip in Math.sin?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
MYX_2000
Posts: 12
Joined: February 6th, 2012, 2:01 pm

I am working on an expression that has me up against the wall. What I am trying to do is dynamically offset some number of layers who are traveling in a circle. The circle is based on Math.sin/cos (x and y) oscillation. I have a slider in a master control null that I am using to define the number of layers. As I add layers, I just adjust the slider to that number of layers in the circle. I am trying to offset by time so that I can still keyframe a 'speed' expression control.

I have this working if I predefine the offset by time - (index * .5). The problem is that I have to have a exact number of layers for a specific speed. I want to be able to change this at will and not have to calculate the offset timing for every iteration.

So my question is... Is there some magical word I am missing that will return the amount of time, or the number of frames that the math.sin / math.cos circle takes to do one full oscillation? This way I can just divide by the number objects.

Does this make sense? Thanks for your time.

>> EDIT Sorry, I have been bouncing between the scripts board and the expression board. This was meant for the expressions board (although this is going into a script).
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

Not sure what you are asking here. There simply is no fixed temporal period in any of these functions. They are solely determined by whatever you use as the input. Beyond that the normal relation between degrees, radians and Pi apply and trhats what radiansToDegrees etc. are for...

Mylenium
[Pour Mylène, ange sur terre]
MYX_2000
Posts: 12
Joined: February 6th, 2012, 2:01 pm

Hey Mylenium, thanks for the response. I know that it is not a fixed period. I actually have a slider to change the rate of oscillation. What I was hoping to find was a method that from any frame, based on the current settings, it can calculate in time how long it would take to make 1 complete oscillation. I am specifically not heading to rotation as the source of movement as various checkboxes = other formations, so I am trying to keep this all position based.
Post Reply