Three problems from Section 11.1
> with(plots):
#49. Find a parametric equation for the curve formed by the intersection of the surfaces given by z=x^2+y^2 and x+y=0.
The first command graphs the function z=x^2+y^2, which is a paraboloid, and saves the plot in the variable pa.
> pa:=plot3d(x^2+y^2,x=-3..3,y=-3..3,color=blue):
Next we need to plot the plane x+y=0. (It is a plane since z can take any value.) The problem is we do not have z as a function of x & y. So, I used a plottting feature (press the HELP button for details) that does parametric plotting.
The idea is that for asurface we need two parameters s & t, instead of one. I use x(s,t) = s, y(s,t) =-s, & z(s,t)=t.
Thus x+y=0 and zcan be anything.
> pl:=plot3d([s,-s,t], s=-3..3, t=0..18,color=yellow):
Finally, I plot the spacecurve given by the intersection of the surfaces. Letting x=t, then y=-t, and so z = x^2 + y^2 = t^2 + (-t)^2 = 2t^2.
> cu:=spacecurve([t,-t,2*t^2],t=-3..3,color=red,thickness=3):
Last we display the three plots. However, you should know that it took me 30 minutes of trying different ranges and colors and viewing angles to get this.
> display(pl,pa,cu);
11.1: 52 (This is #32 in 10.7 of your textbook.)
We need to plot an ellipsiod. When I solve for z I get z = +/- sqrt(-x^2-(y^2)/4+4). So, I plot the = and - parts separately. When these are displayed there is a lot of round off error near the xy-plane. This is why the plot looks so strange near the xy-plane. I am working on this. I did reduce the problem by changing the default grid size.
> pel:=plot3d(sqrt(-x^2-(y^2)/4+4),x=-2..2,y=-4..4,grid=[100,100]):
> nel:=plot3d(-sqrt(-x^2-(y^2)/4+4),x=-2..2,y=-4..4,grid=[100,100]):
Next we plot the parabolic cylinder. As before z is free and cannot be expressed as a function of x & y.
So, I used x(s,t)=s^2, y(s,t)=s, & z(s,t)=t.
> pa:=plot3d([s^2,s,t], s=-1.5..1.5, t=-3..3,color=yellow):
The spacecurve also must be done in two parts.
> pcu:=spacecurve([t^2,t,sqrt(-t^4-(t^2)/4+4)],t=-3..3,color=red,thickness=3,numpoints=100):
> ncu:=spacecurve([t^2,t,-sqrt(-t^4-(t^2)/4+4)],t=-3..3,color=red,thickness=3,numpoints=100):
Finally we display the plots.
> display(pel,nel,pa,pcu,ncu);
11.1: 29 Plot the curve r(t) = <2 sin(t), 2 cos(t), e^(-t)>.
Here we are to plot a spacecurve, but I overlayed it on a circular cylinder for effect.
> cu:=spacecurve([2*sin(t),2*cos(t),exp(-t)],t=-ln(100)..4*Pi,color=green,thickness=3):
> cy:=plot3d([2*sin(s),2*cos(s),t],s=0..2*Pi,t=0..100,color=yellow):
> display(cy,cu);
>