Re: Plotting a hyperbolic paraboloid (saddle)
- To: mathgroup at smc.vnet.net
- Subject: [mg121404] Re: Plotting a hyperbolic paraboloid (saddle)
- From: "Christopher O. Young" <cy56 at comcast.net>
- Date: Wed, 14 Sep 2011 05:13:13 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <f74tck$95v$1@smc.vnet.net>
On 7/12/07 5:48 AM, in article f74tck$95v$1 at smc.vnet.net, "William S." <wschacht47 at att.net> wrote: > Does anyone know how to plot a hyperbolic paraboloid? I thought it was time to get to understand 3D plotting basics in Mathematica, so I tried three different ways of looking at the hyperbolic paraboloid. There's a picture at http://home.comcast.net/~cy56/SaddlePlots.png and a Mathematica notebook at http://home.comcast.net/~cy56/SaddlePlots.nb I think it's way too much of a struggle to get the axes to come out with the same scales. I think this is something most students (and the rest of us) would want to do most often. Couldn't there be a single option (maybe "SameScaleAxes" or something similar?) to do this? The contour plot version seems to be a little "wild" as I try to rotate it. The size jumps around a lot. I used "ColorFunctionScaling -> False" because I wanted to have custom coloring running from red for negative values to green for positive values. saddleContourPlot = ContourPlot3D[ x * y == z, {x, -2.5, 2.5}, {y, -2.5, 2.5}, {z, -4, 4}, PlotRange -> {{-2.5, 2.5}, {-2.5, 2.5}, {-4, 4}}, AspectRatio -> 8/5, PlotPoints -> 50, Mesh -> 7, MeshFunctions -> {#3 &}, ContourStyle -> Opacity[0.5], ColorFunctionScaling -> False, ColorFunction -> (Hue[0.35 (#3 + 4)/8 ] &) ] /. Line[pts_, opts___] :> {Gray, Tube[pts, 0.02, opts]} The last line above just makes the contour lines into tubes. I got it from the Help for Tubes. I wish there were a simple way to just have the contour lines show up as tubes, maybe by having a "TubeRadius" option. The plot below shows how the saddle surface in the form z = x * y gives us a diagram of a multiplication table, with columns above each x * y point to show us the value of the product. saddleStepPlot = DiscretePlot3D[ x * y, {x, -2, 2}, {y, -2, 2}, PlotRange -> {{-2.5, 2.5}, {-2.5, 2.5}, {-4, 4}}, AspectRatio -> 2, (* SphericalRegion->True, *) ExtentSize -> Full, AxesLabel -> {"x", "y", "z"}, PlotStyle -> Opacity[0.5], ColorFunctionScaling -> False, ColorFunction -> (Hue[0.35 (#3 + 4)/8 ] &) ]; This plot looks the same as the contour plot version. It sames to be more stable when I try to rotate it. saddleParamPlot = ParametricPlot3D[ {u, v, u*v}, {u, -2.5, 2.5}, {v, -2.5, 2.5}, RegionFunction -> Function[{x, y, z}, -2.5 <= x < 2.5 \[And] -2.5 <= y < 2.5 \[And] -4 <= z < 4], MeshFunctions -> {#3 &}, Mesh -> 7, AxesLabel -> {"x", "y", "z"}, PlotStyle -> Opacity[0.5], ColorFunctionScaling -> False, ColorFunction -> (Hue[0.35 (#3 + 4)/8 ] &), SphericalRegion -> True ] /. Line[pts_, opts___] :> {Gray, Tube[pts, 0.03, opts]} Showing all the plots side by side: GraphicsGrid[ { { saddleContourPlot, saddleStepPlot, saddleParamPlot } } ] -- Chris Young cy56 at comcast.net IntuMath.org