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


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

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



>>> Another question...
>>>         How do you do sine, cosine, tangent and arctangent functions?

>>There are no functions to do them currently.  I suggest a lookup
>>table be employed.  This is a good way in any case, because they are
>>usually used for graphics funcs that need to be speedy.  That is what
>>I am doing for my raycasting engine.

>There must be a formula for finding those functions. I mean the calculator
>isn't looking up a table when you punch in 392.48 degrees, It isn't
>practical to make a table big enough to hold all of those values.

It all depends on what you want to do. If you are just writing a trig or
geometry program that uses those functions, and you aren't too worried
about the speed, then use (if there are any) the functions that TI
provides.

However, if you intend to write a raycasting engine, then the table is the
better bet (and is probably about 5-7 times faster than any function that
TI wrote). Your table would only need the values for those functions at 1
degree increments to produce acceptable results (it's just a calculator,
not a PC).



****************************
*Nathaniel Gibson          *
*ngibson@postoffice.ptd.net*
****************************



Follow-Ups: