# Exploring Epicycles

Some random musings on gears led me down the path of exploring epicycles, the math behind them, and whether they could be used to draw arbitrary shapes. I wrote up my findings and put them together into an interactive demo.

*A demo of the simulator. Click to try it yourself.*

### Origins

In the summer of 2010, I went on a trip with my family to Europe. During some downtime on a train ride, my mind wandered back to a lecture on cardioids from my freshman year calculus class. I remember thinking they were neat at the time, them and the other all the various flowery limaçon curves that could be generated by tracing a point on one circle as is rolls around another.

An idea popped into my head: what if you actually did trace a point on one circle as it rolled around another. As in, you had a machine that had intermeshing gears, and at one point on one of the gears, you affixed a pen or brush, which would trace out the path as the gears rotated. I have always been fascinated by kinetic art, and at the time I was just getting back into mechanical engineering, so I started to explore the concept.

My first thought was, ok, what might be the limits of such a machine? Assuming you had enough gears, what shapes could you draw? I attempted to figure it out at the time, but quickly got bogged down in polar equations, and wasn’t able to make much progress. Every few months, I’d pick up the problem again, trying to determine what sort of shapes one could draw by stacking gears on gears, and how one could determine what gearings to chose to draw a particular shape. I didn’t make headway until the spring of 2012, when, in a Signals and Systems course, I had this eureka moment where I realized I might be able to use Fourier transforms. After some nights wrangling the problem, I found a transformation that worked.

### About the Epicycles Demo

The original idea of the project was to be able to draw shapes using gears - I had figured out the math behind how to do it, and now wanted to try it out. I originally wrote up a simulation in matlab, but then later ported it to the web to make it easier to interact with and share the work with others.

After I wrote the simulator, I wanted to share it with others, but realized without appropriate context about the problem, why it’s interesting, or the math behind it, the simulator alone wasn’t really that interesting. So I wrote it up a little background that gives a very abbreviated version of the discovery process I went through, added plenty of examples, and published it on github at http://brettcvz.github.io/epicycles/. Go take a look!

### Reflections

This is one of those projects that I’ve been kicking around for ages. It feels good to hit this milestone and publish the math and simulator, but there’s still the next step of actually building the machine to bring this idea to life. Given the pace of how often I work on this project and that it’s now almost in 2016, this may end up being a decade-long endeavor between conception and completion. But it’s been a blast - cutting across math, programming, and mechanical design, this is my favorite type of project. Now to figure out how to firmly affix a pen to a rotating wheel...