Week 2 Assignment

Maria Mendez

Problem 3

void drawOval(void){
int numPoints=50;
float hRad= 10;
float vRad= 100;
int angle;
int i;
Vec2d P;
Vec2d center(200,200);
for(i=0; i<10;i++){
glBegin(GL_LINE_LOOP);
for(angle = 0; angle < numPoints; angle++){
//180 degrees = PI radians
float A = 2*PI /numPoints * angle;
P.x = cos(A) * hRad;
P.y = sin(A) * vRad;
P = P+ center;

glVertex2f(P.x, P.y);
}
glEnd();
hRad+=10;
vRad-=10;
}

}