How to find out if the angle between two vectors is external or internal?

隐身守侯 提交于 2019-12-01 22:46:13

You're looking for the atan2(y,x) function (http://en.wikipedia.org/wiki/Atan2). If you give it the two components of a 2D vector, it will give you the angle of the vector from the x axis, in the counter-clockwise direction. To solve your specific problem try:

atan2(v_y, v_x) - atan2(u_y, u_x)

Then you can add or subtract 360 degrees if the answer is out of the range of angles you desire.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!