Jump to content
  • Advertisement

Archived

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

i1977

Can someone refresh my memory?

This topic is 5878 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!