Graphing a solid between two structures using spherical coordinatesGg h d Ffa x234IDrr
How can I graph the solid that lies above the cone $z=\\sqrt{x^2+y^2}$ and below the sphere $x^2+y^2+z^2=z$?
I tried SphericalPlot3D[1, {\\[Theta], 0, \\[Pi]/4}, {\\[Rho], 0, 2}]
which doesn't give me a solid, how do I do this?
Sorry I am a beginner with mathematica
3 Answers
Try
RegionPlot3D[z >= Sqrt[x^2 + y^2] && x^2 + y^2 + z^2 <= z, {x, -.5, .5}, {y, -.5, .5}, {z, 0, 1}]
You asked to do this in spherical coordinates so see if this is good enough for you.
r[phi_,theta_]:=Piecewise[{
{0,Pi/4<phi<Pi/2},
{10*phi+1-5/2*Pi,Pi/4-1/10<phi<Pi/4},
{1,0<phi<Pi/4-1/10}}];
SphericalPlot3D[r[phi,theta],{phi,0,Pi/2},{theta,0,2Pi},PlotPoints->100]
That r
is zero outside the range of the cone, increases rapidly to make up the surface of the cone and then is 1 to make up the sphere on top of the cone.
That doesn't give a perfect cone because the tip and junction between the cone and the sphere aren't well rendered in the plot. You can increase the PlotPoints
to make this better.
You could use this method to graph a variety of surfaces in spherical coordinates.
As a hint, I found the coefficients of -10*phi+5/2*Pi
by Solve[{m (Pi/4-1/10)+b == 0, m Pi/4+b == 1},{m,b}]
You can also combine two RevolutionPlot3D
s using Show
:
Show[RevolutionPlot3D[{t, t}, {t, 0, 1/2}],
RevolutionPlot3D[{Cos[t] / 2, Sin[t] / 2 + 1/2}, {t, 0, Pi}],
PlotRange -> All]