Archived

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

Slope to angle?

This topic is 5775 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

Just throwing what I remember from HS math clases out (shouldn't having been sleeping so much). But I do remember the word "SoaCahToh". Basically its all the basic trig functions you need for a right angle triangle.

(Insert image of a right triangle with corners labeled A, B and C)

First think of what angle you want, the angel of A, B or C. Then label the three sides as (h)ypotenuse (the side opposite the right angle), (o)pposite (either the side opposite the point, or if that is the hypotenuse then pick a remaining side) and (a)djacent (the last side).


Now use SoaCahToh to make a formula and solve it for the unknown.

Sin(Angle)=opposite/adjacent
Cos(Angle)=adjacent/hypotenuse
Tan(Angle)=opposite/hypotenuse



Edited by - Michalson on February 16, 2002 4:27:23 PM

Share this post


Link to post
Share on other sites
I'm an idiot. Forgive me for even posting this. I don't know why I didn't think of it before. I realized I just need the inverse sin and so on. Does Math.h have this function, and if so, what is it called?

--Vic--

Edited by - Roof Top Pew Wee on February 16, 2002 4:31:51 PM

Share this post


Link to post
Share on other sites
If I remember right, you could always use the inverse of tan. I''m sure math.h has that, instead of inverse sin..

Rather than using adj, hyp and inverse sin, you would use adj, opp and inverse tan.

Oh, and I believe it''s SohCahToa.

Share this post


Link to post
Share on other sites
just in case someone does not know this:

Michalson is wrong with his formulas
its acutally "sohcahtoa"

sin(angle) = opposite/hypotenuse
cos(angles)= adjacent/hypotenuse
tan(angle) = opposite/adjacent




Share this post


Link to post
Share on other sites
There''s a nice function in math.h called atan2. It takes two arguments - first deltaY, then deltaX, and returns the angle. If you just use atan, you need to then add a multiple of 90 degrees that corresponds to the quadrant indicated by the combination of signs. Also note that there are single-precision versions of most of the math functions. Just put an f at the end of each. Example: sinf() instead of sin().

Share this post


Link to post
Share on other sites