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

AI Thread Summary
The discussion centers on creating a visualization of the function y = sech(x) revolved around the x-axis, specifically from x = -2 to 2, to form a solid of revolution. Users inquire about using the plot3D command for this purpose and seek guidance on how to implement it alongside the rotation. Suggestions include using the equation y^2 + z^2 = 1/sinh^2(x) to solve for z in terms of x and y, allowing for the plotting of two solutions with plot3D. Additionally, the command "SurfaceOfRevolution" is mentioned as a potential tool for achieving the desired visualization, with a recommendation to consult the master index for more detailed instructions.
VinnyCee
Messages
486
Reaction score
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
Don't they have a plot3D command?
 
Yes, but how would I use that in conjunction with the rotation? Could you give me an example please?
 
I can't say for sure because I don't use either of the programs you mentioned but I would try something like
y^2 + z^2 = \frac {1}{\sinh^2 x}
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.)
 
I believe the command is "SurfaceOfRevolution", do a search in the master index.
 

Similar threads

Replies
10
Views
3K
Replies
32
Views
4K
Replies
2
Views
3K
Replies
1
Views
2K
Replies
2
Views
3K
Back
Top