2D Geometry. Find equation of a circle 
The line $y=x$ touches a circle at $P$ so that $OP=4\sqrt{2}$ where $O$ is the origin. The point $(-10,2)$ lies inside the circle and the length of the chord $x+y=0$ is $6\sqrt{2}$.
Find the equation of the circle.

How to approach this sum?
My approach to the sum: I found that the lines $y=x$ and $x+y=0$ are perpendicular and meet at the origin . Now how to use the given information about the lengths and find the radius? Since the lines are perpendicular, I know I have to use Pythagorean theorem to find the radius.
 A: First of all, draw a sketch of what you have and what you need to obtain. Drawings usually clarify what you need to do. Then:


*

*Find $P$. Since it lies on the line $y=x$, it is of the form $(x,x)$ for some $x\in\mathbb{R}$. Use Pyhtagorean theorem. You should obtain two possible candidates, but later you will discard one.

*If the a circle touches a line at a point $P$ (that is, the line is tangent), then its center lios on the perpendicular to the line through $P$. Find its equation $y=mx+n$, with $m,n\in\mathbb{R}$. Again, two lines, one per candidate of step 1.

*The center is of the form $C=(a,ma+n)$, $a\mathbb{R}$, so the equation of the circle is 
$$(x-a)^2+(y-mx-n)^2=r^2.$$
Note that $m$ and $n$ are known from step 3. Moreover, the radius $r$ is the distance from $C$ to $P$. Compute it, in terms of $a$.

*Intersect the circle of step 4 (the equation is in terms of $a$) and the the line $x+y=0$. Solving the system (in terms of $a$) gives you two points. 

*Compute the distance between those two points and find the $a$ that makes it equal to $6\sqrt{2}$.

*Solve back and pick the only possible solution.
A: The only points on $y=x$ which are $4 \sqrt{2} $ away from the origin are $(4,4)$ and $(-4,-4)$.
The perpendicular distance from the centre of the circle to the chord $x+y=0$ is $4 \sqrt{2} $. 
So the radius of the circle is $\sqrt{(4\sqrt{2}) ^2 +(6\sqrt{2} \div 2)^2 } =5\sqrt{2} $. 
The centre of the circle is $(4,4)\pm(5,-5)$ or $(-4,-4)\pm(5,-5)$. 
The only possible case that $(-10,2)$ is inside the circle is when its centre is $(-9,1)$.
The equation of the circle is $(x+9)^2+(y-1)^2=50$.
A: The equation of circle is
$(x+9)^2+(y-1)^2=50$
