• Advertisement
Sign in to follow this  

Elapsed time and Sin

This topic is 1582 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, in this OpenTK application why can you get the perfect scale with Math.PI?

 
time = (time >= Math.PI) ? 0.0 : time + e.Time;
variableScale = (float)(Math.Sin(time));

I know that Sin works best for 0..360 circle degrees range, but Math.PI related to time is strange.

 

If you have any references about and links to share please post here. Thanks.smile.png

 

Share this post


Link to post
Share on other sites
Advertisement

Sin completes a full cycle from 0 to 360 degrees, but the sin function in computer APIs very rarely accepts degrees.

Usually we work with radians2*Pi radians == 360 degrees.

 

The equivalent of that code, working with degrees instead of radians would be:

time = (time >= 180) ? 0.0 : time + e.Time;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement