# Determining end coordinates of line with the specified length and angle?

I have the point $(x_1, y_1)$, the angle $0 \leq a < 360$ in degrees 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$?

-

$$(x_2,y_2)=(x_1+l\cdot\cos(a),y_1+l\cdot\sin(a)) \; .$$
Maybe you should add a comment on how to make sure that the calculator/computer computes the sine and cosine with respect to $a$ in degrees as opposed to radians and how to convert if necessary. –  t.b. May 16 '11 at 11:50
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)$.