My main issue (multivariate calculus), I want to plot the body made within the surfaces
y + z = 4
, y = 4 - x^2
, y = 0
and z = 0
.
the shape of which I am going to triple integrate as soon as I figure out how (not this topic but help is always welcome).
So far I have been trying using Plot3d
, Contourplot3D
and RegionFunction
to show the area,
First try:
Show[
{Plot3D[{z = 4 - y, y = 4 - x^2}, {x, -2, 2}, {y, -1, 5},
Mesh -> None],
ContourPlot3D[{z == 0, y == 0}, {x, -2, 2}, {y, -1, 5}, {z, -1, 7}]},
PlotRange -> All, AxesLabel -> {x, y}, Mesh -> None]
Second try:
Show[
Plot3D[{4 - y, 4 - x^2, 0,}, {x, -2, 2}, {y, 0, 4.1},
PlotStyle ->
{{Blue, Opacity[0.7]}, {Yellow, Opacity[0.4]},
{Green, Opacity[0.4]}, {Red, Opacity[0.4]}},
AxesLabel -> Automatic,
Mesh -> None]]
(Was going to use y = 0
in red but I can't seem to get that one going so I limited to y > 0
)
Now adding a RegionFunction
here could maybe possibly show the shape I am working on, but I would need to use some kind of conditions since the "roof" is not simply made of one function but a mix of two. Any ideas on how I could solve this issue?
the issue being that If I add say
RegionFunction -> Function[{x, y, z}, 4 - x^2 > (4 - y)]
half of the shape will disappear.
Does anyone have a good solution? As you can see from my code I am not proficient in Mathematica yet.
RegionPlot3D[]
? $\endgroup$RegionPlot3D[ 0 <= z <= 4 - y && 0 <= y <= 4 - x^2, {x, -2, 2}, {y, -1, 5}, {z, 0, 6}, Mesh -> None, PlotPoints -> 100, PlotStyle -> Directive[Yellow, Opacity[0.5]]]
? $\endgroup$Plot3D
you can useRegionFunction -> Function[{x, y, z}, 0 <= z <= Min[4 - x^2, (4 - y)]]
to get the same region. $\endgroup$