3
$\begingroup$

I would like to draw a 3D set ($E$) given the following conditions:

$E=\{(x, y, z)\in\mathbb R^3: x, y, z \in [0, 1], x+2y-1\leq z\}$

I have seen in the Mathematica documentation that there are several functions to draw things like that (e.g Plot3D or ParametricPlot3D). All these function does not meet my needs since I need to draw the intersection between the cube $[0, 1]^3$ and the semi-space $x, +2y-1\leq z$.

Do you know a function that can plot a set like this?

Thank you in advance.

$\endgroup$
2
  • 4
    $\begingroup$ Check the documentation for ImplicitRegion and RegionPlot3D. $\endgroup$
    – bbgodfrey
    Jun 1, 2021 at 20:59
  • 1
    $\begingroup$ Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. $\endgroup$
    – bbgodfrey
    Jun 1, 2021 at 21:00

2 Answers 2

6
$\begingroup$
RegionPlot3D[x + 2 y - 1 <= z,
 {x, 0, 1}, {y, 0, 1}, {z, 0, 1}]

enter image description here

$\endgroup$
6
$\begingroup$

Another way is

Graphics3D[HalfSpace[{1, 2, -1}, 1], 
 PlotRange -> {{0, 1}, {0, 1}, {0, 1}}]

enter image description here

Or

reg1 = ImplicitRegion[{{x, y, z} ∈ Cuboid[], 
    x + 2 y - 1 <= z}, {x, y, z}];
reg2 = ImplicitRegion[
   x + 2 y - 1 <= z, {{x, 0, 1}, {y, 0, 1}, {z, 0, 1}}];
reg3 = ImplicitRegion[{x + 2 y - 1 <= z, 0 <= x <= 1, 0 <= y <= 1, 
    0 <= z <= 1}, {x, y, z}];
reg4 = RegionIntersection[Cuboid[], 
   ImplicitRegion[x + 2 y - 1 <= z, {x, y, z}]];
reg5 = RegionIntersection[Cuboid[], HalfSpace[{1, 2, -1}, 1]];
Region[reg1, BaseStyle -> Orange]
RegionEqual[reg1, reg2, reg3, reg4, reg5]

True

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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