| > | restart:with(plots):with(plottools): |
Warning, the name changecoords has been redefined
Warning, the name arrow has been redefined
| > | A:=[[0,2,2]]:C:=plot3d(A,x=-3..3,y=-3..5,view=-3..5,style=point,symbol=circle,symbolsize=20,color=red,axes=normal):l:=spacecurve([5+t,9+2*t,6+2*t],t=-6..5,color=blue,thickness=2,axes=normal,scaling=unconstrained,orientation=[55,70]):pointlabel:=textplot3d([0,4,2,`'A'`],align=RIGHT,color=black,font=[TIMES,BOLD,20]):linelabel:=textplot3d([3,0,4,`line l`],align=LEFT,color=black,font=[TIMES,BOLD,14]):display(l,C,pointlabel,linelabel); |
| > |
| > |
![[Plot]](images/3dapps_1.gif)
| > | A:=[[0,2,2]]:C:=plot3d(A,x=-3..3,y=-3..5,view=-3..5,style=point,symbol=circle,symbolsize=20,color=red,axes=normal):l:=spacecurve([5+t,9+2*t,6+2*t],t=-6..5,color=blue,thickness=2,axes=normal,scaling=unconstrained,orientation=[120,70]):m:=spacecurve([2*t,2+t,2-2*t],t=0..1,color=green,thickness=2,axes=normal,scaling=unconstrained,orientation=[120,70]):pointlabel:=textplot3d([0,4,3,`'A'`],align=RIGHT,color=black,font=[TIMES,BOLD,20]):pointlabel2:=textplot3d([1,8,.4,`'B'`],align=LEFT,color=black,font=[TIMES,BOLD,20]):linelabel:=textplot3d([3,0,4,`line l`],align=LEFT,color=black,font=[TIMES,BOLD,14]):display(l,C,m,pointlabel,pointlabel2,linelabel); |
![[Plot]](images/3dapps_2.gif)
| > | with(linalg): |
Warning, the protected names norm and trace have been redefined and unprotected
| > | v:=vector([1,2,2]);a:=vector([0,2,2]);b:=vector([5+t,9+2*t,6+2*t]);f:=(5+t,7+2*t,4+2*t); |
| > | d:=dotprod(v,evalm(b-a)); |
| > | fsolve(d=0); |
| > | m:=subs(t=%,[f]); |
| > | norm(m,2); |
| > | A:=[[1,1,5]]:C:=plot3d(A,x=0..3,y=0..3,view=0..8,style=point,symbol=circle,symbolsize=10,color=black,axes=normal):B:=plot3d(x^2+y^2+3,x=0..3,y=0..3,view=0..8,style=patchnogrid,axes=normal,orientation=[20,75]):pointlabel:=textplot3d([1,1,5,`'A'`],align=RIGHT,color=black,font=[TIMES,BOLD,20]):display(B,C,pointlabel); |
| > | A:=[[1,1,5]]:C:=plot3d(A,x=0..3,y=0..3,view=0..8,style=point,symbol=circle,symbolsize=10,color=black,axes=normal):B:=plot3d(x^2+y^2+3,x=0..3,y=0..3,view=0..8,style=patchnogrid,axes=normal,orientation=[20,75]):pointlabel:=textplot3d([1,1,5,`'A'`],align=RIGHT,color=black,font=[TIMES,BOLD,20]):parvects1:=arrow(<1,1,5>,<1,0,2>,shape=arrow,length=3,color=red,axes=normal,orientation=[20,75]):parvects2:=arrow(<1,1,5>,<0,1,2>,shape=arrow,length=3,color=red,axes=normal,orientation=[20,75]):difflabel1:=textplot3d([2,1.2,6,`dz/dx`],align=LEFT,color=black,font=[TIMES,BOLD,12]):difflabel2:=textplot3d([1,1.7,6,`dz/dy`],align=RIGHT,color=black,font=[TIMES,BOLD,12]):display(B,C,pointlabel,parvects1,parvects2,difflabel1,difflabel2); |
![[Plot]](images/3dapps_11.gif)
![[Plot]](images/3dapps_12.gif)
| > | z:=(x,y)->(x^2+y^2+3); |
| > | dx:=diff(z(x,y),x);dy:=diff(z(x,y),y);p:=subs(x=1,dx);q:=subs(y=1,dy); |
| > | with(linalg):xvector:=vector([1,0,p]);yvector:=vector([0,1,q]);normalvect:=crossprod(yvector,xvector); |
| > | A:=[[1,1,5]]:C:=plot3d(A,x=0..3,y=0..3,view=0..8,style=point,symbol=circle,symbolsize=10,color=black,axes=normal):B:=plot3d(x^2+y^2+3,x=0..3,y=0..3,view=0..8,style=patchnogrid,axes=normal,orientation=[20,75]):pointlabel:=textplot3d([1,1.1,5,`'A'`],align=RIGHT,color=black,font=[TIMES,BOLD,20]):parvects1:=arrow(<1,1,5>,<1,0,2>,shape=arrow,length=3,color=red,axes=normal,orientation=[20,75]):parvects2:=arrow(<1,1,5>,<0,1,2>,shape=arrow,length=3,color=red,axes=normal,orientation=[20,75]):normvect1:=arrow(<1,1,5>,<2,2,-1>,shape=arrow,length=4,thickness=4,color=blue,axes=normal,orientation=[20,75]):difflabel1:=textplot3d([2,1.2,6,`dz/dx`],align=LEFT,color=black,font=[TIMES,BOLD,12]):difflabel2:=textplot3d([1,1.7,6,`dz/dy`],align=RIGHT,color=black,font=[TIMES,BOLD,12]):display(B,C,pointlabel,parvects1,parvects2,difflabel1,difflabel2,normvect1); |
![[Plot]](images/3dapps_21.gif)
| > | A:=[[1,1,5]]:C:=plot3d(A,x=-3..3,y=-3..3,view=0..8,style=point,symbol=circle,symbolsize=10,color=black,axes=normal):B:=plot3d(x^2+y^2+3,x=-3..3,y=-3..3,view=0..8,axes=normal,orientation=[20,75]):pointlabel:=textplot3d([1,1.1,5,`'A'`],align=RIGHT,color=black,font=[TIMES,BOLD,20]):parvects1:=arrow(<1,1,5>,<1,0,2>,shape=arrow,length=3,color=red,axes=normal,orientation=[20,75]):parvects2:=arrow(<1,1,5>,<0,1,2>,shape=arrow,length=3,color=red,axes=normal,orientation=[20,75]):normvect1:=arrow(<1,1,5>,<2,2,-1>,shape=arrow,length=4,thickness=4,color=blue,axes=normal,orientation=[20,75]):difflabel1:=textplot3d([2,1.2,6,`dz/dx`],align=LEFT,color=black,font=[TIMES,BOLD,12]):difflabel2:=textplot3d([1,1.7,6,`dz/dy`],align=RIGHT,color=black,font=[TIMES,BOLD,12]):plane1:=plot3d(2*x+2*y+1,x=0..2,y=0..2,view=2..6,axes=normal,orientation=[20,75],color=gray,style=patchnogrid):display(B,C,pointlabel,parvects1,parvects2,difflabel1,difflabel2,normvect1,plane1); |
![[Plot]](images/3dapps_22.gif)
| > | with(VectorCalculus):SetCoordinates('cartesian'[x,y,z]): |
| > | xval:=1;yval:=1;zval:=xval^2+yval^2+3;tan1:=TangentPlane((x,y)->x^2+y^2+3, xval,yval);pt1:=subs(x=0,y=0,tan1(x,y)):pt2:=subs(x=1,y=0,tan1(x,y)):pt3:=subs(x=0,y=1,tan1(x,y)): |
| > | v1:=convert(pt1,vector);v2:=convert(pt2,vector);v3:=convert(pt3,vector); |
| > | c1:=crossprod(evalm(v3-v1),evalm(v2-v1));B:=plot3d(x^2+y^2+3,x=-3..3,y=-3..3,view=0..8,style=patchnogrid,axes=normal,orientation=[20,75]):C:=plot3d(c1[1]*x+c1[2]*y-(c1[1]*xval+c1[2]*yval+c1[3]*zval),x=0..2,y=0..2,view=4..6,axes=normal,orientation=[20,75]):display(B,C); |
![[Plot]](images/3dapps_31.gif)
| > |