# Can I use sin or cos for the non uniform rotation in unity 5? [closed]

I have few objects which I have to rotate on an ellipsoidal track and speed is changeable at the run time because its a betting game in which racing will be done so speed values will come from the server and I have to handle run time speed as well as the rotation angle at the curved path within the track.

And I would like to clarify one thing that we don't have to give any output to the objects make run just as we play the game the objects start running till the end point without giving an input.

So how do I rotate the objects within the curved area according to change in speed at the run time?

• Would love to know how OP got on, also why I got a downvote? Commented Sep 23, 2015 at 19:54
• Am I right that this question is essentially asking about how to interpolate around an ellipse at a particular speed? (Basically an ellipse version of this rectangle question?)
– Anko
Commented Oct 7, 2015 at 18:13

Consider the function sin(t) this is a nice regular wave.

Now suppose you have some "speed function" s(t) which returns any value.

Now sin(s(t)) has rate of change s'(t)cos(s(t))

If s(t)=t then we see the rate of change is a nice smooth regular cos(t)

If we take s(t)=t^2 then the rate of change becomes 2t cos(t^2) which as you can hopefully tell becomes "sharper".

I encourage you to experiment with such things in a spreadsheet and plot a graph.

• Have I misunderstood the question? Commented Sep 23, 2015 at 12:59
• Thanks but why did u do feedback as downvote to me? Commented Sep 24, 2015 at 6:42
• @ShraddhaPatel it wasn't me. (I've just +1ed you, if I was the downvoter I couldn't have done that) Commented Sep 24, 2015 at 9:39
• Thanks a lot...I thought that u did that by the way thank you so much for reply ;) Commented Sep 24, 2015 at 10:35
• @ShraddhaPatel please do give me the tick if it helped (I've lost points for this answer because someone downvoted) Commented Sep 24, 2015 at 12:54