DRM Time Tables

https://github.com/maj0ran/drm-timetables

Another small project using Linux’s method of direct rendering. The name Time Tables is a bit confusing, and I think it is best explained by a YouTube video you can find when searching for Mathologer Time Tables. The basic gist is that you draw a circle with N equidistant points on its perimeter. The points are enumerated from 1 to N and the whole circle gets a time number T. For each point pn, you draw a line to the point you get by (n × T) mod N.

For example, you have a circle with 10 points and T = 2. You’ll then have lines connecting p1 to p2, from p2 to p4, from p3 to p6 … p7 to p4, and so on.

You can now use a circle with several hundred points and increase the value of T in small steps – say 0.01 – to get an aesthetically pleasing animation as a result.

This project is built in C and writes straight to the display buffer via the DRM kernel module. Lines and circles are rendered using Bresenham’s algorithms.