How Do I rotate f(x) around the x-axis in MATlab or Mathematica?

In summary, the individual is seeking assistance in creating a visualization of the function y = sech(x) revolved around the x-axis from x = -2 to 2, resulting in a "solid of revolution". They are unsure how to use the plot3D command in conjunction with the rotation and are looking for an example. The suggested approach involves solving for z in terms of x and y, resulting in two solutions that can be plotted using the plot3D command. It is also suggested to search for the "SurfaceOfRevolution" command in the master index.
  • #1
VinnyCee
489
0
Please help, I want a visualization of the function y = sech(x) revolved around the x-axis from x = -2 to 2, creating a "solid of revolution". :confused:
 
Physics news on Phys.org
  • #2
Don't they have a plot3D command?
 
  • #3
Yes, but how would I use that in conjunction with the rotation? Could you give me an example please?
 
  • #4
I can't say for sure because I don't use either of the programs you mentioned but I would try something like
[tex]y^2 + z^2 = \frac {1}{\sinh^2 x}[/tex]
and solving for z in terms of x and y (two solutions) so that plot3D(z, [x, y]) for the two solutions would be plotted. (Again, I don't know the specifics of the syntax so you'll need to adjust but it should be something like that.)
 
  • #5
I believe the command is "SurfaceOfRevolution", do a search in the master index.
 

1. How do I rotate a function around the x-axis in MATLAB or Mathematica?

To rotate a function around the x-axis in MATLAB or Mathematica, you can use the "revolve" or "RevolutionPlot3D" function. These functions take in the function, the variable to rotate around (in this case, it would be "x"), and the range of values for the variable.

2. Can I rotate a 3D function around the x-axis in MATLAB or Mathematica?

Yes, both MATLAB and Mathematica have functions for rotating 3D functions around the x-axis. In MATLAB, you can use the "surf" function to create a 3D surface plot and then use the "view" function to rotate it around the x-axis. In Mathematica, you can use the "RevolutionPlot3D" function, as mentioned before, to rotate a 3D function around the x-axis.

3. How do I specify the angle and direction of rotation in MATLAB or Mathematica?

In both MATLAB and Mathematica, you can specify the angle and direction of rotation by using the "RotationAction" option in the "revolve" or "RevolutionPlot3D" function. You can set the angle in degrees or radians, and choose the direction of rotation (clockwise or counterclockwise).

4. Can I rotate a function around a different axis in MATLAB or Mathematica?

Yes, you can rotate a function around a different axis in both MATLAB and Mathematica. In MATLAB, you can use the "rotate" function to specify the axis of rotation. In Mathematica, you can use the "RevolutionAxis" option in the "RevolutionPlot3D" function to specify the axis of rotation.

5. Is there a way to animate the rotation of a function in MATLAB or Mathematica?

Yes, you can create an animation of the rotation of a function in both MATLAB and Mathematica. In MATLAB, you can use the "animatedline" function to create a line that updates with each rotation step. In Mathematica, you can use the "Animate" function to create an animation of the function's rotation.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
32
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
823
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
755
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
995
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
258
Back
Top