Locus of point at a fixed distance from midpoint of intercepts of a variable line segment with fixed distance 
Let A and B be variable points on the x-axis and y-axis respectively such that the line segment AB is in the first quadrant and of a fixed length 2d. Let C be the mid-point of AB and P be a point such that
(a) P and the origin are on the opposite sides of AB and,
(b) PC is a line of length d which is perpendicular to AB.
Find the locus of P.
Source

In this problem, I have drawn the figure containing the line AB and point P and everything. I have also named point as(h, k),thereby applying all suitable equations.Inspite of all that, it is getting clumsy.
Can anyone provide a elegant solution to it?
 A: Observe that $\triangle APB$ is an isosceles right-angled triangle, hence $OAPB$ is cyclic.

Note that $\angle BAP = \angle BOP = 45^\circ$. Hence $P$ lies on the line $y=x$.
Now we need to find the range of the length of $OP$. Intuitively it cannot be too long or too short since $P$ is bounded in a circle of radius $d$ containing the origin.
By Ptolemy's Theorem: $AO \times PB + AP \times OB = AB \times OP$.
Hence $AO \times \sqrt2 d+ \sqrt2d\times OB = 2d \times OP$, giving $\sqrt 2OP = AO+ OB$.
We have $AO^2 + OB^2 = 4d^2$. By letting $x = AO$ and considering the function $x + \sqrt{4d^2 - x^2}$ or otherwise (there should be a better way to do this), we see that the maximum occurs when $AO = OB = \sqrt 2d$ and the minimum occurs when $AO$ or $OB = 0$, giving the range:
$$\sqrt 2 d \le OP \le 2d$$
hence the locus is the line segment connecting the points $(d,d)$ and $(\sqrt 2 d, \sqrt 2d)$.
A: Let $A = (x, 0), 0 \leq x \leq 2d$ and $\alpha = O\hat{A}B$ (note that $\cos\alpha = \frac{x}{2d}$). Then $B = \left(0, x \tan\alpha\right)$ and $C = (\frac{x}{2}, \frac{x\tan\alpha}{2})$. Because $P$ and the origin are on the opposite sides of $AB$, we define $\vec{v} = (\sin\alpha, \cos\alpha)$ so that $P = C + d\vec{v} = (\frac{x}{2} + d\sin\alpha, \frac{x\tan\alpha}{2} + d\cos\alpha)$.
Also, $\cos\alpha = \frac{x}{2d} \implies \sin\alpha = \frac{\sqrt{4d^2 - x^2}}{2d}$ and $\tan\alpha = \frac{\sqrt{4d^2 - x^2}}{x}$. Substituting in $P$, $P = \left(\frac{\sqrt{4d^2 - x^2} + x}{2}, \frac{\sqrt{4d^2 - x^2} + x}{2}\right)$: $P$ lies on $x=y$.
For the limits (remember that $0 \leq x \leq 2d$): $f(x) = \frac{\sqrt{4d^2 - x^2} + x}{2}$ attains minimum at $x=2d$, with $f(2d) = d$ and maximum at $x=\sqrt2 d$, with $f(\sqrt2 d) = \sqrt2d$.
Therefore, locus of $P$ is the segment from $(d,d)$ to $(\sqrt2 d, \sqrt2 d)$.
