绘制半长轴和半短轴分别为a,b的椭圆
//绘制半长轴和半短轴分别为a,b的椭圆
void ellipse(double a,double b)
{
int n = 1000;
double t = 0.0;
glBegin( GL_LINE_LOOP);
for (int i = 0; i < n; ++i)
{
t = i * 2 * 3.14159 / n;
glVertex2f(a*cos(t), b*sin(t));
}
glEnd();
}
绘制半长轴和半短轴分别为a,b的椭圆
//绘制半长轴和半短轴分别为a,b的椭圆
void ellipse(double a,double b)
{
int n = 1000;
double t = 0.0;
glBegin( GL_LINE_LOOP);
for (int i = 0; i < n; ++i)
{
t = i * 2 * 3.14159 / n;
glVertex2f(a*cos(t), b*sin(t));
}
glEnd();
}