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


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

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




If I may make a suggestion.
If you need to generate a table. Use the taylor polynomial.
If you use on sin(x) you get:

taylor(sin(x),x,7)=x-(x^3/6)+(x^5/120)-(x^7/5040)

This will allow to approximate the values if sin(x) on the interval

0<=x<=Pi/2

A fast and efficient way save memory when your program is not running

Michael Wulff Nielsen
mal@dit.ou.dk

On Wed, 4 Dec 1996, Nathaniel Gibson wrote:

> >>> 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*
> ****************************
> 
> 


References: