Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Using traces to identify surfaces

Views: 71

Using traces for a surface

In the class we studied the surface with equation x+y2z2=0x + y^2 - z^2 = 0 by finding cross-sections (traces) of the surface and putting them togehter.

Planes parallel to the xzxz-plane

This is what the first group did.

First we will plot the cross-sections of the surface by the planes of the form y=ky = k. Replacing yy by kk and solving for xx gives us x=z2k2x = z^2 - k^2. These are parabolas openning in the direction of the positive xx-axis, shifted by the amount k2k^2 in the direction of the negative xx-axis:

%var x z k = 0.5 axis_format = {'color':"gray",'width':1,'linestyle':"dashed",'arrowsize':3} implicit_plot(-x + z^2 - k^2,(x,-1,1),(z,-1,1)) + arrow((-1,0),(1,0),**axis_format) + arrow((0,-1),(0,1),**axis_format)

We will use a parametric plot to plot these in 3d. Parabolas are easy to parametrize:

%var u p1 = sum(parametric_plot3d((u^2 - k^2, k, u), (u,-1,1), thickness = 3, color = "red", plot_points = 100) for k in [-.8, -.6, -.4, -.2, 0, .2, .4, .6, .8])
axes = arrow((-1,0,0),(1,0,0),**axis_format) + arrow((0,-1,0),(0,1,0),**axis_format) + arrow((0,0,-1),(0,0,1),**axis_format) p1 + axes
3D rendering not yet implemented

Planes parallel to the xyxy-plane

(The second group did this.)

First we will plot the cross-sections of the surface by the planes of the form z=kz = k. Replacing zz by kk and solving for xx gives us x=k2y2x = k^2 - y^2. These are parabolas openning in the direction of the negative xx-axis, shifted by the amount k2k^2 in the direction of the positive xx-axis:

%var x y k = 0.5 implicit_plot(-x + k^2 - y^2,(x,-1,1),(y,-1,1)) + arrow((-1,0),(1,0),**axis_format) + arrow((0,-1),(0,1),**axis_format)

Again, we plot them using parametric plot in 3d:

%var u p2 = sum(parametric_plot3d( (k^2-u^2, u, k), (u, -1, 1), thickness=3, color='green', plot_points=100) for k in [-.8, -.6, -.4, -.2, 0, .2, .4, .6, .8])
p2 + axes
3D rendering not yet implemented

We can even plot both of the sets of traces at the same time to see how they fit together. That way we can already get pretty good idea how the surface looks like:

p1 + p2 + axes
3D rendering not yet implemented

Traces parallel to the zyzy-plane

The third group worked on this set of traces.

The most complicated are the traces parallel to the zyzy-plane. Setting x=kx=k gives us y2z2=ky^2 - z^2 = -k or y2+z2=k-y^2 + z^2 = k These are hyperbolas with orientation that depends on whether kk is positive or negative:

%var y z k1 = 0.2 k2 = -0.2 implicit_plot(y^2 - z^2 + k1, (y,-1,1),(z,-1,1),color="green") + implicit_plot(y^2 - z^2 + k2, (y,-1,1),(z,-1,1),color="red") + arrow((-1,0),(1,0),**axis_format) + arrow((0,-1),(0,1),**axis_format)

In the case k=0k=0 we just get a pair of intersecting lines:

%var y z k = 0 implicit_plot(y^2 - z^2 + k, (y,-1,1),(z,-1,1),color="blue") + arrow((-1,0),(1,0),**axis_format) + arrow((0,-1),(0,1),**axis_format)

Parametrizing hyperbolas is harder than parabolas. The easiest way is to use the hyperbolic functions, sinh\sinh and cosh\cosh, due to the property cosh2xsinh2x=1\cosh^2 x - \sinh^2 x = 1

%var u properties = {'thickness':3, 'color':"orange", 'plot_points':100} p3 = sum(parametric_plot3d( (k, sinh(u)*sqrt(k), cosh(u)*sqrt(k)), (u, -acosh(1/sqrt(k)), acosh(1/sqrt(k))), **properties) + parametric_plot3d( (k, -sinh(u)*sqrt(k), -cosh(u)*sqrt(k)), (u, -acosh(1/sqrt(k)), acosh(1/sqrt(k))), **properties) for k in [.2,.4,.6,.8]) p3 += sum(parametric_plot3d( (-k, cosh(u)*sqrt(k), sinh(u)*sqrt(k)), (u, -acosh(1/sqrt(k)), acosh(1/sqrt(k))), **properties) + parametric_plot3d( (-k, -cosh(u)*sqrt(k), -sinh(u)*sqrt(k)), (u, -acosh(1/sqrt(k)), acosh(1/sqrt(k))), **properties) for k in [.2,.4,.6,.8]) p3 += sum(parametric_plot3d((0,u,t*u),(u,-1,1), **properties) for t in [-1,1])
p3 + axes
3D rendering not yet implemented

Plotting all three sets of traces at the same time:

p1 + p2 + p3 + axes
3D rendering not yet implemented

Extra traces

We can also do other traces, for example cross-sections by the planes y=kzy = kz. This is what the fourth group was working on. Replacing yy by kzkz will give us x+(kz)2z2=0x + (kz)^2 - z^2 = 0 or, after simplifying and solving for xx, x=(1k2)z2x = (1-k^2)z^2 These will be parabolas with the same vertex (0,0)(0,0), but with different leading coefficient. Plotting several of them on the same plane will give us the following projections of the cross-sections onto the xzxz-plane:

%var z sum(plot((1-k^2)*z^2, (z,-1,1), color=col, thickness=2, legend_label="k = {:.1f}".format(float(k))) for k,col in zip([.1, .5, 1, 2, 5],["green","blue","red","orange","magenta"]))

To plot these in 3d, we will use parametric plots. To get a good evenly spaced set of curves, we use values of kk to be tan(tπ)\tan(t\pi) for tt evenly spaced in the interval (1/2,1/2)(-1/2,1/2):

%var u p4 = sum(parametric_plot3d((u^2 - (tan(pi*t)*u)^2, tan(pi*t)*u, u), (u,-min(1,1/abs(tan(pi*t))),min(1,1/abs(tan(pi*t)))), thickness = 3, color = "blue", plot_points = 100) for t in [-.4,-.3,-.2,-.1,.1,.2,.3,.4])
p4 + axes
3D rendering not yet implemented

Plotting all 4 set of traces together:

p1 + p2 + p3 + p4 + axes
3D rendering not yet implemented

Finally, we will plot all 4 sets of traces, and add the actual surface to them:

%var x,y,z implicit_plot3d(x + y^2 - z^2,(x,-1,1),(y,-1,1),(z,-1,1)) + p1 + p2 + p3 + p4 + axes
3D rendering not yet implemented