How do I find out the coordinates, interpolating across an angled line?

33 Views Asked by At

enter image description here

Suppose I know the coordinates of $A$ and $B$. The angle $X$ does not mean the total angle between the red lines, but rather how far along the angle that the purple line is. What is the easiest way to calculate the coordinates of $P$ then?

1

There are 1 best solutions below

0
On

You can find the angle that $OA$ makes at the origin with $\theta=\text{atan2}(A_x,A_y)$. Then the angle that $OP$ makes is $\phi=\theta-x$ and the equation of $OP$ is $y=x \tan \phi$. The equation of $AB$ is $y-A_y=\frac{B_y-A_y}{B_x-A_x}(x-A_x)$ Two equations in two unknowns and $y$ eliminates easily.