# Re: Plota a sphere in maxima using plot3d

On Mon, 01 Mar 2010 13:01:14 -0600, geep wrote:

On Sun, 28 Feb 2010 11:46:42 +0100, Nanotech wrote:

Hi,
i would like plot a sphere in maxima using gnuplot plot3d function in
cartesian coordinate system.
The function that i use is: x^2+y^2+z^2-10=0 I set the grid with this
command: [x,-5,5] [y,-5,5] [z,-5,5]

Gnuplot return a blank window. Why ?
What i mistake ?

Hi,
Maybe we are slightly offtopic asking about maxima.... Anyway - on my
maxima or wxmaxima I give these commands and maxima sends commands to
gnuplot to draw a nice sphere:

draw3d(enhanced3d = true,
terminal=png,
implicit(0=(x^2+y^2+z^2-10),
x,-5,5,y,-5,5,z,-5,5),
palette = gray,
surface_hide = true);

maxima produces 2 files which gnuplot uses: data.gnuplot
maxout.gnuplot

and then gnuplot produces:
maxima_out.png

I attach the 2 gnuplot files below. Some lines might be wrapped as they
are very long. I'm running on linux.

Hope yours works similarly.
Cheers,
Peter
maxima will give a hemisphere from this:
plot3d(( 10 - x^2 - y^2) ^ 0.5, [x,-50,50], [y,-50,50]);

and a complete sphere:
plot3d( [sin(a) * cos(b), sin(a) * sin(b), cos(a)], [a, 0, 2 * %pi], [b,
0, %pi] );

Haven't bothered with the gnuplot output. If you get the earlier example
to work, these should too.

Cheers,
Peter

.