I'm trying to figure this out for player movement in a video game but I'm having trouble figuring it out: How do I find a point $(x_1,y_1)$ if I have an origin point $(x_0,y_0)$, a distance, and $\theta$?
How do I find a point $(x_1,y_1)$ if I have an origin point $(x_0,y_0)$, a distance, and $\theta$?
3
$\begingroup$
trigonometry
euclidean-geometry
-
0x axis, counter clockwise – 2011-06-11
1 Answers
5
Use the following formulas: $ x_1 = x_0 + d\cos\theta\qquad\text{and}\qquad y_1=y_0 + d\sin\theta. $
-
1@Xavier: If the origin is at (0,0), the point at distance $r$ and angle $\theta$ is at $(r\cos\theta, r\sin\theta)$. This can perhaps be called changing from polar coordinates to rectangular coordinates. Taking the origin at $(x_0,y_0)$ instead is just a [translation](http://en.wikipedia.org/wiki/Translation_(geometry)). – 2011-06-11