/*
 *  parametric.c
 *  Draws an blue n-gon on a black background
 */


#include <GLUT/glut.h>         /* glut.h includes gl.h and glu.h*/
#define PI 3.14159

void display(void)

{
  float x,y,t,R;
  glClear(GL_COLOR_BUFFER_BIT); 
/* draw parametric curve */
  glColor3f(0.0,0.0,0.8);
  R = 0.6;
  glBegin(GL_POLYGON);
	 for (t = 0; t < 1; t += 0.1) {
	     x = R*cos(2*PI*t);
	     y = R*sin(2*PI*t);
	     glVertex2f( x, y);
	     }
  glEnd();

  glFlush();

}

int main(int argc, char** argv)
{

/* Initialize mode and open a window in upper left corner of screen */
/* Window title is name of program (arg[0]) */

    glutInit(&argc,argv);
	glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);  
	glutInitWindowSize(500,500);
	glutInitWindowPosition(0,0); 
	glutCreateWindow("parametric"); 
	glutDisplayFunc(display);
	glutMainLoop();

}