Lab 03 - Surfaces

[Your name(s) here!]

The goal of this lab is to produce graphs that help us visualize mathematical concept (... or are simply beautiful).

Useful Mathematica Commands / Examples

Here are the functions that can create axes and points with locator dashed line segments. (Execute the cell below...)

myAxis[label_,color_,component_,lo_,hi_]:=Module[{e,g,o},
o={0,0,0};e=o;e[[component]]=1;
g={color,Text[label,1.05 hi e],Arrowheads[0.02],Arrow[{o,hi e}]};
If[lo<0,g=Join[g,{Dashed,Line[{lo e,o}],Dashing[{}]}]];
g];
myPoint[p_,color_,label_]:={color,Dashed,Line[{{p[[1]],0,0},{p[[1]],p[[2]],0},p}],PointSize[Medium],Point[p],Dashing[{}],Text[label,1.1p]};

Using these, we can graph all of this at one shot:
(1) an orange x-axis from -5 to 5, (2) a dark yellow y-axis from -5 to 5, (3) a green z-axis from -5 to 5, 
(4) a black point with locator dashed line segments, 
(5) a blue arrow, 
(6) a thick magenta line segment, 
(7) a brown polygon with 60% opacity, and 
(8) a brown large point with 60% opacity. 
Include axes scale labels on the edges of the bounding box and place the view point at a point corresponding to what we have done by hand.

p1=Graphics3D[Join[myAxis["x",Orange,1,-5,5],myAxis["y",Darker[Yellow],2,-5,5],myAxis["z",Green,3,-5,5],myPoint[{1,2,3},Black,"a"],{Blue,Arrow[{{1,-5,-2},{1,-1,-2}}],Thick,Magenta,Line[{{-5,5,5},{5,-5,4}}],Opacity[.6,Brown],Polygon[{{0,0,0},{0,0,4},{0,5,4},{0,5,0}}],PointSize[Large],Point[{4,0,0}]}],Axes->True,ViewPoint->{200,100,100}]

Graph the function f(x,y)=x-y-4 on the domain {(x,y):-5≤x≤5,0≤y≤5}.

p2=Plot3D[x-y-4,{x,-5,5},{y,0,5}]

Graph x-y-z=4 inside the bounding box {(x,y,z):-5≤x≤5,0≤y≤5,-14≤z≤1}.  This is the same set of points as in the previous command although the rendering is somewhat different.

p3=ContourPlot3D[x-y-z==4,{x,-5,5},{y,0,5},{z,-14,1}]

Graph the parametric equation r(s,t)=⟨x(s,t),y(s,t),z(s,t)⟩=⟨s,t,s-t-4⟩ for -5≤s≤5 and 0≤t≤5.  This is the same set of points as in the previous two commands although the rendering is somewhat different.

p4=ParametricPlot3D[{s,t,s-t-4},{s,-5,5},{t,0,5}]

Graph the parametric equation r(t)=⟨5-t,5-t,-5+2t⟩ for 0≤t≤5 using a thick, dashed, and purple line.

p5=ParametricPlot3D[{5-t,5-t,-5+2t},{t,0,5},PlotStyle->{Dashed,Purple,Thick}]

Graph the previous graphs all together now... (might have to rotate to see P2)

Show[p1,p2,p5]

Exercise 1

[2 points] Using algebra, find the intersection of the planes x+2y+z=4 and 4x+2y+3z=12 in parametric form: For example, you could...

1.) solve the first equation for z (which depends on x and y), 
2.) substitute z into the second equation and solve it for y in terms of x,
3.) go back to your equation for z(x,y(x)) and find z(x).  

Now, you have two equations for y and z (in terms of x). You can making your parameter t=x,  and then write the parametric form of the intersection of the two plane in the form ⟨t,y(t),z(t)⟩ . (The intersection of two planes should be a line.  You’ll check this in Exercise 2).

Exercise 2

[6 points] Graph the planes x+2y+z=4 and 4x+2y+3z=12 in the nonnegative orthant. Also graph the line you came up with above in a distinctive style.  (It should hopefully coincide with the intersection of the planes).  Also show normal vectors for each plane that share the same base point.

Exercise 3

[4 points] Let (Subscript[l, 1]) be the line passing through the points ⟨1,2,3⟩ and ⟨3,-2,1⟩.  Let (Subscript[l, 2]) be the line passing through the point ⟨11,2,-7⟩ in the direction ⟨1,3,-1⟩.  Graph these two lines in a manner that shows where they intersect (place a big point at the location of their intersection) or in a manner that shows that they do not intersect.

Goblet Equation

Here is a way to graph the “Goblet” (Well, I’ll just show you a base and a stem...) by pasting several functions together using Piecewise[ ].  Also two different ways of graphing the same goblet surface.

In both examples, a function for the distance away from the z-axis is defined, which depends on z but *not* on θ.

myr[z_]:=Piecewise[{
{3 Cos[2 π z]+3.5,0<z≤0.5},
{0.5, 0.5<z≤7.5}
}]
Plot[myr[x],{x,0,10}, PlotRange->{0,10}]

RevolutionPlot3D[{myr[t],t},{t,0,10},PlotRange->All]

ContourPlot3D[(x^2)+(y^2)==((myr[z])^2),{x,-10,10},{y,-10,10},{z,0,10}]

Exercise 4

[3 points] Graph a full “Goblet” surface.  You can use the one you came up with when we did that exercise in class, or come up with a new function.

Quadric surfaces

Here are graphs of some of the quadric surfaces.

{ContourPlot3D[(x^2)+(y^2)+(z^2)==1,{x,-2,2},{y,-2,2},{z,-2,2}],ContourPlot3D[(x^2)+(y^2)-(z^2)==1,{x,-2,2},{y,-2,2},{z,-2,2}],ContourPlot3D[(x^2)+(y^2)-(z^2)==-1,{x,-2,2},{y,-2,2},{z,-2,2}]}

Paraboloid (elliptic), Paraboloid (hyperbolic), Cone (elliptic)

{ContourPlot3D[z==(x^2)+(y^2),{x,-2,2},{y,-2,2},{z,-2,2}],ContourPlot3D[z==(x^2)-(y^2),{x,-2,2},{y,-2,2},{z,-2,2}],ContourPlot3D[(x^2)+(y^2)-(z^2)==0,{x,-2,2},{y,-2,2},{z,-2,2}]}

Elliptic cylinder, Hyperbolic cylinder, Parabolic cylinder

{ContourPlot3D[(x^2)+(y^2)==1,{x,-2,2},{y,-2,2},{z,-2,2}],ContourPlot3D[
(x^2)-(y^2)==1,{x,-2,2},{y,-2,2},{z,-2,2},
ColorFunction->Function[{x,y,z},Opacity[.6,Red]]
],
ContourPlot3D[y==(x^2),{x,-2,2},{y,-2,2},{z,-2,2}]
}

Exercise 5

[6 points] Choose one of the quadric surfaces.  Graph it together with two parallel. vertical planes of your choosing. The intersections of the vertical planes with your chosen surface are two different vertical traces of the quadric surface. All of the surfaces should be semi-opaque, such that you can see the traces (intersections) easily.