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.
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?

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)$.