Mathematica- Rotating a 2D plot into a 3D plot

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 7K views
timman_24
Messages
52
Reaction score
0
I have a plot of radius and temperature. I want to plot it in 3D by rotating it about the origin to produce a 3D plot. I can not figure out how to do this in Mathematica without doing it by hand and then plugging it into the Plot3D function. Any advice would be greatly appreciated.

The plot is:

Plot[{(20 + 100 - r^2 + 4*30)/4 , (40 + 200 - 2*r^2 + 4*30)/4}, {r, -10, 10}]
 
Physics news on Phys.org
Two options...

Plot3D[With[{r = Sqrt[x^2 + y^2]}, {1/4 (20 + 100 - r^2 + 4 30),
1/4 (40 + 200 - 2 r^2 + 4 30)}], {x, -10, 10}, {y, -10, 10},
Mesh -> Automatic, MeshStyle -> LightGray, PlotStyle -> Opacity[0.5]]

ParametricPlot3D[
Thread[{r Cos[\[Theta]],
r Sin[\[Theta]], {1/4 (20 + 100 - r^2 + 4 30),
1/4 (40 + 200 - 2 r^2 + 4 30)}}], {r, 0, 10}, {\[Theta], 0,
2 \[Pi]}, MeshStyle -> LightGray, PlotStyle -> Opacity[0.5]]
 
Thanks a lot, that looks great. The second one worked perfectly for what I was going for.