Language: C++

//
// Analog Clock
//
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>

void Display(void);
void Reshape(int,int);
void PrintText(int, int, char *);
void Keyboard(unsigned char, int, int);
void Timer(int);

double Time=90;
int ls, lm, lh; // Length of Needle
int xs, ys;	// Second Hand Coordinate
int xm, ym;	// Minute Hand Coordinate
int xh , yh;	// Second Hand Coordinate
int xc, yc;	// Center Coordinate
double xd, yd;	// Scale of Panel
int ld;		// Radius of Panel
int ld0;	// Radius of Panel Indicate
int tmp[360][2];
double theta;	// Angle
int i ,count=0;		// Loop Counter
double j ;
double tmpx,tmpy;
double maxy=0,miny=1e9;
double disx = 0;
char wt[20];
double x,v,a;
char xmessage[100];
char vmessage[100];
char amessage[100];

int main(int argc, char **argv)
{
	glutInit(&argc, argv);
	glutInitWindowSize (700, 300);
	glutCreateWindow("takeuti");
	glutDisplayFunc(Display);
	glutKeyboardFunc(Keyboard);
	glutReshapeFunc(Reshape);
	glutTimerFunc (1, Timer, 0);
	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
	glClearColor(0.5, 0.0, 1.0, 1.0);

	glutMainLoop();

	return(0);
}


//
// Update Window Display
//
void Display(void)
{

	ls = 129;
	lm = 120;
	lh = 90;
	ld = ls + 10;
	ld0 = ls-10;

	xc = 150;
	yc = 150;

// Getting Current Time
//	time(&tt);
//	ts = localtime(&tt);
//	 It's 10:40:20 ,now.
	
	// Window Title
	glutSetWindowTitle(wt);

	// Bachground Paint
	glClear(GL_COLOR_BUFFER_BIT);
// Watch face
// 各点の座標取得
	for (i = 0 ; i < 360 ; i++)
	{
		theta = 2.0 * M_PI * (double)i / 360.0;
		xd = xc + (int)(ld * sin(theta));
		yd = yc - (int)(ld * cos(theta));
		
		glPointSize (5.0);
		
		tmp[i][0] = xd;
		tmp[i][1] = yd;
		if(maxy < yd) {
			maxy = yd;
		}
		if(miny > yd) {
			miny = yd;
		}
		
	}
	
//座標取得終わり
	glLineWidth(3.0);
	glBegin(GL_LINE_LOOP);
	for(i = 0; i < 360; i++) {
		glVertex2i(tmp[i][0], tmp[i][1]);
	}
	glEnd();
	// 単振動軸
	glBegin(GL_LINES);
	glVertex2i(340,miny);
	glVertex2i(340,maxy);
	glEnd();
	// 正弦波軸
	glBegin(GL_LINES);
	glVertex2i(450,150);
	glVertex2i(650,150);
	glEnd();

	glColor3ub (255, 255, 255);
	theta = M_PI * (double) Time / 180.0;
	double Theta = theta - (M_PI/2);
// 円運動、単振動表示
	tmpx = xc + (int)(ld * sin(theta));
	tmpy= yc - (int)(ld * cos(theta));
	glColor3ub (220 , 220, 220);
	glPointSize(10.0);
	glBegin(GL_POINTS);
	glVertex2d(tmpx , tmpy);
	glVertex2d(340 ,tmpy);
	glVertex2d((double)450 + disx ,tmpy);
	glEnd();
	glLineWidth(1.5);
	glBegin(GL_LINES);
	glVertex2d(tmpx , tmpy);
	glVertex2d(340 ,tmpy);
	glEnd();
//	変数教示
	printf("x = %.2f : ",(ld * M_PI * sin(Theta)));
	printf("v = %.2f : ",(ld * M_PI * cos(Theta)));	
	printf("a = %.2f\n ",((-1) * ld * M_PI * M_PI * sin(Theta)));
	x = (-1) * ld * M_PI * sin(Theta);
	v = (-1) * ld * M_PI * cos(Theta);
	a = ld * M_PI * M_PI * sin(Theta);

	snprintf(xmessage, 100, "%.2f",x);
	snprintf(vmessage, 100, "%.2f",v);
	snprintf(amessage, 100, "%.2f", a);

	glColor3ub(255, 200, 200);

	PrintText(355, 50, "x:");
	PrintText(375, 50, xmessage);

	PrintText(355, 140, "v:");
	PrintText(375, 140, vmessage);

	PrintText(355, 230, "a:");
	PrintText(375, 230, amessage);
// 変数表示終わり
	if(Time == 0) {
		Time = 360;
	}else{
		Time-=0.08;
	}
	disx += (double)200/4500;
	if(disx > 200) {
		disx = 0;
	}
	// Finish
	glFlush();
	glutSwapBuffers();
}


// Reset Coordinate if occurs Window Resizing
//
void Reshape(int w, int h)
{
	glViewport(0, 0, w, h);
	glMatrixMode(GL_MODELVIEW) ;
	glLoadIdentity();
	gluOrtho2D(0 , w, 0, h);
	glScaled(1, -1, 1);
	glTranslated(0, -h, 0);
	glutReshapeWindow(700, 300); // Window Size Fixing
}

void PrintText(int x, int y, char *s)
{
	int i , l;


	glRasterPos2i(x , y);

	l = strlen(s);


	for (i = 0 ; i < l ; i++)
	{
		glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, s[i]);
	}
}

void Keyboard(unsigned char key, int x, int y)
{
	if ((key == 'q') || (key == 27))
	{
		printf("Finished\n");
		exit(0);
	}
}

// Timer Interrupt
void Timer(int value)
{
	glutPostRedisplay();
	glutTimerFunc(1, Timer, value);
}

Compiler output:
a.cc:4:10: fatal error: GL/glut.h: No such file or directory
    4 | #include <GL/glut.h>
      |          ^~~~~~~~~~~
compilation terminated.