Solve for x r = square root of x^2+y^2