Question: How can I write the equation of a sphere in the form (x-a)^2 + (y-b)^2 + (z-c)^2 = r^2

I this code, I do by my hand (x - ptA[1])^2 + (y - ptA[2])^2 + (z - ptA[3])^2 = r^2;

restart;
with(geom3d);
ptA := coordinates(point(A, 1, -4, 3));
point(B, -3, 2, 5);
r := distance(A, B);
Equation(sphere(S, [A, r], [x, y, z]));
(x - ptA[1])^2 + (y - ptA[2])^2 + (z - ptA[3])^2 = r^2;

When I used Equation(sphere(S, [A, r], [x, y, z])); I got


Is there a function to convert Equation(sphere(S, [A, r], [x, y, z])); to get the result

Please Wait...