已知椭圆的边缘上点的方程为:
其中(xe,ye)为圆心,a长轴,b短轴,φ倾斜角,
所以根据方程,可得其画线方程为:
function plot_ellipse(xe,ye,a,b,aerfa)
t0=100;
t=linspace(1,t0+1,t0);
x=a*cos(2*pi/t0*t)*cos(aerfa)-b*sin(2*pi/t0*t)*sin(aerfa)+xe;
y=a*cos(2*pi/t0*t)*sin(aerfa)+b*sin(2*pi/t0*t)*cos(aerfa)+ye;
plot(x,y,'r');
end