Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Assume I have an object whose radius is modeled by the function $x^2$. Using calculus and circular cross-sections, the object's volume is given by $\pi\int_a^b(x^2)^2dx$.

But given an arbitrary function $f(x)$, how do I illustrate circular cross sections on an interval?

share|improve this question

closed as off-topic by Jens, belisarius, rasher, Kuba, Yves Klett May 25 at 9:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Jens, belisarius, rasher
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
RevolutionPlot3D –  Jens May 25 at 3:33
    
the actual syntax, though? hypothetically for x^2 on the interval 0, 1? –  Yunor May 25 at 3:35
    
You can see an example of how RevolutionPlot3D is used here –  m_goldberg May 25 at 5:17
    
@m_goldberg Thank you! The problem is my inability to translate the calculus in the original problem to the 3D cross sections, as I don't know what it becomes when I try to graph it :( –  Yunor May 25 at 5:28
    
I can't tell from the wording of your question what you are really interested in: 1) visualizing a surface of revolution, or 2) computing the volume contained in such a surface. The first requires no calculus; the second does. Could you clarify? –  m_goldberg May 25 at 5:45

1 Answer 1

There are many built-in functions for making a 3D plot of a surface in Mathematica. Which one would be appropriate to your situation depends critically on how the surface is described. In your case, as I now understand it, you would build an interpolating function and plot that function with RevolutionPlot3D.

Here is an example where the data is sampled from a semicircle.

ParametricPlot[{1 + Cos[t], Sin[t]}, {t, 0, π}]

semicircle

data = Reverse @ Table[{1 + Cos[t], Sin[t]} // N, {t, 0, π, π/100}];
f = Interpolation[data];
RevolutionPlot3D[f[t], {t, 0., 2.},
  RevolutionAxis -> "x", Boxed -> False, Axes -> False]

sphere

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.