Give coordinates of line A, find the coordinates of another line meeting line A at an angle.

41 Views Asked by At

In the diagram, if x1, y1, x2, y2, l, and k are known, how do I calculate a and b?

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

The pivot point is $(x_2 , y_2)$. Calculate the unit vector pointing from $(x_2, y_2)$ to $(x_1, y_1)$. This is given by $\mathbf{u}$ where

$ \mathbf{u} = \dfrac{ ( x_1 - x_2, y_1 - y_2 ) }{\sqrt{ (x_1 - x_2)^2 + (y_1 - y_2)^2 } } $

Now rotate $\mathbf{u}$ by $k^\circ$ clockwise, to get the vector $\mathbf{v}$ which is given by

$ \mathbf{v} = (\cos(k^\circ) \ u_1 + \sin(k^\circ) u_2 , -\sin(k^\circ) u_1 + \cos(k^\circ) u_2 ) $

Finally scale $\mathbf{v}$ by the length $\ell$ and add the resulting vector to $(x_2, y_2)$. Hence,

$(a,b) = (x_2, y_2) + \ell \mathbf{v} $