Cosine

Started by
16 comments, last by GameDev.net 18 years, 3 months ago
SinX = opposite/hypotenuse
CosX = adjacent/hypotenuse


(Taken from Wikipedia.com)


(taken from Wikipedia.com)
I hope these picture might help you.
DinGY
Yesterday is history.Tomorrow is a mystery. Today is a gift"
Advertisement
The way I always remember it is this....

Start at point (1, 0) on a circle (the leftmost point) of radius 1.

Rotate COUNTER-CLOCKWISE x degrees.

After the rotation, your point is at point (cos x, sin x). So cos x really means "how far left or right on the x-axis am I after I rotate around a circle?"

Sin x, similarly, means "how high up on the y-axis am I after the same rotation?"

If you have a value A * cos x or (A * sin x), you interpret that as a rotation around a circle of radius A instead of radius 1.
Quote:I'm trying to understand how cosine works. In all the books I've read, they say it's the adjacent side divided by the hypotenuse:


I think the OP wants the definition of cosine function. The function is actually an approximation function, you may want to look at taylors series. If you have a calculus book look for taylor's series it might be in the table of contents or the index(or both).
Quote:Original post by Four
I think the OP wants the definition of cosine function. The function is actually an approximation function, you may want to look at taylors series. If you have a calculus book look for taylor's series it might be in the table of contents or the index(or both).


The function itself is not approximate. The approximation is from the methods used to evaluate the function.
cos(x)=
-x + x^3/3! - x^5/5! + x^7/7! - x^9/9! ...
sum(i=0..infinity, (-1)^i*x^(2i+1)/(2i+1)!)

Remember:
n!:=1*2*3*...*n

Hope that helps :)
Nathan
Thanks for everyones help. I think I get it now.
In a slightly related question, how are trig functions usually implemented on a computer? Are they in software, or do modern chips have them hardwired?
To win one hundred victories in one hundred battles is not the acme of skill. To subdue the enemy without fighting is the acme of skill.
Quote:Original post by King of Men
In a slightly related question, how are trig functions usually implemented on a computer? Are they in software, or do modern chips have them hardwired?

In the case of x86, sine, cosine, tangent, and arctangent are hardwired into the processor. There are still cases, however, on x86, programmers still sometimes generate them in software.

This topic is closed to new replies.

Advertisement