Jump to content
  • Advertisement
Sign in to follow this  
limpacp

finding angle...

This topic is 4311 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. Please help, i'm dowe with some coding and my head is really going crazy, but i need to solve last thing today, so: please, look here: sin(angle)=result. If i know the result, how i can find the angle ? Actually i need this formula. Big, big thanks, if you help me!

Share this post


Link to post
Share on other sites
Advertisement
The function 'asin' (called 'arcsin'/'arcsine', or 'inverse sine') is indeed what you're after, but here are a few things to bear in mind:

Beware that while 'sin' is defined everywhere on the real line (in fact, the complex plane, but I doubt your implementation goes that far), 'asin' requires a value between -1 and 1.

Moreover, asin(sin(x)) != x in general. Although, this equality is true taken modulo 2Pi. The reason for this is that sin(x) = sin(x + 2Pi) and so, arcsin can't differentiate the result. Your arcsin may procuce output in the range [0, 2Pi] or [-Pi, Pi] (or, conveivably something else). If this is important, find out which.
If you'll only be calling asin on values that were calculated using sin from a value in this range, you'll have no problems.

Regards
Admiral

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!