Question: Equation of a sphere (3)

Problem. Write the equation of the sphere passing through the three points

A(-1, 2, 1), B(-3, 4, -5), C(1, 2, -3) and its centre 

1) lies in  the plane (P): 2*x + 3*y -z = 0;
2)lies on the sphere (x-3)^2 + (y+1/3)^2 + (z-1)^2=1.
 
This is my code
1) 

restart;with(geom3d):

point(A,-1,2,1):

point(B,3,-4,5):

point(C,1,2,-3):

point(T,x,y,z):

plane(P,2*x + 3*y -z = 0,[x,y,z]):

TA:=distance(T,A):

TB:=distance(T,B):

TC:=distance(T,C):

sol:=solve([TA = TB, TA = TC, Equation(P)],[x,y,z]);

point(T1,subs(sol[1],coordinates(T))):

Equation(sphere(S1,[T1,distance(T1,A)],[x,y,z]));

(S[1]):=Student[Precalculus][CompleteSquare](Equation(S1));

 

2) 

> with(geom3d):

point(A,-1,2,1):

point(B,3,-4,5):

point(C,1,2,-3):

point(T,x,y,z):

sphere(S,(x-3)^2 + (y+1/3)^2 + (z-1)^2=1,[x,y,z]):

TA:=distance(T,A):

TB:=distance(T,B):

TC:=distance(T,C):

sol:=solve([TA = TB, TA = TC, Equation(S)],[x,y,z]):

point(T1,subs(sol[1],coordinates(T))):

Equation(sphere(S1,[T1,distance(T1,A)],[x,y,z]));

(S[1]):=Student[Precalculus][CompleteSquare](Equation(S1));

point(T2,subs(sol[2],coordinates(T)));

Equation(sphere(S2,[T2,distance(T2,A)],[x,y,z]));

(S[2]):=Student[Precalculus][CompleteSquare](Equation(S2));

 

Please comment to me. Thank you very much.

Please Wait...