x=0:pi/100:2pi;
h=[];
for x0=x;
if x0>=0&&x0<=pi/2
h=[h,(28.5*sin(x0).^2+(28.5^2*cos(x0).^4+(64^2-28.5*28.5)*cos(x0).^2).^(1/2))/64];
X=(64^2+28.5^2-2*64*28.5*h).^(1/2);
elseif x0>pi/2&&x0<=1.776
h=[h,(28.5*sin(x0).^2-(28.5^2*cos(x0).^4+(64^2-28.5*28.5)*cos(x0).^2).^(1/2))/64];
X=(64^2+28.5^2-2*64*28.5*h).^(1/2);
elseif x0>1.776&&x0<=2.2
h=[h,36*cos(2.2-x0)+(36^2*cos(2.2-x0).^2-36^2+34^2).^(1/2)];
X=h;
elseif x0>2.2&&x0<=4.08
h=[h,70];
X=h;
elseif x0>4.08&&x0<=4.51
h=[h,36*cos(4.51-x0)+(36^2*cos(4.51-x0).^2-36^2+34^2).^(1/2)];
X=h;
elseif x0>4.51&&x0<1.5pi
h=[h,(28.5sin(x0).^2-(28.5^2cos(x0).^4+3283.75cos(x0).^2).^(1/2))/64];
X=(64^2+28.5^2-26428.5h).^(1/2);
else
h=[h,(28.5sin(x0).^2+(28.5^2cos(x0).^4+3283.75cos(x0).^2).^(1/2))/64];
X=(64^2+28.5^2-26428.5h).^(1/2);
end
end;
S=acos((199.4^2+201^2-X.^2)/2/199.4/201);
plot(x,S);
[](
))
你看看是不是这样做的
x=0:pi/100:2*pi;
h=[];
X = [];
for x0=x
if x0>=0&&x0<=pi/2
h=[h,(28.5*sin(x0).^2+(28.5^2*cos(x0).^4+(64^2-28.5*28.5)*cos(x0).^2).^(1/2))/64];
X=[X;(64^2+28.5^2-2*64*28.5*h(end)).^(1/2)];
elseif x0>pi/2&&x0<=1.776
h=[h,(28.5*sin(x0).^2-(28.5^2*cos(x0).^4+(64^2-28.5*28.5)*cos(x0).^2).^(1/2))/64];
X=[X;(64^2+28.5^2-2*64*28.5*h(end)).^(1/2)];
elseif x0>1.776&&x0<=2.2
h=[h,36*cos(2.2-x0)+(36^2*cos(2.2-x0).^2-36^2+34^2).^(1/2)];
X=[X;h(end)];
elseif x0>2.2&&x0<=4.08
h=[h,70];
X=[X;h(end)];
elseif x0>4.08&&x0<=4.51
h=[h,36*cos(4.51-x0)+(36^2*cos(4.51-x0).^2-36^2+34^2).^(1/2)];
X=[X;h(end)];
elseif x0>4.51&&x0<1.5*pi
h=[h,(28.5*sin(x0).^2-(28.5^2*cos(x0).^4+3283.75*cos(x0).^2).^(1/2))/64];
X=[X;(64^2+28.5^2-26428.5*h(end)).^(1/2)];
else
h=[h,(28.5*sin(x0).^2+(28.5^2*cos(x0).^4+3283.75*cos(x0).^2).^(1/2))/64];
X=[X;(64^2+28.5^2-26428.5*h(end)).^(1/2)];
end
end
S=acos((199.4^2+201^2-X.^2)/2/199.4/201);
plot(x,S);
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!