e=10;r0=40;rt=10;F=5*pi/6;S=pi/6;L=2*pi/3;J=pi/3;h=20;n=1;m=1;
s0=sqrt(r0^2-e^2);
syms f
syms s
switch f
case(0<=f<5*pi/6)
s=h/2*(1-cos(pi*f/F));
case(5*pi/6<=f<pi)
s=h;
case(pi<=f<4*pi/3)
s=h-2*h*(f-F-S)/L^2;
case(4*pi/3<=f<5*pi/3)
s=(2*h/L^2)*(F+S+L-f)^2;
case(5*pi/3<=f<2*pi)
s=0;
end
f=0:pi/180:2*pi;
% x=(s+s0)*cos(n*f)-m*e*sin(n*f);
% y=(s+s0)*sin(n*f)+m*e*cos(n*f);
% p=@(f)n*(-s-s0)*sin(n*f)-n*m*e*cos(n*f);
% q=@(f)n*(s+s0)*cos(n*f)-n*m*e*sin(n*f);
x=@(f)(n*(s+s0)*cos(n*f)-n*m*e*sin(n*f))/n;
y=@(f)-(n*(-s-s0)*sin(n*f)-n*m*e*cos(n*f))/n;
plot(x,y)
% switch f
% case(0<=f<pi)
% X=x+rt*(q)/(sqrt((p)^2+(q)^2));
%
%
% Y=y-rt*(p)/(sqrt((p)^2+(q)^2));
% case(pi<=f<2*pi)
% X=x-rt*(q)/(sqrt((p)^2+(q)^2));
% Y=y+rt*(p)/(sqrt((p)^2+(q)^2));
% end
http://www.dxsbao.com/shijian/21708.html 点此复制本页地址