# Plotting an inequality in 3D region

Ideally I would like to plot a region in 3D space which is defined by a bunch of inequalities. For example let us consider the region $R$ defined by $${ (x,y, z): x \le 0 \text{ and } y \le 0 \text{ and } x+y \le z }$$.

I am wondering what would be an easier way to do it.

With my limited knowledge I came up with these two approaches.

Approach 1 : Generate points in this region and plot them in 3D. Is there a way to extend the function in  region_plot ()  that generates plot points for my needs?

Approach 2 : Concatenate implicit -3D plots of functions of the form $x + y - (z+t)$, where $t$ is a small positive parameter, for different values of $t$. Then plot all these simultaneously.

I would appreciate any alternate way to do this or any improvements on these approaches.

edit retag close merge delete

Sort by » oldest newest most voted

I'm not aware of an easy way to do this. But, here is one idea:

var('x y z')
p=implicit_plot3d(x+y==z,(x,-4,0),(y,-4,0),(z,-10,0))
p+=polygon3d([(-4,0,-4),(0,0,0),(-4,0,0) ])
p+=polygon3d([(0,-4,-4),(0,0,0),(0,-4,0) ])
p+=polygon3d([(-4,0,-4),(-4,-4,-8),(-4,0,0),(-4,-4,0) ])
p+=polygon3d([(0,-4,-4),(-4,-4,-8),(0,-4,0) ,(-4,-4,0) ])
p

more