#include #include #include #include const int screenWidth = 480; const int screenHeight = 480; const float superEllipseWidth = 100; const float superEllipseHeight = 50; const float superEllipseBulge = 1.5; // OK for (0,2] only! GLdouble xFcn(float t); GLdouble yFcn(float t); void myInit(void) { glClearColor(1.0,1.0,1.0,0.0); // background glColor3f(0.0, 0.0, 0.0); // drawing color glPointSize(1.0); // pointsize glMatrixMode(GL_PROJECTION); // random necessary wierdness glLoadIdentity(); gluOrtho2D(0.0, (GLdouble)screenWidth, 0.0, (GLdouble)screenHeight); } GLdouble xFcn(float t) { float cost = cos(t); if (cost == 0.0) return cost; else return ( superEllipseWidth * cost * (pow (fabs (cost), (2/superEllipseBulge)-1))); } GLdouble yFcn(float t) { float sint = sin(t); if (sint == 0.0) return sint; else return ( superEllipseHeight * sint * (pow (fabs (sint), (2/superEllipseBulge)-1))); } void myDisplay(void) { int N = 100; int xOffset = 300; int yOffset = 200; float timePointArray[N]; for (int i=0; i