Suppose we have some segment $AB$ of constant length that slides in such a way that its endpoints are moving along orthogonal lines. Let $P$ be a point in the segment so that $|AP| = a$ and $|PB| = b$. How can we find the curve along which $P$ moves?
I was trying to write lines $ax + by = c$ since this is orthogonal to the other line, we know normal to the orthogonal one should be $N = (-b,-a)$ and so the equation of the other line is of the form $-b x - a y + d = 0$. Now, point $A$ lie in one of them and $B$ lies on the other one line. should I solve the equation $d(P,A) + d(P,B) = a+ b $? Am I on the right track?
Here's an illustration of my comment, although I've swapped the positions of $A$ and $B$ (for notational reasons that should be clear shortly).
We can use the angle ($\theta$) that the segment makes with the $x$-axis to parameterize the coordinates of the endpoints. Of course, what's important are the coordinates of point $P$, namely ...
One might (should?) recognize this as the parameterization of the origin-centered ellipse with radii $a$ and $b$.
The non-parametric form of this equation is, of course,
Generalization to the case of an arbitrary pair of perpendicular lines is straightforward. Let the lines meet at $Q = (x_0, y_0)$, and let the line containing sliding point $B$ make angle $\phi$ with the $x$-axis. We can transform equation $(2)$ into the equation of this ellipse with substitutions corresponding to rotation by $\phi$, followed by translation by $x_0$ and $y_0$.
$$\text{rotation:}\;\begin{cases} x \to \phantom{-}x \cos\phi + y \sin \phi \\ y \to -x \sin\phi + y \cos\phi \end{cases} \qquad\qquad \text{translation:}\;\begin{cases} x \to x - x_0 \\ y \to y - y_0 \end{cases}$$
That is,
where expansion and simplification is left as an exercise to the reader.
Alternatively, noting that the lines have unit direction vectors $(\cos\phi, \sin\phi)$ and $(-\sin\phi, \cos\phi)$, we easily adapt $(1)$ to get this parametric form of the locus: