I have to plot 0=x^2-2y+y^2 and z=sqrt(x^2+y^2) for a class project but Mathematica does not accept raw input, any ideas? I have tried with "cylinder" in the functions but it does not work.
2 Answers
ContourPlot3D[
{x^2 + y^2 == 1, z == Sqrt[x^2 + y^2]},
{x, -2, 2}, {y, -2, 2}, {z, -.5, 2},
ContourStyle -> Opacity[.65]]
Here are two code samples to get you started. Both snippets achieve the same result:
Plot3D[Sqrt[x^2 + y^2], {x, y} ∈ Disk[{0, 0}, 4]]
or alternatively
Plot3D[
Sqrt[x^2 + y^2], {x, -4, 4}, {y, -4, 4},
RegionFunction -> Function[{x, y, z}, x^2 + y^2 <= 4^2]
]
Either one generates the following:
A different, possibly easier approach, using the fact that a cone is a solid of revolution:
RevolutionPlot3D[t, {t, 0, 4}]
If you are simply interested in drawing the solid object, rather than plotting it from an equation, you can also use graphics primitives:
Graphics3D[
Cone[{{0, 0, 4}, {0, 0, 0}}, 4],
Axes -> True
]
-
$\begingroup$ Thank you all this is what i was looking for. $\endgroup$ Apr 27, 2016 at 15:36
z =
insidePlot
. $\endgroup$