MATLAB 抛物线旋转曲面clc;clear;close all;y = 0:1:20;z = -0.1*(y-5).^2+2.5;x = 0;plot3(x,y,z);r = sqrt(y.^2+z.^2); % 绕z轴旋转,求各点到z轴的距离r,即旋转半径ar = linspace(-pi,pi,100);xx = r * cos(ar); % 前面的x,y,z是列向
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/21 17:29:39
MATLAB 抛物线旋转曲面clc;clear;close all;y = 0:1:20;z = -0.1*(y-5).^2+2.5;x = 0;plot3(x,y,z);r = sqrt(y.^2+z.^2); % 绕z轴旋转,求各点到z轴的距离r,即旋转半径ar = linspace(-pi,pi,100);xx = r * cos(ar); % 前面的x,y,z是列向
MATLAB 抛物线旋转曲面
clc;clear;close all;
y = 0:1:20;
z = -0.1*(y-5).^2+2.5;
x = 0;
plot3(x,y,z);
r = sqrt(y.^2+z.^2); % 绕z轴旋转,求各点到z轴的距离r,即旋转半径
ar = linspace(-pi,pi,100);
xx = r * cos(ar); % 前面的x,y,z是列向量,r就是列向量,列向量*行向量生成n阶矩阵
yy = r * sin(ar);
zz = z * ones(1,n);
mesh(xx,yy,zz) % 之后可以用hidden off来关闭透视效果.
一条yoz面内的抛物线,怎么绕z轴旋转成三维曲面呢?
非常感谢dbb627的回答,但是那些语法我好像不到,如果能有解释的话就好了,
MATLAB 抛物线旋转曲面clc;clear;close all;y = 0:1:20;z = -0.1*(y-5).^2+2.5;x = 0;plot3(x,y,z);r = sqrt(y.^2+z.^2); % 绕z轴旋转,求各点到z轴的距离r,即旋转半径ar = linspace(-pi,pi,100);xx = r * cos(ar); % 前面的x,y,z是列向
clc;clear;close all;
y = 0:1:20;
z = -0.1*(y-5).^2+2.5;
x = 0.*y;
plot3(x,y,z);
figure
[r,theta]=meshgrid(linspace(0,30,50),linspace(-pi,pi,100));
x1=r.*cos(theta);
y1=r.*sin(theta);
z1=-0.1*(r-5).^2+2.5+0.*theta;
mesh(x1,y1,z1)
百分号后面的都是解释的哦!~~