MathGroup Archive 2005

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

Search the Archive

Re: 3D graphics domain

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55880] Re: 3D graphics domain
  • From: Paul Abbott <paul at physics.uwa.edu.au>
  • Date: Fri, 8 Apr 2005 01:37:18 -0400 (EDT)
  • Organization: The University of Western Australia
  • References: <d2tesa$qj2$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <d2tesa$qj2$1 at smc.vnet.net>,
 Richard Bedient <rbedient at hamilton.edu> wrote:

> Graph the function
> 
> f(x,y) = -64*x + 320*(x^2) - 512*(x^3) + 256*(x^4) + 20*y - 64*x*y +
> 64*(x^2)*y - 4*(y^2) 
> 
> over the domain:
> 
> y <= 4*x*(1-x)
> y >= 4*x*(1 - 2x)
> y >= 4*(x - 1)*(1 - 2x) 

David Park's solution is very nice. Just some additional comments:

[1] You can use Boole to specify the region:

  << Calculus`

  ineqs[x_, y_] = 
    y <= 4 x (1 - x) && y >= 4 x (1 - 2 x) && y >= 4 (x - 1) (1 - 2 x)

  region[x_, y_] = Boole[ineqs[x,y]]

  ContourPlot[region[x, y], {x, 0, 1}, {y, -0.1, 1.1}, Contours -> {0}, 
    PlotPoints -> 200]

[2] You can use Reduce to parameterize the region

  Reduce[ineqs[x, y], y]

  <<Graphics`

  DisplayTogether[
    FilledPlot[{4 x (1 - 2 x), 4 x (1 - x)}, {x, 0, 1/2}], 
    FilledPlot[{4 (x - 1) (1 - 2 x), 4 x (1 - x)}, {x, 1/2, 1}],   
       AspectRatio -> Automatic]

[3] Here is a 3D plot of the function:

  f[x_, y_] = 256 x^4 - 512 x^3 + 64 y x^2 + 320 x^2 - 64 y x - 64 x - 
             4 y^2 + 20 y; 

  Plot3D[region[x, y] f[x, y], {x, 0, 1}, {y, -0.1, 1.1},   
    PlotPoints -> 300, Mesh -> False]

Cheers,
Paul

-- 
Paul Abbott                                   Phone: +61 8 6488 2734
School of Physics, M013                         Fax: +61 8 6488 1014
The University of Western Australia      (CRICOS Provider No 00126G)         
35 Stirling Highway
Crawley WA 6009                      mailto:paul at physics.uwa.edu.au 
AUSTRALIA                            http://physics.uwa.edu.au/~paul


  • Prev by Date: Why are there no spaces in my title?
  • Next by Date: Re: Re: How do I remove operator status?
  • Previous by thread: Re: Re: 3D graphics domain
  • Next by thread: MiKTeX pdfTeX "problem" fixed?