# Plotting an animated hypocycloid

I want to animate a Hypocycloid using computer code. So far i have drawn the circles here.

I have found this definition on wikipedia and I want to animate the image that is on the right.

I did something similar here with a sine wave. I used a counter and changed the position of the shapes using cos and sin to plot the changing shapes on each change of the counter.

This new graph is infinitely more complicated.

Wikipedia gives the following equations:

$x(\theta) = (R - r) \cos \theta + r \cos((k - 1) \theta)$

$y(\theta) = (R - r) \sin \theta - r \sin((k - 1) \theta)$

I do not know how to solve these equations.

Why is it $x(\theta) =$ and not just $x =$ ?

How do I find $\theta$ when it occurs on both sides of the equation ; besides, I do not understand what $k$ is.

• What is the software you use ? May 31, 2017 at 22:10
• @JeanMarie I use d3.js , the source code for all the charts is here github.com/dagda1/d3-geometry Jun 1, 2017 at 12:52

## 1 Answer

You misunderstand the meaning of $x(\theta)$. The parentheses do not indicate multiplication; they instead indicate that $x$ is a function of the parameter $\theta$. To plot this curve for a given $R$, $r$, and $k$, all you need to do is plug in various values of $\theta$ into each equation on the RHS, and the first equation gives you the $x$-coordinate and the second gives you the $y$-coordinate.

• great, what is k in this instance. May 31, 2017 at 20:52
• @dagda1 $k$ is just another fixed constant, in this case the number of windings. It is related to the symmetry of the resulting figure, so when $k = 5$ for example, you should get a figure with fivefold symmetry. May 31, 2017 at 20:54