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


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

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




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

No, calulators calculate thigs accratly, But in games, etc. lookup 
tabels are ALWAYS used in soem for fro trancendental funtions..
The taylor series,or whatnot, are always too slow to calculate, and 
pretty much a pointless task... (simply store 0-90 of sin and you can 
derive  sin and cos for all values)

Rob Taylor MAIL - mailto:rtaylor@ticalc.org 
           WEB  - http://www.u-net.com/~rtaylor/    


Follow-Ups: