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).
+7
A:
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.
Guffa
2009-06-28 15:00:59
Possibly adding "+ox" and "+oy" considering (ox, oy) the origin of the rotation? Or am I wrong on this topic?
luiscubal
2009-06-28 15:32:47
Sure, and a in radians not degrees or grads.
Burkhard
2009-06-28 15:43:53
A:
Do you mean the 3d formulas? They are easy as well. But we need to know what's your convention for specifying the axis.
ilya n.
2009-06-28 15:04:19
+1
A:
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.
dwj
2009-06-28 15:04:25