Matlab根据椭圆参数圆心,长轴,短轴,倾斜角画椭圆

已知椭圆的边缘上点的方程为:
在这里插入图片描述
其中(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

猜你喜欢

转载自blog.csdn.net/qq_41372644/article/details/123914907
今日推荐