On Qui, 2009-10-22 at 15:06 -0700, John Ogilvie wrote:
> 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.
plot2d can plot several functions simultaneously, but plot3d cannot.
You'd have to plot either the upper hemisphere or the lower one but not
the two at the same time.
Two possible solutions: either use draw3d instead of plot2d, or use a
parametric representation of the sphere:
plot3d([sin(u)*cos(v),sin(u)*sin(v),cos(u)],[u,0,%pi],[v,0,2*%
pi],[plot_format,openmath]);
Notice that with x=sin(u)*cos(v), y=in(u)*sin(v) and z=cos(u)
you get x^2+y^2+z^2=1. u is the angle that the "position" vector makes
with the positive z semi-axis and v is the angle that the projection of
that vector on the plane xy makes with the x semi-axis.
Cheers,
Jaime
P.S. Do you speak Spanish? that's my native language.