restricting Plot3D to defined domain



Richard Fateman's suggestion doesn't work for me and when I try Ray Toy's suggestion, I can't get it to work. I'm running Maxima 5.5 under Windows. Perhaps I'm entering the wrong thing for the response to the sign prompt Ray mentioned. Here's what I'm trying and Maxima's response:

(C1) plot3d(realpart(sqrt(25-x^2-y^2)),[x,-5,5],[y,-5,5],[grid,50,50]);
     2	  2
Is  y  + x  - 25  positive, negative, or zero?

NEG;
Correctable error: Expected a LONG-FLOAT 
Signalled by APPLY.
If continued: Supply right type
Broken at $PLOT3D.  Type :H for Help.
MAXIMA>>


I know that this can be recast into parametric form but that's not really what I'm after here. I've tried this on Mathematica and Scientific Notebook without the realpart operator - Mathematica throws up some error messages for points outside the valid domain but goes ahead and plots the surface for valid x, y domain points whereas Scientific Notebook happily plots the hemispherical surface ignoring invalid domain points. I had hoped Maxima might just behave similarly to one of these but it seems it's not as forgiving.

Ray, can you please tell me what you did to get it to work,
thanks,
Gary

----- Original Message -----
From: Raymond Toy <toy at rtp>
Date: 02 Aug 2002 09:19:11 -0400 
To: "Gary Ruben" <gazzar@email.com>
Subject: Re: [Maxima] restricting Plot3D to defined domain


> >>>>> "Gary" == Gary Ruben <gazzar@email.com> writes:
> 
>     Gary> Hi,
>     Gary> I'm trying to get a 3D plot of a hemisphere by doing the following:
> 
>     Gary> plot3d(realpart(sqrt(25-x^2-y^2)),[x,-5,5],[y,-5,5],[grid,50,50]);
> 
>     Gary> Why doesn't this work? Is there a different way besides my
>     Gary> inclusion of realpart of restricting the domain to defined
>     Gary> regions?
> 
> In what way does this not work?  Your plot3d command works for me,
> except that it prompts me for the sign of y^2+x^2-25.  Since maxima
> can work with complex numbers and will do so in this case, realpart
> seems a reasonable solution.  
> 
> Alternatively, define a new function that does what you want, or use
> some other parametric definition of the hemisphere.
> 
> Will that work?
> 
> Ray
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
> 

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Get 4 DVDs for $.49 cents! plus shipping & processing. Click to join.
http://adfarm.mediaplex.com/ad/ck/990-1736-3566-59