5
$\begingroup$

Following the question on TeX StackExchange

enter image description here

I want to get this picture

enter image description here

I tried

Clear["Global`*"] myangle = Pi/4; myr = 4; myh = myr* Tan[myangle]; pA = {0, 0, myh}; pO = {0, 0, 0}; mycylinder = Cylinder[{pO, pA}, myh]; plane = InfinitePlane[{{myr, 0, 0}, {-myr, 0, 0}, {0, myr, myh}}]; plot3d = RegionPlot3D[DiscretizeRegion@RegionIntersection[mycylinder, plane], BoundaryStyle -> {Thick, Red}, PlotStyle -> None, Boxed -> False]; Show[plot3d, Graphics3D[{Opacity[0.8], mycylinder, Thick, Blue, Line[{{0, myr, 0}, {0, myr, myh}}]}, Boxed -> False] ] Show[plot3d, Graphics3D[{Opacity[0.8], Thick, Blue, Line[{{0, myr, 0}, {0, myr, myh}}]}, Boxed -> False] ] 

and get

enter image description here

enter image description here

$\endgroup$

3 Answers 3

11
$\begingroup$

Method-1

  • We plot the plane z==Tan[π/4] x and cut it by the half disk and filling to the bottom.

  • Reply to comment: To make the boundary smooth, we set AccuracyGoal -> 5 in BoundaryDiscretizeGraphics.

Clear[plot,arrow,text]; plot = Plot3D[ Tan[π/4] x, {x, y} ∈ BoundaryDiscretizeGraphics[Disk[{0, 0}, 1, {-(π/2), π/2}], AccuracyGoal -> 5], BoxRatios -> Automatic, Boxed -> False, Axes -> False, Filling -> Bottom, PlotStyle -> Directive@{LightRed, Opacity[.5]}, FillingStyle -> Red, BoundaryStyle -> Directive@{Thick, Green}, MeshFunctions -> Function[{x, y, z}, y], Mesh -> {{{0, Directive@{Blue, Thick}}}}]; arrow = Graphics3D[{Arrowheads[.03], White, Arrow@Table[ RotationTransform[t, {0, -1, 0}, {0, 0, 0}]@{.35, 0, 0}, {t, Subdivide[0, π/4, 80]}]}]; text = Graphics3D[{Dashed, AbsoluteThickness[2], Line[{{0, 0, 0}, {1, 0, 0}}], Text[Style["θ", FontFamily -> "Times", 25, White], {.4, 0, .2}]}]; Show[text, arrow, plot, Boxed -> False, ViewPoint -> {-1.3, -2.9, 1.3}] 

enter image description here

  • This method can also calculate the volume.
Integrate[ Tan[π/4] x, {x, y} ∈ Disk[{0, 0}, 1, {-(π/2), π/2}]] 

2/3.

Method-2

  • Before I post the previous answer,I also test the HalfSpace,but it need to set the plotrange and the effect in Graphics3D not so good. Finally I found ConicHullRegion work perfect.
  • Update later.
θ1 = 0; θ2 = π/4; reg = RegionIntersection[ BoundaryDiscretizeGraphics[Cylinder[], AccuracyGoal -> 5], BoundaryDiscretizeGraphics[ ConicHullRegion[{0, 0, 0}, {{0, 1, 0}, {0, -1, 0}}, {{1, 0, Tan[θ1]}, {1, 0, Tan[θ2]}}]]]; Graphics3D[{EdgeForm[], FaceForm[Directive@{Opacity[.5], LightRed}], reg},ViewPoint -> {-1.3, -2.9, 1.3}] 

enter image description here

  • If we want to the exact value of the Volume,we should remove the BoundaryDiscretizeGraphics.
RegionIntersection[Cylinder[], ConicHullRegion[{0, 0, 0}, {{0, 1, 0}, {0, -1, 0}}, {{1, 0, Tan[θ1]}, {1, 0, Tan[θ2]}}]] // Volume 

2/3.

  • When θ1 = π/6;θ2 = π/4;

enter image description here

$\endgroup$
4
  • $\begingroup$ How can I make green parabol smooth? $\endgroup$ Commented Sep 25, 2024 at 12:49
  • $\begingroup$ I use Volume[reg]. How can I get exact result? $\endgroup$ Commented Sep 26, 2024 at 2:11
  • $\begingroup$ @cvgmt just a minor point re: volume: should radius of disk be 2 and hence volume 16/3 $\endgroup$ Commented Sep 26, 2024 at 10:15
  • $\begingroup$ @ubpdqn Yes. RegionIntersection[Cylinder[{{0, 0, 0}, {0, 0, 10}}, 2], ConicHullRegion[{0, 0, 0}, {{0, 1, 0}, {0, -1, 0}}, {{1, 0, Tan[0]}, {1, 0, Tan[π/4]}}]] // Volume or Integrate[ Tan[π/4] x, {x, y} ∈ Disk[{0, 0}, 2, {-(π/2), π/2}]] $\endgroup$ Commented Sep 26, 2024 at 10:17
6
$\begingroup$

Try Halfspace as follows

reg = HalfSpace[-{0, Sin[myangle], -Cos[myangle] }, 0] (* region under the intersection plane*) Region[ RegionIntersection[mycylinder, reg ],PlotRange -> {{-4, 4}, {-4, 4}, {0, 4}}] 

enter image description here

$\endgroup$
2
$\begingroup$

If just want surface of region:

ParametricPlot3D[{{2 Cos[t], 2 Sin[t], 2 s Cos[t]}, {2 s Cos[t], 2 Sin[t], 2 s Cos[t]}, {2 s Cos[t], 2 s Sin[t], 0}}, {t, -Pi/2, Pi/2}, {s, 0, 1}, PlotStyle -> LightBlue, Mesh -> None] pp[a_] := ParametricPlot3D[{{2 Cos[t], 2 Sin[t], 2 s Cos[t] Tan[a]}, {2 s Cos[t], 2 Sin[t], 2 s Cos[t] Tan[a]}, {2 s Cos[t], 2 s Sin[t], 0}}, {t, -Pi/2, Pi/2}, {s, 0, 1}, PlotStyle -> LightBlue, Mesh -> None, PlotRange -> {{-2, 2}, {-2, 2}, {0, 8}}] Manipulate[pp[a], {a, {Pi/6, Pi/4, Pi/3, Pi/2.5}}] 

enter image description here

The manipulate gif is here.

ir = ImplicitRegion[{x^2 + y^2 <= 4, 0 <= z <= x}, {x, y, z}]; Show[ParametricPlot3D[{2 Cos[t], 2 Sin[t], 2 Cos[t]}, {t, -Pi/2, Pi/2}, PlotStyle -> {Red, Thickness[0.02]}], RegionPlot3D[ir, PlotPoints -> 200, PerformanceGoal -> "Quality", PlotStyle -> Opacity[0.5]]] Volume[ir] Integrate[1, {x, y, z} \[Element] ir] 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.