Zeld wrote:
HyperHacker wrote:
Just looking for the values of sin(1), sin(2), etc may not work due to varying precision
For that case, can't you just ignore a few bits?
I'm eager to see what this looks like, too. I'm surprised I haven't ran into it yet.
You could have a look up table. However, this would produce somewhat inaccurate results. And for that reason, a series of values might be calculated... n=0, to n=?, where the series is [(-1)n * x^(2n+1)]/(2n+1)! for sin, and [(-1)n * x^(2n)]/(2n)! for cosine. Sin and cosine converge very quickly (as long as it is restricted to +/- 180 degrees)... it doesn't take many calculations to achieve a relatively accurate value... accurate enough for graphics calculations on a decade old console, anyways.
I would expect to see a for loop, where the author already calculated the number of loops that have to be done in order to achieve a certain accuracy, where sum+= the series for that n, again from n=0 to n=?.