Re: a newbie problem with 3d graphing

• To: mathgroup at smc.vnet.net
• Subject: [mg25824] Re: [mg25797] a newbie problem with 3d graphing
• From: Tomas Garza <tgarza01 at prodigy.net.mx>
• Date: Sat, 28 Oct 2000 01:41:16 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```I guess you mean how to obtain the surface of revolution and then how to
plot it (correct me if I'm wrong). The first part is an elementary
exercise in analytic geometry. If the equation g[x,y] = y - (1 -
x^2)^0.5 == 0 is your two-dimensional curve, then f[x, y, z] =
g[Sqrt[x^2 + z^2], y] == 0 is the equation of the surface of
revolution obtained by revolving your plane curve about (*not* "along")
the x-axis. Then you have

In[1]:=
h[x_, y_] = y - (1 - x^2)^0.5
Out[1]=
-(1 - x^2)^0.5 + y
In[2]:=
g[x_] := Solve[h[x, y] == 0, y][[1, 1, 2]]
In[3]:=
g[x]
Out[3]=
1.(1. - 1. x^2)^0.5
You may plot your curve this way:

In[4]:=
Plot[g[x], {x, -1, 1}, PlotRange -> {{-0.5, 0.5}, {0, 1}}];

Now you define f:

In[5]:=
f[x_, y_, z_] := h[Sqrt[x^2 + z^2], y]

and, in the same way as above,

In[8]:=
r[x_, y_] := Solve[f[x, y, z] == 0, z][[2, 1, 2]],

and now you may plot (part of) the surface of revolution:

In[10]:=
Plot3D[r[x, y], {x, -0.5, 0.5}, {y, 0, 0.85}]

This will yield one part of the surface above the x-axis, since you must
be careful with the limits in the iterators so as to avoid invalid
values, and so on.

Tomas Garza
Mexico City

"tom" <tgarshol at stud.hia.no wrote:

```

• Prev by Date: Re: Vertical Tangents
• Next by Date: Re: better copied graphics
• Previous by thread: RE: a newbie problem with 3d graphing
• Next by thread: EnhancedRationalPlot