Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

  1. Sep 8, 2010 #1
    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}]
     
  2. jcsd
  3. Sep 8, 2010 #2
    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]]
     
  4. Sep 9, 2010 #3
    Thanks a lot, that looks great. The second one worked perfectly for what I was going for.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Mathematica- Rotating a 2D plot into a 3D plot
Loading...