5
$\begingroup$

I have the point $(x_1, y_1)$, the angle $0 \leq a < 360^o$ and the length $l > 0$.

How do I determine the end point $(x_2, y_2)$ if there is a line between $(x_1, y_1)$ and $(x_2, y_2)$ of length $l$ and with angle $a$?

2 Answers 2

3

$(x_2,y_2)=(x_1+l\cdot\cos(a),y_1+l\cdot\sin(a)) \; .$

There is an ambiguity in your question though: what is the reference w.r.t. which the angle is measured? I assumed it's the X-axis, since that seemed the most natural without any further specifications.

  • 2
    @Theo: OK, I'll wait$a$bit to see if the OP asks for it. I deliberately kept the answer to the point with not much details on derivation. It could be a homework question, just as it could be about programming something.2011-05-16
1

Knowing the length $l$ and the angle $a$ gives you a right triangle with base parallel to the $x$-axis and the hypotenuse is the line itself. From this you can calculate the length of the legs, using trigonometry: denote the length of the leg parallel to the $x$-axis by $X$, and the other one by $Y$. Then, by the law of sine you get: $\frac{X}{\cos a}=\frac{Y}{\sin a}=\frac{l}{\sin \frac{\pi}{2}}=l$. From here you can find $X,Y$. The the end-point will be $(x_2,y_2)=(x_1+X,y_1+Y)$.