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

Click For Summary
The discussion centers around creating a 3D plot in Mathematica using a radius and temperature dataset. The user initially struggles with generating the plot without manually calculating values to input into the Plot3D function. They share a specific 2D plot equation and seek advice on how to effectively visualize it in three dimensions. Two solutions are proposed: one using Plot3D with a transformation based on the radius, and the other utilizing ParametricPlot3D to achieve the desired 3D effect by rotating around the origin. The user finds the second method particularly effective for their needs, indicating a successful resolution to their plotting challenge.
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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
7K