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

0 Members and 1 Guest are viewing this topic.

Offline Roly

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 7
    • View Profile


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

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3286
  • Karma: 47
    • View Profile
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:

Offline Shockwave

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

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7245
  • Karma: 71
    • View Profile
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:

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1274
  • Karma: 95
    • View Profile
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.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5243
  • Karma: 393
    • View Profile
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:

Offline Optimus

  • DBF Aficionado
  • ******
  • Posts: 2391
  • Karma: 126
    • View Profile
    • Optimouse Demo Site
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:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
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 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:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5243
  • Karma: 393
    • View Profile
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" :D

Jim
Challenge Trophies Won:

Offline Clanky

  • Laser Guided Memories
  • Amiga 1200
  • ****
  • Posts: 336
  • Karma: 15
  • kiss that sound that pounds your senses
    • View Profile
    • Facebook
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..