Artificial intelligent assistant

How to find position of point that is x unit distant from AB line segment and y unit distant from BC line segment? ![Representation image]( I am trying to calculate coordinates of point P, which is x units distant from AB line segment and y units distant from BC line segment. Edit: I am trying to write code for general solution. As parameters, I have three points (coordinates) A, B and C and also two values for distance x and y.

Hint:

Without loss of generality we can assume that $B$ is the origin and $C$ is a point on the $x$ axis. Changing a bit your notation, let $P=(x_P,\pm b)$ where $|b|$ is the distance from $BC$ (your $y$). If we have $A=(x_A,y_A)$ than the line $BA=r$ has equation $ y_Ax-x_Ay=0$.

The distance $a$ of $P$ from this line $r$ is: $$ \overline{Pr}=\frac{|y_Ax_P\mp x_Ab|}{\sqrt{x_A^2+y_A^2}}=a $$ Solving this equations you can find all points $x_P$.

* * *

If all the points $A,B,C$ are given in some coordinate system, then you have to perform a change of coordinates, that, in general, is given by a translation and a rotation. Or you can find the equations of the two lines: $$ a_1x+b_1y+c_1=0 \qquad a_2x+b_2y+c_2=0 $$

and solve the system of the two equation for the distances of the point $P$ from these two lines.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 52da7b99a3df0b25e47bda4bc216d6ea