Visualising Leap Days with Processing

So today is a leap day, right? Well, yes and no. We generally assume the 29th of February is a leap day but in the original Julian calendar the leap day was intercalated on the 24th of February. The aim of the leap day insertion is to keep the computational calendar in sync with the actual movement of the earth and sun. The primary motivation for this being an accurate calculation of the Computus, an algorithm for the correct observance of the date of Easter.

I’ve been playing around with Processing recently and I thought it might be interesting to see what those leap days look like. You can see the results below. Each pixel represents one day, with each line of pixels representing one year. The leap days are shown in red. It was a little thrown together but it shows the patterns and the scale.

The Julian calendar is shown first, beginning in 45BC. It’s leap year rules are pretty simple, one day is inserted (on the 24th of Feb) every four years. This simple pattern holds true for the next 1500 years, but by the middle ages it had become a problem. The calendar had drifted 10 days out of sync with the real rotation of the earth.

The Catholic church instituted a reform to the rules and this became the Gregorian calendar. You’ll see this in the second block. The leap day rules for this are based on the Julian, but with the addition of special cases for centuries and millennia.

The white line represents 2012.

The unusual looking year that spans both calendars is 1582. 10 days were dropped at the point of transition. The Julian calendar concluded on Thursday, 4 October 1582 and was immediately followed by Friday, 15 October 1582, the first day of the Gregorian calendar.

I had some problems embedding the Processing.js version into WordPress so I’ve had to make do with an image. Feel free to download the source below if you want to tinker with it.