This piece is elegant and compact. The core of the code is a single equation which has some strong conceptual effects. I'm curious how Martin developed the equation -- is the process an exploratory one, probing the coefficients and structure of the equation, or is it completely pre-planned. Was the behavior a surprise, a confirmation or combination? Looking purely at the code, I couldn't immediately predict the behavior of the equation until I saw it at work. Maybe I should have thought about it longer and tried to draw some graphs first.
Martin Wattenberg: As for Scott's question about how I developed the key equation in my program... I wanted to "connect" the three points without explicitly drawing lines, so I started thinking about equations that would implicitly describe those connections. The first thing I played with was pretty close to what's in there now -- a polynomial whose zeros form the three lines defined by the pairs of points. Integer overflow unexpectedly messed up my original equation, but after playing some more I realized I could control the effect and even use it to explore the transition between simplicity and complexity. So it was a combination of surprise and confirmation. I'd also add that I strongly wanted to make the code as short as possible, and that several decisions were influenced by that desire. In this exercise I felt like I was writing a constrained form of poetry like a sonnet or haiku.
The effect of the code is striking -- at certain scales there is just the pure white triangle and grey echoes out of its edges. At other scales, macroscopic moire patterns enter from the sides. Moire patterns normally appear at the microscopic scale -- the level where the resolution of the display collides against the resolution of the model. Seeing the moires large turns the phenomenon inside-out -- deliberately referencing a common artifact and magnifying it to the extraordinary.
The manner in which the piece dissolves with change, rather than immediately updates is another inversion. Computer graphics tends to mimic cinema in the frame-by-frame progression of one image to another. This digital dissolve breaks free of the cinematic and moves more towards the perceptual -- as in the physical world, reality is constructed in small bits rather than large chunks.
Martin's piece is as engrossing as his code is terse.
A true haiku of the medium, just as he hoped: economical, elegant, taut.
I have taken the liberty of "instrumenting" your program with the calls necessary for my program (CodeProfiler) to profile them. Click here.
This is my way of commenting on your code, per our charter.
Martin Wattenberg: I decided the most natural way to comment on Brad's profiler was to profile it by creating a remix. He did a pretty amazing job of showing the sequential movement and rhythm of the execution point... so I tried to show the opposite in my remix, exploring the parallel operations happening at any given moment.
Super-tight code, it's remarkable how much can occur with a bare minimum of instructions. It's interesting to note that the majority of Java coders -- Mark, Martin, Scott, and Camille (though in C) -- all created visually driven work; they approached the task of connecting three points purely in a graphic sense. Yet within that confine, each produced a distinct variation on the theme.