Re: LF: ASM Question...Help please...


[Prev][Next][Index][Thread]

Re: LF: ASM Question...Help please...



At 10:26 PM 12/5/96 -0500, you wrote:
>
>>	Yes, there is a formula for finding these functions.  Suppose x is
>>an angle given in radians (180 degrees = \pi radians).  Then:
>>
>>If n! = n * (n-1) * (n-2) * . . . * 3 * 2 * 1 then we have:
>>
>>cos x = 1 - x^2/2! + x^4/4! - x^6/6! + . . .
>>sin x = x - x^3/3! + x^5/5! - x^7/7! + . . .
>>tan x = (sin x)/(cos x)
>>(there is also one for arctan, but it is a bit hairy...)
>
>Those are the taylor polynomials for those functions...
>
>>
>>	Note:  These require skill at decimal arithmetic, something the
>>68k processor is not good at.  Also, these series are INFINITELY long.
>>Decent accuracy takes some time, especially for large values of x.  This
>>is the reason why, when programming for speed, lookup tables are used.
>>True, a lookup table will be missing some values.  Simply rounding to the
>>nearest value usually suffices, however.
>>
>>
>
>So are you saying calculators normally use lookup tables?
>
>-Mark-
>
>
>

Well if your making a Doom game and want speed, a lookup table is better
because all the angles don't need to be extremely accurate. If using a
program that needs percise numbers and doens't need to generate 5 or more
frames a second, using those formulas is more accurate.