Thanks. I slightly modified your approach:
f(x,y):=if x^2+y^2>1 then false else sin(x*y)$
plot3d(f(x,y),[x,-1,1],[y,-1,1])$
It returns very good graph.
Actually, in real task, i have more complicated condition then
-sqrt(1-x^2)<y<sqrt(1-x^2) (something like h(x)<y<g(x), where h(x), g(x)
some functions) , so i cannot use parametric_surface.
Just a curiosity: why
f(x,y):=block([],
if (y< -sqrt(1-x^2)) then return(0),
if (y>sqrt(1-x^2)) then return(0),
return(sin(x*y)));
is not working?
> Try this:
>
> f(x,y):=if x^2+y^2>1 then 0 else sin(x*y)$
> plot3d(f(x,y),[x,-1,1],[y,-1,1])$
>
> or also this:
>
> load(draw)$
> draw3d(parametric_surface(r*cos(theta),r*sin(theta),sin(r^2*sin(2*theta)/2),r,0,1,theta,0,2*%pi))$
>
>
> See the documentation for the draw package. And also this document:
> http://www.austromath.at/daten/maxima/zusatz/Graphics_with_Maxima.pdf
>
>
> Le 16/11/2012 19:02, Dmitry Shkirmanov a ?crit :
>> i tried this:
>>
>> f(x,y):=block([],
>> if (y< -sqrt(1-x^2)) then return(0),
>> if (y>sqrt(1-x^2)) then return(0),
>> return(sin(x*y)));
>>
>> plot3d(
>> f(x,y),[x,-1,1], [y, -1,1]
>> );
>>
>> But this does no work. I got graph of function sin(x*y). What is wrong?
>>> Hello, list.
>>>
>>> By using maple it's possible to plot something like this:
>>>
>>> plot3d(sin(x*y), x = -1 .. 1, y = -sqrt(1-x^2) .. sqrt(1-x^2), axes
>>> = boxed);
>>>
>>> Here the area that coordinates x,y are changing in is a circle
>>> instead of square.
>>>
>>> I tried to do the same with maxima:
>>> plot3d(sin(x*y),[x,-1,1],[y,-sqrt(1-x^2),sqrt(1-x^2)]);
>>> But maxima says: plotting: range must be of the form [variable, min,
>>> max]; found: [y,-sqrt(1-x^2),sqrt(1-x^2)].
>>>
>>> So, is there any way to plot by maxima a function f(x,y) that is
>>> bounded by other functions in the x-y plane?
>>> .
>>
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>