matlab如何转动三维图,求助,二维图像如何绕轴旋转成为三维图像

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

程序如下

gama = 2*pi/9;

h = 300;

Rr = 400;

Dr = 850;

R1 = h/(2*sin(gama/2));

theta1 = linspace(0,gama/8,10);

theta2 = linspace(gama/8,gama/4,10);

theta3 = linspace(gama/4,3*gama/8,10);

theta4 = linspace(3*gama/8,gama/2,10);

theta5 = linspace(gama/2,5*gama/8,10);

theta6 = linspace(5*gama/8,3*gama/4,10);

theta7 = linspace(3*gama/4,7*gama/8,10);

theta8 = linspace(7*gama/8,gama,10);

theta = [theta1 theta2 theta3 theta4 theta5 theta6 theta7 theta8];

Y1 = -80.9186*theta1.^3+279.4697*theta1.^2-153.9023*theta1+474.3163;

Y2 = -80.9186*(theta2-gama/8).^3+258.2853*(theta2-gama/8).^2-106.7218*(theta2-gama/8)+462.9603;

Y3 = -407.0496*(theta3-gama/4).^3+237.1009*(theta3-gama/4).^2-63.7437*(theta3-gama/4)+455.5382;

Y4 = 388.6254*(theta4-3*gama/8).^3+130.5355*(theta4-3*gama/8).^2-31.6614*(theta4-3*gama/8)+451.5106;

Y5 = -388.6254*(theta5-gama/2).^3+232.2774*(theta5-gama/2).^2+450.0000;

Y6 = 407.0496*(theta6-5*gama/8).^3+130.5355*(theta6-5*gama/8).^2+31.6614*(theta6-5*gama/8)+451.5106;

Y7 = 80.9186*(theta7-3*gama/4).^3+237.1009*(theta7-3*gama/4).^2+63.7437*(theta7-3*gama/4)+455.5382;

Y8 = 80.9186*(theta8-7*gama/8).^3+258.2853*(theta8-7*gama/8).^2+106.9743*(theta8-7*gama/8)+462.9603;

c1 = -R1.*(sin(gama-theta)+sin(theta));

c2 = R1.*(cos(gama-theta)-cos(theta));

c3 = -h^2*sin(theta)./(sin(gama-theta)+sin(theta))+h^2/2-...

R1^2*sin(gama).*(cos(gama-theta)-cos(theta))./(sin(gama-theta)+sin(theta));

c5 = h.*sin(theta)./(sin(gama-theta)+sin(theta));

YY4 = [Y4(1) Y4(2) Y4(3) Y4(4) Y4(5) Y4(6) Y4(7) Y4(8) Y4(9) ceil(Y4(10))];

Y11 = [Y1 Y2 Y3 YY4];

Y22 = [Y5 Y6 Y7 Y8];

Y =[Y11 Y22];

Z1 = -sqrt(Rr^2-(Y11-Dr).^2);

Z2 = sqrt(Rr^2-(Y22-Dr).^2);

Z = [Z1 Z2];

X = -c3./c1-h./c1.*Z-c2./c1.*Y;

R1 = h/(2*sin(gama/2));

Xc = 0;

Yc = R1*sin(gama)./(sin(gama-theta)+sin(theta));

Zc = h*sin(theta)./(sin(gama-theta)+sin(theta))-h/2;

r = sqrt((X-Xc).^2+(Y-Yc).^2+(Z-Zc).^2);

plot(theta,r)

谢谢各位大哥,想要实现的就是将r绕theta轴进行旋转,成为空间曲面

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值