Laboratory Session 2 command lines. 1. restart:with(plots):with(linalg): a:=[-1,1,1];b:=[-7/13,21/13,37/13]; p:=[12,-3,-2];q:=[4,-12,3]; r1:=t->evalm(a+t*p):r1(t); r2:=s->evalm(b+s*q):r2(s); solution:=solve({r1(t)[1]=r2(s)[1],r1(t)[2]=r2(s)[2]},{t,s}); assign(solution); t, s; r1(t);r2(s); t:='t';s:='s'; l1:=spacecurve(r1(t),t=-1..1,color=red,axes=frame,thickness=3): l2:=spacecurve(r2(s),s=-1..1,color=blue,thickness=3): display(l1,l2); uu:=evalm(crossprod(p,q)); u:=evalm(uu/norm(uu,2)); ------------------------------------------------------------------------- plane1:=implicitplot3d(dotprod([x,y,z]-r1(0),u)=0,x=-10..10,y=-10..10, z=-10..10,style=patchnogrid): plane2:=implicitplot3d(dotprod([x,y,z]-r2(0),u)=0,x=-10..10,y=-10..10, z=-10..10,style=patchnogrid): display(l1,l2,plane1,plane2); v:=r1(0)-r2(0); distance:=abs(dotprod(v,u)); l3:=spacecurve(evalm(r2(0)+w*u),w=0..distance,thickness=3,color=green): display(l1,l2,plane1,plane2,l3); 2. restart:with(plots):with(linalg): r1:=t->cos(t):r2:=t->sin(t):r3:=t->t: r:=t->[r1(t),r2(t),r3(t)]; dr:=[D(r1),D(r2),D(r3)]; tangent:=s->evalm(r(a)-s*dr(a)):tangent(s); a:=1; tangent(s); c1:=spacecurve(r(t),t=0..10,color=black,thickness=3): c2:=spacecurve(tangent(s),s=-1..1,color=blue,thickness=3): display(c1,c2,orientation=[0,20]); c3:=plot3d(1,theta=0..2*Pi,z=-1..10,coords=cylindrical,style=patchnogrid): display(c1,c2,c3); 3. restart:with(plots): cone:=plot3d(z,theta=0..2*Pi,z=-3..3,coords=cylindrical,orientation = [140,70], style=patchnogrid): p1:=plot3d(2,x=-3..3,y=-3..3): p2:=plot3d(.6*x+1,x=-3..3,y=-3..3): p3:=plot3d(x+1,x=-3..3,y=-3..3): p4:=implicitplot3d(x=1,x=-3..3,y=-3..3,z=-3..3): p5:=implicitplot3d(x=0,x=-3..3,y=-3..3,z=-3..3): display(cone,p1,scaling=constrained); display(cone,p2,scaling=constrained); display(cone,p3,scaling=constrained); display(cone,p4,scaling=constrained); display(cone,p5,scaling=constrained);