Finding the angle of an X and Y movement

Started by
6 comments, last by Cybertron 22 years, 2 months ago
On the calculator there is a tan-1 function to get the angle of tan(X) = opposite/adjacent, but what is the math libraries version? I bet it is dog slow, is there any way to optimize it (floating point index support, maybe just round it or find the closest one) ahh the wonderfull world of physics (not!)
Advertisement
Assuming you''re using C/C++ look up atan and/or atan2 (just do a search online, you''ll find them).

why an online search, why not look in the VC++ documentation?
quote:Original post by Anonymous Poster
why an online search, why not look in the VC++ documentation?

Did he say he has MSVC? If he doesn''t have MSVC, then me telling him to look it its documentation is no better than me assuming he uses a Unix and telling him to look at atan(3) in the man pages. So, I gave him a generic answer...

I like asking questions better, so I can answer myself and provide info to other people if I find it myself

talking aboult libraries is a unix term, guess I should always mention my platform (VC++ 6 :p )! (like in my sig maybe)

so you give atan2 the length of the opposite and adjacent sides and it gives you the angle? I have no idea what an ''arctangent'' is :p
that''s right.
atan(opposite/adjacent) = angle
I still mentally use "soh-cah-toa" to remember which one to use with whice sides.

- seb
quote:Original post by BSXrider
I still mentally use "soh-cah-toa" to remember which one to use with whice sides.

- seb


I just learned trig a month or 2 ago :p man that was fun, if only the exam was only trig and not stupid factoring...

This topic is closed to new replies.

Advertisement