how does SIN and COSINE work?

Started by
7 comments, last by igni ferroque 18 years, 10 months ago
Hello! can anybody explain how sinus and cosinus (SIN and COS) work? I can't wait to learn it :) [Edited by - Samsonite on June 26, 2005 5:09:04 PM]
Hope I was helpful. And thank you if you were!
Advertisement
Do you mean, what do they do as mathematical functions... or how are sines and cosines computed on computer hardware?
Mathematically its related to the exponential function in complex (you know "i = sqrt(-1)") space.

Look up eulers "e" function.

where e^(i*theta) generates the unit circle when turned 2pi degrees.

e^(i*theta) - e^(-i*theta)
--------------------------
2i

I believe is the function for sin. Just take the derivitive with respect to theta to get cos.

(http://en.wikipedia.org/wiki/Cosine)

[Edited by - c0dedrag0n on June 24, 2005 1:46:57 PM]
O_O thats to complicated, but i'll ask my dad :)

Both mathematical and computed on computer hardware :)
Hope I was helpful. And thank you if you were!
Mathematically, their infinite series definition is often used as the primary definition for determining various properties about them. The computation is often done using Taylor series or look-up tables. I don't know all the specifics, especially regarding which methods are most typically used, but I'm sure those Wikipedia articles will reveal a lot.
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
Mmm, since your website states you're 14, maybe a more basic explanation is in order. (I don't know how good education is in Norway, though :-) )
Sine and cosine (and tangent too) basically are the ratios of the sides of a triangle:
      +     /|  H / | O   /  |  /a  | +----+   A

The angle a is (almost completely) defined by the lengths of the sides. (Imagine moving the upmost point around). The sine of the angle a in this triangle is the length O divided by H. The cosine is A divided by H. The tangent of a is O divided by A.
So, what's the use? Say we know the left-bottom point of the triangle is (0,0) and the upmost point is (3,4). Now we now that A=3 and O=4, giving tan a=4/3. On most calculators you have a button called tan-1 or atan. Using this we can now found the angle that corresponds to our tan a of 4/3. My calculator says the angle is 53 degrees.
Et voila, now you can convert coordinates on screen or in your game world into angles: something you will do quite often.
Of course, as stated above, sine and cosine are used in tons of other calculations. But that's something for another day, I guess.
Draw a circle, make the radius equal to 1.
Go ahead, get a piece of paper and actually draw it.
Draw a horizontal line through the center of the circle.
Draw another line from the center of the circle to any point on the circle.

Look at the angle between the two lines. We'll call it "theta".
Now look at the point where the second line touches the circle.
The horizontal distance from the center of the circle to this point is called "cosine theta".
The vertical distance is called "sine theta".

That's the basics. It gets more complicated from there. It turns out that cosine and sine have some really useful practical properties.
-Mike
Thank you :)
Hope I was helpful. And thank you if you were!
Sine @ Wikipedia
Free Mac Mini (I know, I'm a tool)

This topic is closed to new replies.

Advertisement