Re: trig. formula Question



Dave Seaman <dseaman@xxxxxxxxxxxx> wrote:
> incon wrote:
>> HI I have looked everywhere I can and I cannot find the formula for
>> the trigonomic functions ...

> The "formulas" are transcendental and may not be of much help to you, but:

> sin(x) = (e^(i*x) - e^(-i*x)) / (2*i) = x - x^3/3! + x^5/5! - x^7/7! + ...
> cos(x) = (e^(i*x) + e^(-i*x)) / 2 = 1 - x^2/2! + x^4/4! - x^6/6! + ...
> tan(x) = sin(x) / cos(x)

These formulas work, but only work well for small arguments. There
are other formulas that work better for larger arguments. And still
others that are better if you're going to be calculating lots of
values in one session. Google on "CORDIC algorithm," for instance. I
suspect that that is what is used in videogames, where trig functions
have to be calculated millions of times per second to present the user
in real time with moving images of a simulated three-dimensional
environment.

Also note that the argument must be in radians, not degrees or grads.
--
Keith F. Lynch - http://keithlynch.net/
Please see http://keithlynch.net/email.html before emailing me.
.