改成:
l1=36.15;l2=553.353;l3=400;l4=290;
t=linspace(0,2*pi,100);w=2*pi;
A=l4-l1*cos(w*t);B=-l1*sin(w*t);C=(A.^2+B.^2+l3^2-l4^2)/(2*l3);
sa3=2*atan((B+sqrt(A.^2+B.^2-C.^2))./(A-C));
H=l3*sin(sa3)*2;
plot(t,H);
输出:
> l1=36.15;l2=553.353;l3=400;l4=290;
t=linspace(0,2*pi,100);w=2*pi;
A=l4-l1*cos(w*t);B=-l1*sin(w*t);C=(A.^2+B.^2+l3^2-l4^2)/(2*l3);
sa3=2*atan((B+sqrt(A.^2+B.^2-C.^2))./(A-C));
H=l3*sin(sa3)*2;
plot(t,H);
可这样改:
l1=36.15;l2=553.353;l3=400;l4=290;
t=linspace(0,2*pi,100);w=2*pi;
A=l4-l1*cos(w*t);
B=-l1*sin(w*t);
C=(A.^2+B.^2+l3^2-l4^2)/(2*l3);
sa3=2*atan((B+sqrt(A.^2+B.^2-C.^2))./(A-C));
H=l3*sin(sa3)*2;
plot(t,H);