7
$\begingroup$

Just stumbled across this idea in http://users.rowan.edu/~hassen/Mathematica/Volume%20III/Chapter%2015.pdf.

Clear[f];
f[x_, y_] = 1 - x^2 + y^2;
Plot3D[f[x, y], {x, 0, 1}, {y, x, 1 + x^2},
 Filling -> Bottom,
 FillingStyle -> LightBlue,
 PlotRange -> {0, 4},
 ViewPoint -> {1, 1, 1}]

Which produces:

enter image description here

My main question is related specifically to

Plot3D[f[x, y], {x, 0, 1}, {y, x, 1 + x^2}],

the {y,x,1+x^2} part.

I am so used to using RegionFunction to perform this task. I went into the documentation for Plot3D to see if I could find an example of this, but I could not find anything like this. Is this an old fashioned way that will soon disappear? Is this something I should share with my students? It's amazing how it matches the associated double integral:

$$\int_0^1\int_x^{x^2}(1-x^2+y^2)\,dy\,dx$$

I also have a second question on this image, if folks don't mind. See how the zeros on the tick marks on the x- and z-axes overlap. Anyone have a simple way of separating them a bit?

$\endgroup$
  • $\begingroup$ @belisarius I've updated my post because I think I wasn't making it specific enough on what I was focusing on. $\endgroup$ – David Aug 13 '15 at 19:19
  • 2
    $\begingroup$ you question seems to only be about the limit specification? It seems you are correct that this is not mentioned in the Plot3D documentation, but it is pretty much standard convention among similar functions that take multidimensional ranges that reading left to right the limits of each variable can depend on those before it (Table, Integrate, etc ). No need to be concerned it should go away. $\endgroup$ – george2079 Aug 13 '15 at 20:02
  • $\begingroup$ @george2079 Yes, the worry was about the limit specification. Thanks for your reply. You seem confident that it will continue to exist. $\endgroup$ – David Aug 13 '15 at 22:15
  • $\begingroup$ Great question! I don't think I have ever used this Plot3D form myself even though I knew it could be used elsewhere as george2079 remarks. $\endgroup$ – Mr.Wizard Aug 14 '15 at 0:55
  • $\begingroup$ Re ticks: Plot3D[1 - x^2 + y^2, {x, 0, 1}, {y, x, 1 + x^2}, PlotRangePadding -> 0.08]? $\endgroup$ – Michael E2 Dec 18 '15 at 15:51
10
$\begingroup$

I will post this to avoid confusion - region has a new meaning in WL since Geometric Computation was introduced in V10.

Relative to that meaning what you showed is not a WL region because you cannot compute over it, but of course is a visual of some mathematical region defined analytically and shown with help of Filling.

To achieve the same via computable region:

R = ImplicitRegion[0<z<1-x^2+y^2 && x<y<1+x^2 && 0<x<1, {x, y, z}];

RegionPlot3D[R, PlotPoints -> 100, BoxRatios -> {1, 1, .5}]

enter image description here

Volume[R]

29/21

Integrate[1 - x^2 + y^2, {x, 0, 1}, {y, x, 1 + x^2}]

29/21

Integrate[1, {x, y, z} \[Element] R]
N[%]

29/21

1.380952380952381`

NIntegrate[1, {x, y, z} \[Element] R]

1.3809523809015896`

The above shows that WL computable regions enable symbolic and numeric computations over them.

$\endgroup$
  • 2
    $\begingroup$ Thanks for this very interesting example. Very well explained. $\endgroup$ – David Aug 13 '15 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.