Hi All,
Has anyone built up inverse-sine and inverse-cosine functions?
Right now, we have cos(x), sin(x), and atan2(dx,dy). If all else fails, I can create a table function to look these up, but figured I'd ask around to avoid duplicating the work.
-Electric Gryphon

4


Mathematically, I think the right answer is the following. But these do not check for out of range values or other possible error conditions. And they have the additonal problem that sqrt() is only a rough approximation.
function acos(x) return atan2(x,-sqrt(1-x*x)) end function asin(y) return atan2(sqrt(1-y*y),-y) end |
[Please log in to post a comment]