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

Click For Summary
SUMMARY

This discussion focuses on generating a 3D plot in Mathematica by rotating a 2D plot of radius and temperature about the origin. The user initially struggled with using the Plot3D function but found success with the ParametricPlot3D method. The specific code provided includes the use of Sqrt for radius calculation and the application of opacity and mesh styles to enhance the visual output. The second method, utilizing ParametricPlot3D, was confirmed to meet the user's requirements effectively.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of 2D plotting concepts
  • Knowledge of 3D plotting techniques in Mathematica
  • Basic understanding of parametric equations
NEXT STEPS
  • Explore advanced features of ParametricPlot3D in Mathematica
  • Learn about customizing plot styles in Mathematica
  • Investigate the use of Mesh and Opacity settings in 3D plots
  • Study the mathematical principles behind 3D rotations and transformations
USEFUL FOR

Mathematica users, data visualizers, and anyone interested in creating complex 3D plots from 2D data representations.

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
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · 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