What are sine, cosine, and tangent? Constants? Functions?

...And how are they useful?

The only use for them I know is the:

angle degree = -tan(o/a)

Other than that, I know pretty much nothing about the 3. =\

Printable View

- 03-07-2004KrakStupid Question:
What are sine, cosine, and tangent? Constants? Functions?

...And how are they useful?

The only use for them I know is the:

angle degree = -tan(o/a)

Other than that, I know pretty much nothing about the 3. =\ - 03-07-2004Thantos
Take some trig and learn :)

In the basic way is that from an Angle:

sine is the ratio of the opposite leg to the hypotenuse

cosine is the ratio of the adjucent leg to the hypotenuse

Tangent is the ratio of the opposite leg to the adjucent leg - 03-07-2004KrakQuote:

*Originally posted by Thantos*

**Take some trig and learn :)**

In the basic way is that from an Angle:

sine is the ratio of the opposite leg to the hypotenuse

cosine is the ratio of the adjucent leg to the hypotenuse

Tangent is the ratio of the opposite leg to the adjucent leg

- 03-07-2004Thantos
They are used for solving triangles. Honestly you'll need to take Trig to get the full usefullness of them.

- 03-07-2004...
the sine, cosine and tangent are basically ratios of the lenghths of two sides of a triangle.

take for example, the scenario where you know an angle of a right triangle and the length of one of the sides, and you need to find out the length of one of the other sides. you would then work out via algebra whether to multiply or divide the result of the sin, cos, or tan ( depending on what side you have / need ) by the length of the side you have

Code:

|\

| \

| \

| \ 5

x | \

| \

|_____30__\

y

sin( 30 ) * 5 = the length of x

cos( 30 ) * 5 = the length of y

trig is really useful for solving these types of equations. in computer game programming (which i am into more than any other realm of programming) we dont normally use trig where we can avoid it, because trig functions are slow. game programmers spend most of their time with linear algebra and vectors and stuff, but that doesnt mean it isnt still used on occasion. - 03-07-2004...
oops, disregard... double post

- 03-07-2004KneeGrow
Well as ... mentions, they are used for finding sides of triangles. Especially when u get into advanced math sin, cos, and tan are especially useful. Also if ur gonna go into triangles, know some trig identities

- 03-08-2004VirtualAceCode:
`#define PI 3.14159`

#define MAX_X 640

#define MIN_X 0

#define MAX_Y 480

#define MIN_Y 0

#define DEGTORAD(x) ((double)x*PI/180.0)

struct point2D

{

double x;

double y;

};

class Bullet

{

point2D Screen;

point2D Velocity;

int Angle;

public:

Bullet(point2D tScreen,int tAngle);

Move(void);__void__

};

Bullet::Bullet(point2D tScreen,int tAngle)

{

Angle=tAngle;

Screen=tScreen;

Velocity.x=cos(DEGTORAD(tAngle));

Velocity.y=sin(DEGTORAD(tAngle));

};

void Bullet::Move(void)

{

Screen.x+=Velocity.x;

Screen.y+=Velocity.y;

if (Screen.x>=MAX_X) Velocity.x=-Velocity.x;

if (Screen.x<=MIN_X) Velocity.x=-Velocity.x;

if (Screen.y>=MAX_Y) Velocity.y=-Velocity.y;

if (Screen.y<=MIN_Y) Velocity.y=-Velocity.y;

}

EDIT: I forgot to place the return type in front of my move() function member. - 03-08-2004MrWizard
Google for "Computer Graphics" sin cos tan will all make appearances on those related pages.

- 03-08-2004nickname_changed
They also pop up a lot in physics, like finding the horizontal and vertical velocities of a ball kicked at say 30 degrees at 15 k's an hour. That will let you calculate how long the ball will go, how high etc.

I would also expect it to pop up a lot in architecture and any forms of engineering.

As a pleb you'll probably not have any use for it, but if your going for a professional career like engineering or even in IT they might just come in handy. Plus they are fun to learn (IMHO) and the problem solving aspects alone are worth learning.

Functions can be a lot of fun. Lets say you have a graph of say y = 5x + 3.

This could also be written as f(x) (ie, a function of x) = 5x +3

They come up a lot when your finding things like the derivative of a graph, ie. the instantaneous speed of a graph of distance vs time at a given point X.

Constants are just numbers. Pie is a constant, so is 5, 10002, -111000 and 0. Their values never change, so they are constant. - 03-08-2004gcn_zelda
Sines, cosines, and tangents can also be used with circles, I believe, but, hey, I'm starting Adv. Trig in High School next year...

- 03-08-2004Lurker
Wow! Bubba posted code without assembler in it!

- 03-08-2004VirtualAceQuote:

Wow! Bubba posted code without assembler in it!

Yes, it does happen every now and then.

Most of that would be a real mess in assembler and you probably wouldn't gain much for your troubles.

So I beg for forgiveness from the assembly gods because Bubba hath failed thee this time.

:D - 03-08-2004EvBladeRunnervEQuote:

Sines, cosines, and tangents can also be used with circles, I believe, but, hey, I'm starting Adv. Trig in High School next year...

X^2 + Y^2 = R^2

where R is the radius of the circle. a unit circle can be defined using trigonometric functions as:

cos^2 x + sin^2 x = 1 - 03-08-2004linuxdudeQuote:

X^2 + Y^2 = R^2