John Ogilvie wrote:
> A further query arises in connexion with some material that I am preparing
> for demonstration to school teachers for their use of Maxima for teaching
> mathematics (in Spanish).
> When I input into wxMaxima 0.8.3 (or xMaxima 5.19.2) this command,
> plot2d([(1-x^2)^(1/2),-(1-x^2)^(1/2)],[x,-1.9,1.9],[y,-1.1,1.1])
> the expected plot appears, and with the indicated domain of x the circle
> even resembles a circle. However, when I input the analogous command for
> plot3d, extending (1-x^2)^(1/2) to (1-x^2-y^2)^(1/2) in both positive and
> negative parts (to obtain the two hemispheres), an error message
> List [sqrt(-y^2-x^2+1),-sqrt(-y^2-x^2+1)] is not of length 3
> appears, which is incomprehensible.
> Yes, I am aware that for the case of a circle, in just two
> dimensions, I can instead use implicit_plot, but there seems to be
> available no equivalent in Maxima for three dimensions.
> Does that error message arise from my error or Maxima's?
> J. F. Ogilvie
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
FWIW, since the appearance of the 'draw' package, the constraints of
'plot2d' and 'plot3d' have always been too painful for me to use for
anything except very simple plots. I prefer 'draw2d' and 'draw3d'
Try the commands
load(draw);
draw3d(
enhanced3d = true,
color = green,
explicit((1-x^2-y^2)^(1/2),x,-1,1,y,-1,1),
color = red,
explicit(-(1-x^2-y^2)^(1/2),x,-1,1,y,-1,1)) $
or simply
draw3d(color=blue,explicit((1-x^2-y^2)^(1/2),x,-1,1,y,-1,1),
color=red,explicit(-(1-x^2-y^2)^(1/2),x,-1,1,y,-1,1));
You can rotate the picture (and even resize it with the middle mouse
button of a 3 button mouse).
Except for the aspect ratios, you will get the two hemispheres. You
can change the aspect ratios with a 3 button mouse by playing with the
left and middle mouse buttons.
There is one exception to the above preference for draw3d.
A plot like
plot3d(x62+y^2, [x,-2,2], [y,-2,2], [plot_format, openmath]);
produces a pretty picture with colors that can be rotated, zoomed, etc.
(mathematica-like)
It can be saved, printed, easily without the terminal options usually
needed for gnuplot.
But if you zoom and try to rotate, replot, etc. you will have to do the
whole plot over again because of issues with redrawing in the openmath
option.
-sen