Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Blitz => Topic started by: Roly on May 17, 2006

Title: The diffrence between Sin() and Cos() (ez)[BB2D]
Post by: Roly 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?

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.
Title: Re: The diffrence between Sin() and Cos() (ez)
Post by: relsoft on May 17, 2006
I dont think cos is the inverse of sin.

Sin = O/H and Cos = A/H

1/sin <> cos = cosecant


Title: Re: The diffrence between Sin() and Cos() (ez)
Post by: Shockwave on May 17, 2006
Doh!
Title: Re: The diffrence between Sin() and Cos() (ez)
Post by: Clyde on May 17, 2006
In basic Maths, what does that actuall mean?

Cheers and many thanks,
Clyde.
Title: Re: The diffrence between Sin() and Cos() (ez)
Post by: Stonemonkey 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.
Title: Re: The diffrence between Sin() and Cos() (ez)
Post by: Jim 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
Title: Re: The diffrence between Sin() and Cos() (ez)
Post by: Optimus on May 20, 2006
I still wait to see a demo claiming "Have you ever seen a cosine scroller before? WORLDS FIRST!!!" =)))
Title: Re: The diffrence between Sin() and Cos() (ez)
Post by: taj 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 ;-)
Title: Re: The diffrence between Sin() and Cos() (ez)
Post by: Jim on October 24, 2006
I guess the real answer to "what's the difference between Sin and Cos?" is just "90degrees" :D

Jim
Title: Re: The diffrence between Sin() and Cos() (ez)
Post by: Clanky 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!