Question: Equation of a sphere

restart;with(geom3d):

point(M,1,2,1):

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

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

line(d,[1+2*t,1-t,t],t):

n:=NormalVector(P):

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

Eq:=Equation(Delta):

intersection(N,d,P):

coordinates(N):

r:=distance(M,N):

Equation(sphere(S,[M,r],[x,y,z])):

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

allvalues(%);

point(T1,rhs(op(1,sol[1])), rhs(op(2,sol[1])),rhs(op(3,sol[1]))):

R1:=distance(T1,M):

Equation(sphere(S1,[T1,R1],[x,y,z])); S[1]:=Student[Precalculus][CompleteSquare](Equation(S1));

point(T2,rhs(op(1,sol[2])), rhs(op(2,sol[2])),rhs(op(3,sol[2]))):

R2:=distance(T2,M):

Equation(sphere(S2,[T2,R2],[x,y,z])); S[2]:=Student[Precalculus][CompleteSquare](Equation(S2));

 

I don't understand, if i replace the line line(d,[1+2*t,1-t,t],t): (the fifth line) by line(d,[1+2*t,1-t,3*t],t):

i got 

Error, invalid subscript selector

Error, (in geom3d:-distance) wrong type of arguments

Error, (in geom3d:-sphere) wrong type of arguments

Error, (in geom3d:-Equation) wrong type of argument

Please help me. Thank you very much
Please Wait...