
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?

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?
Copyright © 2021 JogjaFile Inc.
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.