[A89] Re: arctan
[Prev][Next][Index][Thread]
[A89] Re: arctan
My ancient TrigLib (found in 92/asm/libs on ticalc) has an arctan
function... although it has an error of 1-2 degrees so it's probably not
good enough, but I used it in Tinx2 to calculate projectile motion.
I don't remember if the last version used it, but the standard way to do
approximations is to use enough taylor iterations. IIRC the problem is
that to get those accurate over the entire 90 degrees you need quite a lot
of them. I think I opted for a sine table and used some form of binary
search to find the angle, but I'm not sure...
In assembly you need to roll your own, preferrably using fixed point
integer arithmetic. It's tricy as the accuracy will vary (as mentioned
above) and as a side-effect the routine can be faster with some angles
than others, so you have to use the worst-case in your game timing... :(
/ nbr
References: