Skip to main content
gamedev.net
🔒 Locked

finding angle...

Started by limpacp Sep 27, 2006 at 11:06 AM 1 replies 600+ views
Original Post
limpacp
limpacp
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!
TheAdmiral
TheAdmiral
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
Ring3 Circus - Diary of a programmer, journal of a hacker.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.