loading
 
Atan2 problem
RVamzess from Poland  [2 posts]
9 years
Hello,

I thought i know how atan2 works, but i am very surrprised. Results that i get are strange. Please help me and let me know:
-how to obtaint an angle for a strait line (i know its directional rate - gradient) in the first quarter of coordinate arrangement, or
-how atan2 exactly works, or
-at last how to calculate arcus tangens in other way.

Thanks in advance.
Anonymous 9 years
Yea, it is a little confusing once you first start working with it. We basically just mapped the C++ version of atan2. For more description on that have a look at

http://www.cplusplus.com/reference/clibrary/cmath/atan2.html

Some tips are:

- Convert to degrees

(atan2(100,100)*180.0f)/3.14159

- Convert to 0 - 2PI range

deg = atan2(100,100)
if deg < 0 then deg = 6.2831853 + deg

- Convert to 0 - 360 range

deg = (atan2(100,100)*180.0f)/3.1415927
if deg < 0 then deg = 6.2831853 + deg

STeven.
RVamzess from Poland  [2 posts] 9 years
Thanks a lot indeed Steven!


The problem is solved now!


RVamzess

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index