Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ParametricPlot3D

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32659] Re: [mg32638] ParametricPlot3D
  • From: BobHanlon at aol.com
  • Date: Sat, 2 Feb 2002 01:19:35 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 2/1/02 4:21:58 AM, paolo at mle.media.mit.edu writes:

>My question concerns plotting a parametric surface with ParametricPlot3D
>together with a parametric curve lying on the same surface.  I believe
>it should be possible to plot these two objects with the same
>ParametricPlot3D command, but I can't get them to display together.
>
>
>g [x_,y_] := Exp[-((x-1)^2+(y-1)^2)];
>h[x_] :=  Sqrt[x];
>ParametricPlot3D[  {  {x,y,g[x,y]},{x,h[x],g[x,h[x]],  Thickness[0.15]}
>},
>                   {x,0,3},{y,0,3}  , Shading * False];
>
>The above command displays only the surface.  Inverting the order in
>which the two objects are listed does not change anything.  In both
>cases only the surface is visible:
>
>ParametricPlot3D[  {  {x,h[x],g[x,h[x]],  Thickness[0.01]},
>                     {x,y,g[x,y]}  },
>                   {x,0,3}, {y,0,3}  ];
>
>The following command plots the curve alone:
>
>ParametricPlot3D[  {  {x,h[x],g[x,h[x]],  Thickness[0.01]}  },
>                      {x,0,3} ];
>
>
>Is there any way to display both so the curve is cleary visible on top
>of the surface?
>

Needs["Graphics`Graphics`"];
Needs["Graphics`Colors`"];

g[x_,y_]:=Exp[-((x-1)^2+(y-1)^2)];
h[x_]:=Sqrt[x];

A slight offset is used to keep portions of the curve from being 
hidden by the surface

DisplayTogether[
      ParametricPlot3D[{x,y,g[x,y]},{x,0,3},{y,0,3},
        Shading->False],
 
      ParametricPlot3D[{x,h[x],g[x,h[x]]+0.004,
          {Red,AbsoluteThickness[2]}},{x,0,3}],ImageSize->400];

or

DisplayTogether[
      Plot3D[g[x,y],{x,0,3},{y,0,3},Shading->False,
 
        PlotPoints->20],
 
      ParametricPlot3D[{x,h[x],g[x,h[x]]+0.004,
          {Red,AbsoluteThickness[2]}},{x,0,3}],ImageSize->400];


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: Simplify
  • Next by Date: screen savers
  • Previous by thread: Re: About programming Mathematica [Newbie question]
  • Next by thread: screen savers