Advertisement

sin, cos, tan

Started by March 05, 2002 06:05 PM
17 comments, last by Xyx 22 years, 11 months ago
not sure if anyone has posted this yet, but this is how you get tan

from sin we have soh (sin=opp/hyp)
from cos we have cah (cos=adj/hyp)

and since tan toa (tan=opp/adj)
tan is calculated by sin/cos.

I couldn''t spot anyone posting this yet, and it is a very important thing if you are planning to use trig.

PS - this is also how the "fast" maths functions are used.
these functions return sin and cos at the same time, and you use this two results to get tan.
Note, this is the microsoft maths library I am refering to, not the standard "fastmath.h". I use both though, the microsoft one win in windows for the sincos function (except when I write my own) or for a single one I use either math.h or fastmath.h



Beer - the love catalyst
good ol'' homepage
Beer - the love catalystgood ol' homepage
Or you can go to the ultimate maths site...

http://mathworld.wolfram.com

Nice, clear explanations.

Regards,
Mathematix.
Advertisement
quote:
Original post by BronYrAur
sin(x) = opposite/hypotenuese, not opposite/adjacent.


True. That was a dumb little mistake on my part. It has been fixed.


quote:
Original post by Oluseyi
Sine and cosine do not define relationships for right triangles. Sine and cosine are circular functions and define a number of relations for different triangles constructed from a chord of the circle and the segment that exactly spans that chord. The sine and cosine rules, for example, are not typically used with right triangles, even though they still hold.


As true as all this is, I think this isn''t the best way to start someone off with sine and cosine. As Crazy_Vasey said, your first experience in school with sin/cos involves right triangles; I was following the same model. Describing sin and cos in terms of right triangles is not a lie; it''s just an easily-understood subset of their application. After all, you don''t start teaching long addition by explaining the number theory that makes the tecnnique work! As Xyx gets used to using the trig functions, he''ll understand their broader purpose.
quote:
Original post by Xyx
...how do you come up with the formula...



It is generally calculated using the Taylor series.

This is what math.com has to say about it.

A nice way to visualize it can be found here.



Edited by - TerranFury on March 9, 2002 12:25:04 PM
A marker on a rolling wheel would give you something called a "cycloid."
In this case, it''s as if we''re recording only the displacement of the marker perpendicular to the direction of motion, rather than its position.
Advertisement
quote:
Original post by TerranFury
As true as all this is, I think this isn''t the best way to start someone off with sine and cosine. As Crazy_Vasey said, your first experience in school with sin/cos involves right triangles; I was following the same model. Describing sin and cos in terms of right triangles is not a lie; it''s just an easily-understood subset of their application. After all, you don''t start teaching long addition by explaining the number theory that makes the tecnnique work! As Xyx gets used to using the trig functions, he''ll understand their broader purpose.

Granted, however I''ve long felt there should be ways of introducing material that effectively says "the full scope is broader than this, but here''s an approximation/definition that your puny intellects can handle" That way the adventurous are inspired to seek out more, just out of fun (I recommend Mathematics: A Cultural Perspective to anyone with the time; absolutely fascinating!), and the not-so-adventurous (or completely unadventurous) can make do with what they have.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
The sine and cosine rules can be arrived at via the combined use of sine and cosine in right angled triangles, pythagoras and all the angles in a triangle being 180.
It probably is true that its easier to learn using right triangles. I always wondered what the hell is happening when I press SIN COS or TAN on my calculator.
I only figured it out when I was trying to work out how people came up with these functions (horizontal and vertical distance center of a circle). Thats why its good to know the circle stuff.
I probably just wasn''t paying attention when they taught us the circle crap.

Proceeding on a brutal rampage is the obvious choice.
___________________________________________________________Where to find the intensity (Updated Dec 28, 2004)Member of UBAAG (Unban aftermath Association of Gamedev)

This topic is closed to new replies.

Advertisement