I'm trying to figure out the length of a side of a square:

I tried to work it out this way:A square is inscribed in a circle of radius r. Express the length of the side of the square in terms of r.

$\displaystyle x^2+x^2=r^2$ since the the lines insribed on the insides of a square are right angles right?

$\displaystyle 2x^2=2r^2$

$\displaystyle x^2=r^2$

$\displaystyle x=r$

but the answer says r doesn't = x so what am I doing wrong here and how can I get the right answer?