• Welcome to Dark Bit Factory & Gravity.
 

The diffrence between Sin() and Cos() (ez)[BB2D]

Started by Roly, May 17, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Roly

Original post from Phoenix, taken from the ezboard forum

Hello everybody!

Whats the diffrence between Sin() and Cos()? I know how to use Sin(), and I use it often, but I don't know what Cos() does. I use Cos() sometimes, when for example moving a space ship, but I use it without knowing what it does. I looked in the command reference, but I didn't really understand... Can anyone help me?

Thanks in advance!

Phoenix


Quote from: Codeman

Try here see if this helps

www.dbfinteractive.com/tutorialindex.htm

Quote from: Thygrion

To my understanding, Cos() does basically the same thing as Sin(), but with slightly different results.

Where sin(0) = 0, cos(0) = 1.0, and when sin(90) = 1.0 then cos(90) = 0.

So they do sorta the same thing, but with opposite results. Kinda :) .

Hope that helps.

Quote from: Phoenix

Ahh. Okay, I think I understand. Thanks!

Phoenix

Quote from: 5H0CKW4VE

Cos is inverse sine.

relsoft

I dont think cos is the inverse of sin.

Sin = O/H and Cos = A/H

1/sin <> cos = cosecant


Challenge Trophies Won:

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

Clyde

In basic Maths, what does that actuall mean?

Cheers and many thanks,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Stonemonkey

For any right angle triangle

where angle=the angle of one of the corners that isn't the right angle

cos(angle)=the ratio between the lengths of the hypotenuse(the longest edge which is always opposite the right angle) and the adjacent edge to your angle

sin(angle)=the ration between the lengths of the hypotenuse and the opposite edge to your angle

the result of sin or cos can never be more that 1.0 (or less than -1.0) because neither the adjacent adge or the opposite edge can be longer than the hypoenuse.

Jim

Another way to look at it.  If you draw a circle that has a radius of 1, then the points that lie on the circle at any angle have x,y coordinates which are the sin and cos of that angle.  That's why they're so uselful for rotating things in circles.

Jim
Challenge Trophies Won:

Optimus

I still wait to see a demo claiming "Have you ever seen a cosine scroller before? WORLDS FIRST!!!" =)))
Challenge Trophies Won:

taj

Thats a hell of a question. It is such a complex question deep down but on the surface for us programmers.

(In degrees) sin(angle) = cos(angle+90)
(in radians) sin(angle) = cos(angle+PI/2)

In other words you can _always_ use a sin when you were going to use a cos. They have the same shape, input and output range. They are, for our purposes, the same thing. One day Ill get desperate enough to replace all my calls ot cos with calls to sin to save bytes ;-)
Challenge Trophies Won:

Jim

I guess the real answer to "what's the difference between Sin and Cos?" is just "90degrees" :D

Jim
Challenge Trophies Won:

Clanky

Sin and Cos are useful for rotation in programs... the values for each can be defined by the Unit Circle (see attachment)
all they are are values to find angles of an object...
basically what everyone has stated already!!!! lol!
He tilts, and his eyes are focused on the ground far below.. Wind? Angels? Men..