So I've been working on a game for three months -some kind of air hockey- and players play in fields with various shapes in a two-dimensional plane. Recently, I wanted to make one of these fields looking like an epicycloid, the one with four "petals".
.
When I create a field, I have to get its shape's parametric equation to draw it, and its shape's cartesian equation for everything about the game's physics.
By definition, an epicycloid is a plane curve produced by tracing the path of a chosen point on the circumference of a circle which rolls without slipping around a fixed circle.
The parametric representation of an epicycloid centered in $A(a, b)$, with the static circle of radius $R$ and the moving one of radius $r$ is :
$$x = a + m\left((R + r)\cos(t) - r\cos\left(\frac {R + r}{r}t\right)\right)$$ $$y = b + m\left((R + r)\sin(t) - r\sin\left(\frac {R + r}{r}t\right)\right)$$ where $m$ is a constant. According to the value of $\frac{R}{r}$, we have $\frac{R}{r}$ "petals".
Using this, I can draw the field, but I couldn't find a cartesian equation for a "four petal" epicycloid, so I can't work on the field's physics. Can anyone help me find a cartesian equation ?