with(plots):with(LinearAlgebra): EFG:=proc(X) > local Xu,Xv,E,F,G; > Xu:=; > Xv:=; > E:=DotProduct(Xu,Xu,conjugate=false); > F:=DotProduct(Xu,Xv,conjugate=false); > G:=DotProduct(Xv,Xv,conjugate=false); > simplify([E,F,G]); > end: UN:=proc(X) > local Xu,Xv,Z,s; > Xu:=; > Xv:=; > Z:=CrossProduct(Xu,Xv); > s:=VectorNorm(Z,Euclidean,conjugate=false); > simplify(,sqrt,trig,symbolic); > end: lmn:=proc(X) > local Xu,Xv,Xuu,Xuv,Xvv,U,l,m,n; > Xu:=; > Xv:=; > Xuu:=; > Xuv:=; > Xvv:=; > U:=UN(X); > l:=DotProduct(U,Xuu,conjugate=false); > m:=DotProduct(U,Xuv,conjugate=false); > n:=DotProduct(U,Xvv,conjugate=false); > simplify([l,m,n],sqrt,trig,symbolic); > end: GK:=proc(X) > local E,F,G,l,m,n,S,T; > S:=EFG(X);T:=lmn(X); > E:=S[1];F:=S[2];G:=S[3]; > l:=T[1];m:=T[2];n:=T[3]; > simplify((l*n-m^2)/(E*G-F^2),sqrt,trig,symbolic); > end: MK:=proc(X) > local E,F,G,l,m,n,S,T; > S:=EFG(X);T:=lmn(X); > E:=S[1];F:=S[2];G:=S[3]; > l:=T[1];m:=T[2];n:=T[3]; > simplify((G*l+E*n-2*F*m)/(2*E*G-2*F^2),sqrt,trig,symbolic); > end: sph:=; EFG(sph); lmn(sph); GK(sph); MK(sph); tor1:=<(R+r*cos(u))*cos(v)|(R+r*cos(u))*sin(v)|r*sin(u)>; GK(tor1); MK(tor1); catenoid:=; GK(catenoid);MK(catenoid); ellpar:=; GK(ellpar);MK(ellpar); helicoid:=; plot3d(helicoid,u=0..1.5,v=0..5*Pi,color=GK(helicoid), > grid=[10,40]); pair:=; GK(pair); MK(pair); plot3d(pair,u=-1.5..1.5,v=-1.5..1.5,axes=boxed,shading=xy, > lightmodel=light2,grid=[30,30],orientation=[-33,61]); plot3d(GK(pair),u=-1.5..1.5,v=-1.5..1.5,axes=boxed); plot3d(MK(pair),u=-1.5..1.5,v=-1.5..1.5,axes=boxed); plot3d(pair,u=-1.5..1.5,v=-1.5..1.5,scaling=constrained, > color=GK(pair),orientation=[-33,61],grid=[30,30]); plot3d(pair,u=-1.5..1.5,v=-1.5..1.5,scaling=constrained, > color=MK(pair),orientation=[83,147],grid=[30,30]); plotposconstcurv:=proc(c,theta,phi) > local X,desys,gu,s; > if 1/c>1 then s:=-Pi/2..Pi/2 else s:=-arcsin(1/c).. > arcsin(1/c) fi; > X:=[c*cos(u)*cos(v),c*cos(u)*sin(v),g]; > desys:=dsolve({diff(g(u),u)=sqrt(1-c^2*sin(u)^2),g(0)=0}, > g(u),type=numeric,output=listprocedure): > gu:=subs(desys,g(u)); > plot3d(subs(g='gu'(u),X),u=s,v=0..2*Pi,scaling=constrained, > style=patch,shading=zhue,orientation=[theta,phi]); > end: plotposconstcurv(1,49,78); plotposconstcurv(0.65,49,78); plotposconstcurv(1.7,49,69); plotnegconstcurv:=proc(c,d,theta,phi) > local X,desys,gu,s,h,kk,init; > if d=0 then h:=c*exp(u); > s:=-2.5..ln(1/c); > init:=-1 fi; > if c>0 and d>0 then h:=2*sqrt(c*d)*cosh(u); > s:=arcsinh(-1/(2*sqrt(c*d)))..arcsinh(1/(2*sqrt(c*d))); > init:=0 fi; > if c>=0 and d<0 then h:=2*sqrt(-c*d)*cosh(u); > kk=c*d; > if kk>-1/4 then s:=0..arccosh(1/(2*sqrt(-c*d)))fi; > init:=0 fi; > X:=[h*cos(v),h*sin(v),g]; > desys:=dsolve({diff(g(u),u)=sqrt(1-diff(h,u)^2),g(init)=0}, > g(u),type=numeric,output=listprocedure): > gu:=subs(desys,g(u)); > plot3d(subs(g='gu'(u),X),u=s,v=0..2*Pi,scaling=constrained, > style=patch,shading=zhue,grid=[15,40],orientation= > [theta,phi]); > end: plotnegconstcurv(1,0,41,64); plotnegconstcurv(0.3,1,47,64); plotnegconstcurv(0.6,0.1,49,69); with(plots):with(LinearAlgebra): h:=t->h(t);g:=t->g(t);