How to rotate a 2d line a 3d plot

4 次查看(过去 30 天)
So I have a 2d line in the xz plane, whose function I don't know, I want to rotate that line about the z axis. For example, if i have a straight line in the xz plane and i rotate it about the z axis I will get a cone.
I know I am suppose to use the rotation matrix;
R_z = (cos(theta),-sin(theta),0;sin(theta),cos(theta),0;0,0,1);
but my issuse is how do I display that rotated line as a surface plot.
Or would it be easier to transfer the 2d line into spherical coordinates, but I don't know how to plot spherical coordinates in Matlab.
Thanks

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by