How to calculate a point on a rotated axis?

天涯浪子 提交于 2019-12-08 12:00:17

问题


How can I calculate a point (X,Y) a specified distance away, on a rotated axis? I know what angle I'd like the point "moving" along (in degrees).


回答1:


x = cos(a) * d
y = sin(a) * d

where a is the angle and d is the distance.

If the trigonometry functions takes radians intead of degrees, you have to convert the angle by dividing by 180/pi.




回答2:


Convert to polar coordinates and then rotate the point through the angle you want:

x = r * cos( theta );
y = r * sin( theta );

Note: theta in radians ( deg = rad * 180 / pi )

More info on polar coordinates.




回答3:


Do you mean the 3d formulas? They are easy as well. But we need to know what's your convention for specifying the axis.



来源:https://stackoverflow.com/questions/1055062/how-to-calculate-a-point-on-a-rotated-axis

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