主题:请求帮助,这个程序到底哪里出错了,怎么画不出曲线?
l1=2000/3;
l2=1000;
r1=40;
r2=20;
r3=60;
x=0:pi/180:pi/2;
y= r1.*(pi/2-x+asin((r1-r2)/l1))
+r3.*(pi/2-acos((l2.^2-l1.*l2.*cos(x))/(l2.*sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))+asin((r3-r2)/sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))
+r2.*(x+acos((l2.^2-l1.*l2.*cos(x))/(l2.*sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))-asin((r1-r2)/l1)-asin((r3-r2)/sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))
+sqrt(l1.^2-r1.^2-r2.^2+2.*r1.*r2)
+sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x)-r3.^2-r2.^2+2.*r3.*r2);
plot(x,y,'r-'),grid on;
l2=1000;
r1=40;
r2=20;
r3=60;
x=0:pi/180:pi/2;
y= r1.*(pi/2-x+asin((r1-r2)/l1))
+r3.*(pi/2-acos((l2.^2-l1.*l2.*cos(x))/(l2.*sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))+asin((r3-r2)/sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))
+r2.*(x+acos((l2.^2-l1.*l2.*cos(x))/(l2.*sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))-asin((r1-r2)/l1)-asin((r3-r2)/sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x))))
+sqrt(l1.^2-r1.^2-r2.^2+2.*r1.*r2)
+sqrt(l1.^2+l2.^2-2.*l1.*l2.*cos(x)-r3.^2-r2.^2+2.*r3.*r2);
plot(x,y,'r-'),grid on;