Beautiful blocks

Well, I’m livin’ in a foreign country but I’m bound to cross the line
Beauty walks a razor’s edge, someday I’ll make it mine

— Shelter from the Storm, Bob Dylan

I can’t resist extending the spinning blocks program of the previous page for aesthetic, rather than mathematical, reasons.

Beautiful blocks

In addition to the functionality of the previous program, we can incrementally scale the blocks in size; change their opacity; and animate the amount of rotation around the ring’s axis (that is, position along the ring). Labeling the blocks in order from 0 to n-1, block i rotates at a rate of a + \delta i revolutions per second where \delta=(b-a)/(n-1). Here a and b are given by the rps first and rps last settings, so named because the first and last blocks rotate at these rates. 1

  1. The block labeled 0 is arbitrary. The revolution rates follow an arithmetic progression.