#include <GL/glut.h>
#include <cmath>
void drawCrescentMoon() {
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
for (int i = 0; i < 360; i++) {
float angle = i * M_PI / 180.0;
float x = 0.2 * cos(angle);
float y = 0.2 * sin(angle);
glVertex2f(x + 0.5, y + 0.5);
}
glEnd();
glBegin(GL_POLYGON);
for (int i = 0; i < 360; i++) {
float angle = i * M_PI / 180.0;
float x = 0.15 * cos(angle);
float y = 0.15 * sin(angle);
glVertex2f(x + 0.65, y + 0.5);
}
glEnd();
glFlush();
}
void display() {
glClearColor(0.0, 0.0, 0.0, 1.0);
glColor3f(1.0, 1.0, 1.0);
glLoadIdentity();
gluOrtho2D(0.0, 1.0, 0.0, 1.0);
drawCrescentMoon();
}
int main(int argc, char argv) {
glutInit(&argc, argv);
glutCreateWindow("Crescent Moon");
glutInitWindowSize(500, 500);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}