0

At last I solved a math problem and trying to illustrate it in Mathematica TO NOT FORGET.

I used that code. I works and I get a cake-form. But I think it's missing a big $x$ and a big $y$ axis in the middle.

RevolutionPlot3D[{{x, (4 x - x^2)}}, {x, 0, 4}, {th, 0, 2 π},  
Boxed -> False, BoxRatios -> {1, 1, 0.3}, ViewPoint -> {0, 4, 0},  
AxesLabel -> {x, y, z}]

A nice person @rhermans helped me to draw another problem here.

So I tried to apply his code (to apply and learn) but it's not working.

CoordinateTransform[  "Cylindrical" -> "Cartesian", {r, θ, 4 x - x^2}]

With[{parmcartsn = CoordinateTransform["Cylindrical" -> "Cartesian", {r, θ, 4 x - x^2}]},
 Column[{ParametricPlot3D[parmcartsn, {r, 0, 4}, {θ, 0, 2 π}, 
PlotLabel -> TraditionalForm[parmcartsn]], Area[parmcartsn, {r, 0, 4}, {θ, 0, 2 π}]}]]

I just get a sad empty box with coordinates...

kglr
  • 394,356
  • 18
  • 477
  • 896
Dovendyr
  • 225
  • 2
  • 6

1 Answers1

1

Changing 4 x - x^2 to 4 r - r^2 gives the desired result:

With[{parmcartsn = CoordinateTransform["Cylindrical" -> "Cartesian", {r, θ, 4 r - r^2}]},
 Column[{ParametricPlot3D[parmcartsn, {r, 0, 4}, {θ, 0, 2 π}, 
    PlotLabel -> TraditionalForm[parmcartsn]], 
  Area[parmcartsn, {r, 0, 4}, {θ, 0, 2 π}]}]]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896