
Re: [mg4908] help!! Plot3D of ellipsoid
Posted:
Oct 9, 1996 2:07 PM


On Fri, 4 Oct 1996, Seth wrote:
> I am trying to get a 3d plot of an ellipsiod, of the equation > > (x^2/a^2) + (y^2/b^2) + (z^2/c^2) = 1 > > manipulating the equation I can get > > z = (c^2 (1 (x^2/a^2)  (y^2/b^2)))^1/2 > > then, with the constants defined, I write > > Plot3D[z,{x,0,a},{y,0,b}] > > Mathematica then spits out a bunch of errors > > > Seth,
The reason you're getting error messages is because your function z does not have real values for the square {0,a}X{0,b}. It is only defined on an elliptical region in that area. The syntax of Plot3D, however, designates that it must be defined on a rectangular region. To get around this, you can use modified spherical coordinates. {xr_,[s_,t_],y[r_,s_,t_],z[r_,s_,t_]}={a r Sin[s] Cos[t], b r Sin[s] Sin[t], c r Cos[s]}. Setting r equal to 1, you can verify that x^2/a^2 + y^2/b^2 + z^2/c^2 = 1. Then you can use ParametricPlot3D[{x[1,s,t],y[1,s,t],z[1,s,t]},{s,0,Pi},{t,0,2 Pi}]
to plot the ellipsoid.
====================================================== Keith S. Mersman Mathematica Consultant, University of MissouriColumbia
Mailbox: 220 Math Science Building Office: GCB 124A Office Phone: (573) 8846771 Office Hours: Sunday6:0010:00 p.m. Monday7:0011:00 p.m. Tuesday6:006:30 p.m. and 8:30 to 10:00 p.m. Wednesday6:0010:00 p.m. Thursday6:006:30 p.m. and 8:30 to 10:00 p.m.
email address:
mersman@everest.cclabs.missouri.edu c621746@showme.missouri.edu
www address:
http://www.phlab.missouri.edu/~mersman and http://www.missouri.edu/~c621746 ======================================================

