## Friday, August 4, 2017

### This puts the hurt on my eyeballs...

This puts the hurt on my eyeballs...  It's one of the most remarkable optical illusions I've ever seen.  That “spiral” you see at right isn't a spiral at all!  It's a series of concentric circles.  Really!  Trace them out to prove it to yourself!

Excellent little article here explaining the phenomenon.

Sometime back in the Paleozoic Era (circa 1979), I built a device to help a scientist measure spatial resolution in people, at various contrast ratios.  The display of this device was a bunch of vertical bars whose brightness was proportional to the sine of their horizontal position on the screen.  These bars were very similar to the patches described in that linked article.  The device was challenging to build at a low cost back in those days.  Micro computers were nowhere near fast enough to generate the sinusoidal wave in real time, and memory was far too expensive to do what would be obvious today: make a pure graphics display and compute the brightness for each pixel.  So I ended up with a compromise design.  First, by displaying only vertical bars (and physically rotating the display for other orientations) I had the advantage of having the exact same brightness pattern on every raster line.  That meant I needed only enough memory to store the brightness for a single line, and that turned out to be 1k bytes.  I just used the same values in memory for every raster line.  Then instead of computing the sine for every pixel in that memory, I estimated it with a linear interpolation between two points 5 degrees apart.  I further reduced the computation required by using the fact that each quadrant (90 degrees) of the sine is a mirror of the others, so by computing one sine I got three more for only the cost of a few additions and subtractions.  By doing all this I was able to have that device load a new set of values for the display in under a second – which sounds very slow by today's standards, but back then was quite zippy.  It was a good example of the sorts of “tricks” engineers routinely resorted to back then to accommodate the wimpy processors available then.