How can I transform a quadratic polynomial in x and y into an equation of the form $(x-a)^2+(y-b)^2=c$?
f = -9 x + (3 x^2)/4 + (3 y^2)/4;
CompleteSquare[f_, x_] :=
Module[{a, b, c},
{c, b, a} = CoefficientList[f, x];
a (x + b/2/a)^2 + Simplify[(c - b^2/4/a)]]
CompleteSquare[f, x]
(*
3/4 (-6 + x)^2 + 3/4 (-36 + y^2)
*)
What I want is the following:
(x - 6)^2 + y^2 == 36