Drawing a nested epicycloid

770 Views Asked by At

I would like to learn how to draw this kind of pictures (possibly with Mathematica, as it is the only language I would be comfortable to code such a thing in):

enter image description here

There is something similar on the Wolfram website, involving nested ipo cycloids, but I would like to see the math involved in setting up the problem, not just the code.

I have no idea what's the most intelligent way to proceed. Can you help me?

1

There are 1 best solutions below

3
On BEST ANSWER

OK, here is how I figure this image was created:

  • Each circle has about $\frac5{16}$ the radius of the next larger one, with the largest one at radius $2$.
  • Each circle rotates at $4$ times the speed as the next larger one, with respect to a fixed reference orientation. It rotates in the opposite direction.

I can see no “physical” connection between these two quantities, which is a huge difference to the case of the epicycloid, where radius and speed match so that you can imagine one circle rolling along the other.

So you can define

\begin{align*} r_0 &= 2 & r_{i+1} &= \frac5{16}r_i = 2\left(\frac5{16}\right)^i\\ v_0 &= 1 & v_{i+1} &= -4v_i = (-4)^i \end{align*}

The center of circle $0$ is at the origin. Each subsequent center rotates around the previous center at a distance which equals the sum of the two corresponding radii, and with a speed which corresponds to the larger circle.

\begin{align*} x_0 &= 0 & x_{i+1} &= x_i - \left(r_i+r_{i+1}\right)\sin(v_it) \\ x_0 &= 0 & y_{i+1} &= y_i + \left(r_i+r_{i+1}\right)\cos(v_it) \end{align*}

Now as you iterate $t$ between $0$ and $2\pi$, the centers will move along, and the centers with high index will be pretty good approximations of the limit case.

Here is what the result looks like, with $100{,}000$ points and $10$ levels of recursion. The circles are drawn for $t=0.4$ (not $0.4\pi$). I did this in Sage, but given the description above, you should be able to translate this to Mathematica.

Figure

And if you wanted to animate this, here is how it should look like, in my opinion:

Animation