Archived

This topic is now archived and is closed to further replies.

i1977

Can someone refresh my memory?

Recommended Posts

Hi! I''m beginning 3D programming, and in order to better understand some of the algorithms that I read about, I''d like someone to refresh my memory about sin, cos and tan... My math classes are a little far behind me and I have forgotten what these do exactly. Can someone give me a clear explanation? Thanks!

Share this post


Link to post
Share on other sites
Well, remember Triangles?
Sine, Cosine, and Tangent relate to Side lengths of a triangle given two other lengths.
Remember SohCahToa ? It stands for:
Sine = Opposite / Hypotenuse
Cosine = Adjacent / Hypotenuse
Tangent = Opposite / Adjacent

You then take 2 side lengths and solve for the angle measure by means of one of those functions, or one angle and one side and solve for the other.. Depending on the two lengths, you use a function. If you have the hypotenuse and its adjacent side(not the opposite from the angle) then you would use the Cosine function. cos = adjacent / hypotenuse. Plug in the two values you have and the third comes.
When you have to lengths you use inverse sin, cos, tan. This results in the angle measure.

Get it? All you wanted was to understand the relevance to them in 3D programs? I hope this was enough.

Share this post


Link to post
Share on other sites
Thanks! That''s what I wanted to know. Just one more question. When looking at an angle in the triangle, two sides form that angle. How do I know which one to use for the "Adjacent" value in those formulas?

Share this post


Link to post
Share on other sites
That only works for right angled triangles doesn''t it? For other types I think the relationship is a/sinA=b/sinB=c/sinC; a being a side, and A being the angle opposit that side. Don''t know how to apply it though...

Share this post


Link to post
Share on other sites