Original Post
🔒 Locked
finding angle...
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
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
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement