3
$\begingroup$

Is there a way to plot the following set with Mathematica?

$M=\left\{ \left(x,y,z\right)\mid x\in\mathbb{R}\:,\:y=\left|x\right|\:,\:0\leq y<z\right\}$

I think it's suppose to look something like this:

$y=|x|$ is plotted just for reference, and also $(0,0,0)\notin M$ (the origin is not part of the region), but I don't mind if the plot includes this point.

$\endgroup$

2 Answers 2

2
$\begingroup$

We define regionplot[] to take two arguments: w is the region, and p is the number of points passed to PlotPoints.

regionplot[w_, p_] := RegionPlot3D[w, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, 
 BoundaryStyle -> Directive[LightBlue, Thick], Mesh -> None, 
 PlotPoints -> p, PlotRange -> All, AxesLabel -> {x, y, z}, 
 PerformanceGoal -> "Quality", MaxRecursion -> 5, 
 PlotRange -> {{-1, 1}, {0, 1}, {0, 1}}];

We found that plotting the pair of walls with no thickness, leaves quite a gap between the walls. Giving the walls a little thickness, and using p=200 for a nice pinstripe pattern:

regionplot[0 < y < z && Abs[x] - .001 < y < Abs[x] + .001, 200]

enter image description here

$\endgroup$
10
  • $\begingroup$ is there a way to smooth the surface and to get rid of the gap there? $\endgroup$
    – Jon
    Mar 19, 2019 at 11:59
  • $\begingroup$ Yes, I know, it is disappointing! Using PlotPoints-> 1000 instead of 100 gives a nice, light blue wall. Unfortunately, it only plots one wall! (Mathematica 11.2.0.0) A workaround could be to plot to walls individual (wall1 and wall2 and then use Show[]: as in Show[wall1,wall2]. $\endgroup$
    – mjw
    Mar 19, 2019 at 12:49
  • $\begingroup$ Comment correction: "to walls" ---> "the two walls" $\endgroup$
    – mjw
    Mar 19, 2019 at 13:41
  • $\begingroup$ I wasn't speaking about the gap between the lines forming the walls, but the gap between the two walls. This gap $\endgroup$
    – Jon
    Mar 19, 2019 at 13:52
  • $\begingroup$ Right! I also was speaking about the gap between the walls when I wrote there is still a bit of a gap. I don't mind the pinstripes, and with more PlotPoints, I think they disappear. $\endgroup$
    – mjw
    Mar 19, 2019 at 14:32
1
$\begingroup$

This can be done as follows.

Region[ImplicitRegion[y == RealAbs[x] && 0 <= y < z, {x, y, z}]]

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.