Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica Plot [help]




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





  • Prev by Date: RE: Mathematica Plot [help]
  • Next by Date: curve fitting
  • Prev by thread: RE: Mathematica Plot [help]
  • Next by thread: Re: Mathematica Plot [help]