### Author Topic: The diffrence between Sin() and Cos() (ez)[BB2D]  (Read 1305 times)

0 Members and 1 Guest are viewing this topic.

#### Roly

• Amiga 1200
• Posts: 390
• Karma: 7
##### The diffrence between Sin() and Cos() (ez)[BB2D]
« on: May 17, 2006 »

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?

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.
« Last Edit: July 21, 2007 by Shockwave »

#### relsoft

• Posts: 3286
• Karma: 47
##### Re: The diffrence between Sin() and Cos() (ez)
« Reply #1 on: May 17, 2006 »
I dont think cos is the inverse of sin.

Sin = O/H and Cos = A/H

1/sin <> cos = cosecant

Challenge Trophies Won:

#### Shockwave

• good/evil
• Founder Member
• Posts: 17297
• Karma: 489
• evil/good
##### Re: The diffrence between Sin() and Cos() (ez)
« Reply #2 on: May 17, 2006 »
Doh!
Shockwave ^ Codigos
Challenge Trophies Won:

#### Clyde

• A Little Fuzzy Wuzzy
• Posts: 7248
• Karma: 71
##### Re: The diffrence between Sin() and Cos() (ez)
« Reply #3 on: May 17, 2006 »
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

• Pentium
• Posts: 1274
• Karma: 95
##### Re: The diffrence between Sin() and Cos() (ez)
« Reply #4 on: May 17, 2006 »
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

• Founder Member
• Posts: 5257
• Karma: 394
##### Re: The diffrence between Sin() and Cos() (ez)
« Reply #5 on: May 20, 2006 »
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

• Posts: 2402
• Karma: 127
##### Re: The diffrence between Sin() and Cos() (ez)
« Reply #6 on: May 20, 2006 »
I still wait to see a demo claiming "Have you ever seen a cosine scroller before? WORLDS FIRST!!!" =)))
Challenge Trophies Won:

#### taj

• Bytes hurt
• Posts: 4810
• Karma: 189
• Scene there, done that.
##### Re: The diffrence between Sin() and Cos() (ez)
« Reply #7 on: October 24, 2006 »
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 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

• Founder Member
• Posts: 5257
• Karma: 394
##### Re: The diffrence between Sin() and Cos() (ez)
« Reply #8 on: October 24, 2006 »
I guess the real answer to "what's the difference between Sin and Cos?" is just "90degrees"

Jim
Challenge Trophies Won:

#### Clanky

• Laser Guided Memories
• Amiga 1200
• Posts: 338
• Karma: 16
• kiss that sound that pounds your senses
##### Re: The diffrence between Sin() and Cos() (ez)
« Reply #9 on: October 25, 2006 »
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..