Skip to main content
gamedev.net
🔒 Locked

Trigonometric Functions

Started by Spintwo May 30, 2004 at 12:19 PM 7 replies 1.1k views
Original Post
Spintwo
Spintwo
When you find tan, cos, and sin, what actual value are you computing. This lack of a defintion for these functions are holding me back from figuring out a question like so: Figuring out x. Now disregarding the first question (which I still need an answer to), I have this so far: tan 60 = ((sin 60)/(cos 60)) -by some theorem tan 60 = ((sqrt(3)/2)/.5) -exact solutions simplify: tan 60 = sqrt(3) Okay, so I found the tangent, but now what do I do with it to find the x-value side?
Charles Hwang -aka oatmeal.net [Maxedge My Site(UC)|E-mail|NeXe|NeHe|SDL] [Google|Dev-C++|GDArticles|C++.com|MSDN] [edited by - skybin on May 30, 2004 1:19:56 PM]
Nervo
Nervo
tan(60) = 10/x
Well, R2D22U2..
uber_n00b
uber_n00b
For now, you should think of sine, cosine and tangent as lookup tables when your comp calculates them, because there is no real formula for calculating them beyond infinite series. If a triangle has sides O, A and H, where H is the longest side, and O and A are perpendicular to each other, and angle X is the angle between A and H, then cosX = A / H, sinX = O/H and tanX = O/A. You can readily see that since O/H / (A/H) is sin/cos, then sin/cos = tan because those H''s will divide out. Maybe you understand that but oh well, I''m incredibly bored at the moment.
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
PyroSA
PyroSA
My previous math teachers would probably send a death squad after me... but this is how I'll explain it:

A circle has a radius r.

At angle 'a' it would have an x offset of cos(a)*r and a y offset of sin(a)*r ...

So the actual value you are calculating is simply that, the x and y offset (cos and sin) of the edge (circumferance?) of the circle at that angle ...

Tangent is simply a ratio of y to x.

Tan(a) = y/x
Cos(a) = x/r
Sin(a) = y/r

and their inverses (cosec & sec corrected, thanks uber_n00b)
Cotan = x/y
Sec = r/x
CoSec = r/y

Very simple, but probably not very scientific.

[edited by - PyroSA on June 1, 2004 5:44:01 PM]
uber_n00b
uber_n00b
I''d like to point out two things: First off, ''that angle'', is the angle formed by connecting the center of the circle with the right most point on the circle, and then the center of the circle to the point in question on the circumference to calculate sin/cos. Second of all, Sec = H / A (or r/x) according to the poster, so Csc = r / y.
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
Spintwo
Spintwo
I''ve run into a problem with Nervo''s explanation. After working it out on paper, I found out that going with 10/x doesn''t come up with the right answer (according to the back of the book). My first reply was incorrect; the first one I typed in as 10x and as I was doing the math I was typing on the screen, it came out right. Now that I do it on paper with the right things, I come up with this.

tan(60)=sqrt(3)
tan(60)=10/x
sqrt(3)=10/x

Multiply each side by 1/10.

sqrt(3)/10=x

but the book says the answer is: 10/sqrt(3)

Now, where''d I go wrong?


Charles Hwang -aka oatmeal.net
[Maxedge My Site(UC)|E-mail|NeXe|NeHe|SDL]
[Google|Dev-C++|GDArticles|C++.com|MSDN]
grhodes_at_work
grhodes_at_work
Since this is clearly a problem from a textbook, which provides the answer in the back, I''m assuming this is a homework question. Actually, these forums strongly discourage homework and this forum in particular has an anti-homework policy. The Forum FAQ has more detail. To enforce the policy and to be fair to some other posts I''ve closed lately, I am closing this thread for the same reason. Its nothing personal. I''m tasked to try and keep the forum on topic - game development.

Graham Rhodes
Principal Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.