ellipse.sce Code:
// 画椭圆
// 焦点在X轴时,标准方程为 x^2/a^2+y^2/b^2=1 (a>b>0)
// 中心点在(x0,y0)
x0=0;
y0=0;
a=10; // 长轴为a
b= 6; // 短轴为b
fi=%pi/3; // 方向角为fi
t=linspace(0,2*%pi);
x=x0+ a*cos(fi)*cos(t)-b*sin(fi)*sin(t) ;
y=y0+ a*sin(fi)*cos(t)+b*cos(fi)*sin(t) ;
plot2d(x,y);
xtitle('椭圆','x','y');
// axis centered at (0,0)
a=gca(); // Handle on axes entity
a.x_location = "origin";
a.y_location = "origin";
3196

被折叠的 条评论
为什么被折叠?



