A chord PQ of the circle $x^2+y^2-2ax-2by=0$ subtends an angle of $45^{\circ}$ to the origin.

Given that M is the mid point of PQ. Find the equation of the locus of M.

**MY ATTEMPT**
Centre of the given circle $=
\frac{-1}{2}[(-2a),(-2b)]=C(a,b)$

Let, $M(x,y)$

Slope of $CM$=$(\frac{b-y}{a-x})$

$CM\perp PQ$

$\therefore$ Slope of $PQ$=-$(\frac{a-x}{b-y})$

Equation of $PQ$ gives locus of $M(x,y)$

$\implies$$y\_{PQ}=m\_{PQ}x+c$

$\implies$$y=-(\frac{a-x}{b-y})+c$

*But my approach above is wrong since the textbook answer is as below:*

$x^2+y^2-2ax-2by+\frac{1}{2}(a^2+b^2)=0$

**YOUR HELP WILL BE HIGHLY APPRECIATED**