Atan2

来源:互联网 发布:微信小游戏源码 编辑:程序博客网 时间:2024/06/06 10:24

Some thing i should know about atant2:

Most content of this article copyed from wikipedia

The purpose of using two arguments instead of one is to gather information on the signs of the inputs in order to return the appropriate quadrant of the computed angle, which is not possible for the single-argument arctangent function.

Atan2 is very useful  in determining angle between lines in 2d or  3d space.

The positive winding direction always start from x positive axes (the second parameter) to y positive axes(the first parameter).



So  -pi <= atan2 <= pi, 

And it 't pretty easy to figure out

 -atan2(y, x) = atan2(-y, x)

 atan2(y, -x) = Pi - atan2(y, x)


0 0
原创粉丝点击