Question: Coordinates of a point (7)

Problem. Find the coordinates of the point M on the sphere (S): x^2 + y^2 + z^2-2*x+4*y+2*z-3=0 such that the distance from the point M to the plane 2*x-y+2*z-14=0 is the smallest, the largest.

This is my code

> restart;with(geom3d):sphere(S,x^2 + y^2 + z^2-2*x+4*y+2*z-3=0,[x,y,z]):

point(C,coordinates(center(S))):

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

n:=NormalVector(P):

line(Delta,[C,n],t):

Eq:=Equation(Delta):

sol:=solve([x=Eq[1], y = Eq[2], z = Eq[3], Equation(S)],[x,y,z,t]);

coordinates (point(M1, rhs(op(1,sol[1])), rhs(op(2,sol[1])), rhs(op(3,sol[1]))));

distance(M1,P);

coordinates(point(M2, rhs(op(1,sol[2])), rhs(op(2,sol[2])), rhs(op(3,sol[2]))));

distance(M2,P);


Please comment to me for the commands 

sol:=solve([x=Eq[1], y = Eq[2], z = Eq[3], Equation(S)],[x,y,z,t]);

and 

coordinates (point(M1, rhs(op(1,sol[1])), rhs(op(2,sol[1])), rhs(op(3,sol[1]))));

 

 

Please Wait...