Re: Mathematica Plot [help]
- To: mathgroup@smc.vnet.net
- Subject: [mg10345] Re: Mathematica Plot [help]
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Thu, 8 Jan 1998 23:41:05 -0500
- References: <68s834$5mq@smc.vnet.net>
Wei Xu wrote: > I want to draw a surface, say sin[x,y], defined on a triangular domain, > say, x:[0,1], y:[0,1] and x+y <=1. > I tried to use the following command: > ParametricPlot3D[{fx, fy, fz}, {x,0,1}, {y,0,1-x}] but it is not > allowed to use {y,0,1-x}. Wei: Find a parameterization of the region, Rxy, that you wish to plot f[x,y] over. {s,t} -> {x[s,t], y[s,t]} taking a rectangle [smin,smax] x [tmin, tmax] onto R[x,y]. Plot ParametricPlot3D[{x[s,t],y[s,t],f[x[s,t],y[s,t]}, {s,smin,smax},{t,tmin,tmax}] For your example take x[s_,t_] := s y[s_,t_] := s t f[x_,y_] := Sin[x y] ParametricPlot3D[{x[s,t], y[s,t], f[x[s,t],y[s,t]]},{s,0,1}, {t,0,1}] There are many ways of implementing this idea: here is one using formulas and replacement. {x,y,z}/.z->Sin[x y]/.{x->s, y-> s t} {s, s*t, Sin[s^2*t]} ParametricPlot3D[%//Evaluate,{s,0,1}, {t,0,1}] This will work without the use of Evaluate, but less efficiently -- Allan Hayes Mathematica Training and Consulting Leicester, UK hay@haystack.demon.co.uk http://www.haystack.demon.co.uk voice: +44 (0)116 271 4198 fax: +44 (0)116 271 8642