4
$\begingroup$

I need help creating a plot that I can manipulate the variables for the volume between three surfaces. I am trying to make it look like this example here: http://demonstrations.wolfram.com/ExploringCylindricalCoordinates/ but with the volume I need.

It is volume that lies within the cylinder x^2+y^2=1, above the plain z=0 ,and below the cone z^2=4x^2+4y^2. I converted to cylindrical coordinates (z,r,theta). Here is what I have so far.:

Show[RevolutionPlot3D[2 r, {r, 0, 1}, {theta, 0, Pi}], 
 ParametricPlot3D[{Cos[u], Sin[u], v}, {u, 0, Pi}, {v, 0, 2}]]

thank you

$\endgroup$
  • $\begingroup$ You could tag on triangles in the y=0 plane and the half-disk floor in the z=0 plane, not sure if that's good enough :) $\endgroup$ – ssch Dec 7 '13 at 3:17
  • $\begingroup$ no i don't know how to do that but thank you. $\endgroup$ – user10977 Dec 7 '13 at 3:18
5
$\begingroup$

For the static plot in the question, the missing pieces are two triangular walls in the y=0 plane an a half-disk floor in the z=0 plane

Show[
 (* Put the half-disk floor in here, just a constant 0 function *)
 RevolutionPlot3D[{{2 r}, {0}}, {r, 0, 1}, {theta, 0, Pi}], 
 ParametricPlot3D[{Cos[u], Sin[u], v}, {u, 0, Pi}, {v, 0, 2}],
 (* And the triangles here *)
 Graphics3D[{
   Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 0, 2}}],
   Polygon[{{0, 0, 0}, {-1, 0, 0}, {-1, 0, 2}}]
   }],
 AxesLabel -> {x, y, z}]

output

You can parameterize the triangles too of course:

Show[
 RevolutionPlot3D[{{2 r}, {0}}, {r, 0, 1}, {theta, 0, Pi}],
 ParametricPlot3D[{
   {Cos[u], Sin[u], v},
   u/Pi {1, 0, v},
   u/Pi {-1, 0, v}
   }, {u, 0, Pi}, {v, 0, 2}],
 AxesLabel -> {x, y, z}, PlotRange -> All]
$\endgroup$
  • $\begingroup$ WOW thank you very much you are the man!! i really appropriate it. hopefully I'm not asking too much of you but could you point me in the right direction for adding the variable sliders to the graph. Will the "Manipulate" command do it or is there another method? $\endgroup$ – user10977 Dec 7 '13 at 3:38
  • $\begingroup$ @user10977 Manipulate is the tool for the job. Hint to generalize the triangles: The second triangle parametrization in this case can be written as u/Pi { Cos[Pi], Sin[Pi], v} $\endgroup$ – ssch Dec 7 '13 at 3:50
  • $\begingroup$ great i'm trying it now $\endgroup$ – user10977 Dec 7 '13 at 4:18
  • $\begingroup$ I'm sorry I don't understand Manipulate[ Show[RevolutionPlot3D[{{2 r}, {0}}, {r, 0, 1}, {theta, 0, Pi}], ParametricPlot3D[{{Cos[u], Sin[u], v}, u/Pi {Cos[Pi], Sin[Pi], v}}, {u, 0, Pi}, {v, 0, 2}, PlotRange -> All], AxesLabel -> {x, y, z}, PlotRange -> All], {{r, 1}, 0, 2}, {{u, 0}, 0, 2 Pi}, {{v, 0}, 0, 2}] $\endgroup$ – user10977 Dec 7 '13 at 4:44
  • $\begingroup$ @user10977 There you have one Manipulate variable called v and one ParametricPlot3D variable called v that easily gets confusing for both humans and mathematica, perhaps call the Manipulate variable vmax and make the ParametricPlot3D range {v, 0, vmax} $\endgroup$ – ssch Dec 7 '13 at 12:02

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.