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

How to revolve a function f(x) around the x-axis in MATlab or Mathematica

  1. Sep 21, 2004 #1
    How does one revolve a function f(x) around the x-axis in MATlab or Mathematica?

    How would one go about making a visual representation of a function revolved around the x-axis to make a "solid of revolution" in a program like MATlab or Mathematica? For example, a function y = sin(x) can be rotated around the x-axis from x = -3.14 to 3.14, creating a 3D object that has a volume given by the definite integral of pi*sin(x)^2 dx from -3.14 to 3.14. Please help, been trying this for days!
     
    Last edited: Sep 21, 2004
  2. jcsd
  3. Sep 22, 2004 #2

    plover

    User Avatar
    Homework Helper

    For Mathematica: have you looked at the Graphics`SurfaceOfRevolution` package?
     
  4. Sep 23, 2004 #3

    enigma

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    You need to build a line in one plane which you're going to revolve, and then run a 'for' loop adding new points as you rotate the original line about the axis using a 3x3 rotation matrix.

    Then look up the 'mesh' command for syntax getting the points placed in MATLAB.

    Is that enough to get you started?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: How to revolve a function f(x) around the x-axis in MATlab or Mathematica
Loading...