How do I find the value of r?

(r - 2)^2 + (r - 4)^2 = r^2

I know what r is, coincidentally, (it's 10)

But how would I go about finding it if I didn't know?

Wasn't sure where to post this, it's not homework, I got it from a brain teaser (finding the radius of a circle which is inside a square with a 2x4 rectangle in the corner, the radius is r as seen above)