> | with(plots):surface2:=implicitplot3d(2*x+2*y-z=2,x=-3..6,y=-3..6,z=-1..5,orientation=[20,65],labels=[x,y,z]): |
> | Points:=pointplot3d({[1,1,2],[5,5,0]},symbol=cross,symbolsize=50,color=green): |
> | line1:=spacecurve([1+2*t,1+2*t,2-t,t=0..2],thickness=2,color=blue,axes=normal,orientation=[20,65]): |
> | surface1:=plot3d(x^2+y^2,x=-3..6,y=-3..6,view=-1..5,axes=BOXED,orientation=[20,65],labels=[x,y,z]): |
> | vector1:=arrow(<1,1,2>,<1,1,-0.5>,width=[0.06,relative],color=red,thickness=3): |
> | display(Points,surface1,line1); |
> | display(vector1,Points,surface1,surface2,line1); |
Change the View
> | display(vector1,Points,surface1,surface2,line1); |
Graph of the distance function
> | plot3d(sqrt((x-5)^2+(y-5)^2+(x^2+y^2)^2),x=-1..3,y=-1..3,view=5..9,axes=BOXED,orientation=[20,65],labels=[x,y,z]); |
Setting the partial derivatives equal to zero, solving the system, finding the minimum distance (This was in fact done prior to the work shown above.)
> | f:=sqrt((x-5)^2+(y-5)^2+(x^2+y^2)^2); |
> | fx:=diff(f,x); |
> | fy:=diff(f,y); |
> | solve({fx=0,fy=0}); |
> | eval(f,{x=1,y=1}); |
OR
> | ff:=(x-5)^2+(y-5)^2+(x^2+y^2)^2; |
> | ffx:=diff(ff,x); |
> | ffy:=diff(ff,y); |
> | solve({ffx=0,ffy=0}); |
> | eval(f,{x=1,y=1}); |
> |