Square Circle Spiral Illusion in d3.js

Things have been pretty intense at work the last couple weeks, we are writing hella code (you can see I’ve begun acclimating to the west coast) and a lucky few people have begun using what we’re making! This weekend was a much needed break from programming all day, so what did I do? Code all night.

What you see here is the square circle spiral optical illusion first made popular on the internets by a Dr. Richard Wiseman. What I’ve done is implemented the illusion using d3.js, a powerful javascript library for data visualization. I took it a step further and animated it.

You can get the code for the original illusion as well as a live demo. Here is the code for the animated version and a standalone demo here. Feel free to fork and come up with your own variations. Hint: there are several variables we can play with, and a little phase shift is all it takes ;)

One thought on “Square Circle Spiral Illusion in d3.js

Leave a Reply

Your email address will not be published. Required fields are marked *