3
$\begingroup$

$$\begin{align*} f(x,y)&=1+y^2\\ \mathbf r(t)&=2\cos t\,\mathbf i+2\sin t\,\mathbf j,\qquad 0\le t\le 2\pi \end{align*}$$

enter image description here

How do I draw the solid shown above given the $f(x,y)$ and $r(t)$ provided?

$\endgroup$
3
  • 5
    $\begingroup$ Maybe Plot3D[1 + y^2, {x, y} \[Element] Disk[{0, 0}, 2], Mesh -> None, PlotStyle -> GrayLevel[0.5, 0.5], Filling -> Axis, PlotRange -> {0, Automatic}, BoxRatios -> Automatic]. There's also ParametricPlot3D if you prefer more control. $\endgroup$
    – Michael E2
    Jun 13 at 17:09
  • 4
    $\begingroup$ Michael's code is the best thing to do, but the straightforward translation is something like Plot3D[1 + y^2, {x, y} ∈ ParametricRegion[{r Cos[t], r Sin[t]}, {{r, 0, 2}, {t, 0, 2 π}}], Mesh -> None, PlotStyle -> GrayLevel[0.5, 0.5], Filling -> Axis, PlotRange -> {0, Automatic}, BoxRatios -> Automatic]. I'll let someone else fiddle with the styling. $\endgroup$ Jun 13 at 17:21
  • $\begingroup$ Both these solutions are great. How would you use ParametricPlot3D to draw this solid? @Michael E2 $\endgroup$
    – John K
    Jun 14 at 17:01

2 Answers 2

2
$\begingroup$

Following the comments under the question I made a summary of three proposed solutions:

Michael E2's Plot3D solution:

Plot3D[1+y^2,{x,y}∈Disk[{0,0},2],
  Mesh->None,PlotStyle->GrayLevel[0.5,0.5],Filling->Axis,
  PlotRange->{0,Automatic},BoxRatios->Automatic
]

First Plot3D

J. M.'s slightly less busy's Plot3D solution:

Plot3D[1+y^2,{x,y}∈
  ParametricRegion[{r Cos[t],r Sin[t]},{{r,0,2},{t,0,2 π}}],
  Mesh->None,PlotStyle->GrayLevel[0.5,0.5],
  Filling->Axis,PlotRange->{0,Automatic},BoxRatios->Automatic
]

Second Plot3D

An implementation based on two ParametricPlot3D (as proposed by Michael E2?):

Show[{
  ParametricPlot3D[{2Cos[ϕ],2Sin[ϕ],z},{ϕ,0,2π},{z,0,6},
    RegionFunction->({x,y,z}|->z<1+y^2),Mesh->None,
    PlotStyle->GrayLevel[0.5,0.5]],
  ParametricPlot3D[{x,y,1+y^2},{x,-2,2},{y,-2,2},
    RegionFunction->({x,y,z}|->x^2+y^2<=2^2),
    Mesh->None,PlotStyle->GrayLevel[0.5,0.5],
    BoundaryStyle->Black]
}]

ParametricPlot3D

$\endgroup$
2
$\begingroup$

Improve the plot by RegionFunction.

f[x_, y_] = 1 + y^2; 
Plot3D[{f[x, y], 0}, {x, -2, 2}, {y, -2, 2}, 
 PlotPoints -> 50, MaxRecursion -> 2, 
 RegionFunction -> 
  Function[{x, y}, {x, y} ∈ Disk[{0, 0}, 2]], 
 PlotStyle -> Gray, Mesh -> None, Lighting -> "Accent", 
 Boxed -> False, Axes -> False, Filling -> Axis, BoxRatios -> 1, 
 FillingStyle -> Gray, ViewPoint -> {-2.87, -1.26, 1.25}]

enter image description here

$\endgroup$

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.