3
$\begingroup$

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$?

  • 1
    What is $\theta$ relative to? The $x$-axis, the $y$-axis, clockwise, anticlockwise...?2011-06-11
  • 0
    x axis, counter clockwise2011-06-11

1 Answers 1

5

Use the following formulas: $$ x_1 = x_0 + d\cos\theta\qquad\text{and}\qquad y_1=y_0 + d\sin\theta. $$

  • 0
    Thank you. Do these formulas have a name or something I can use to reference them by?2011-06-11
  • 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