Locus of a point on a fixed-length segment whose endpoints slide along orthogonal lines 
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?

WLOG let the orthogonal lines be the $x$-axis and $y$-axis respectively. 
Let $P=(x,y), A=(0,y+k), B=(x+h,0), AP=a, PB=b$. 
By Pythagoras' theorem, 
$$\begin{align}
(y+k)^2+(x+h)^2&=(a+b)^2\\
(y+\sqrt{a^2-x^2})^2+(x+\sqrt{b^2-y^2})^2&=(a+b)^2\\
y\sqrt{a^2-x^2}+x\sqrt{b^2-y^2}&=ab\\
y^2(a^2-x^2)&=a^2b^2-2abx\sqrt{b^2-y^2}+x^2(b^2-y^2)\\
2abx\sqrt{b^2-y^2}&=b^2x^2-a^2y^2+a^2b^2\\
4a^2b^2x^2(b^2-y^2)&=b^4x^4+a^4y^4+a^4b^4+2(-a^4b^2x^2y^2+a^2b^4x^2-a^4b^2y^2)\\
2a^2b^2x^2(b^2-y^2)&=b^4x^4+a^4y^4+a^4b^4-2a^4b^2y^2\\
2a^2b^2(b^2x^2+a^2y^2-x^2y^2)&=b^4x^4+a^4y^4+a^4b^4\\
(a^2y^2+b^2x^2-a^2b^2)^2&=0\\
a^2y^2+b^2x^2&=a^2b^2\\
\frac {x^2}{a^2}+\frac{y^2}{b^2}&=1
\end{align}$$
which is an ellipse.
