I have the following parametrization of a flower curve:
$\theta \mapsto [(R+r\cos(6\pi\theta))\cos(2\pi \theta), (R+r\cos(6\pi \theta))\sin(2\pi \theta)]$
I'd like to know a level set $\phi(x,y)$ such that $\phi(x,y)=0$ associated to this curve.
Basically, I know that the map above is a parametrisation of my curve $\gamma$. However, I need a level set description of it, so I'm looking for a $\phi(x,y)$ such that the level set $\{ \phi =0 \}$ is $\gamma$.
Start with
$$ \begin{align*} x &= (R + r \cos(6 \pi \theta)) \cos(2 \pi \theta) \\ y &= (R + r \cos(6 \pi \theta)) \sin(2 \pi \theta) \end{align*} $$
And we want an equation involving $x,y,r,R$ but eliminating $r$ and $\theta$. There's no general approach for that, but let's see what we can get from these.
$$ \begin{align*} \sqrt{x^2+y^2} &= R + r \cos(6\pi\theta) \\ \frac{x}{\sqrt{x^2+y^2}} &= \cos(2\pi\theta) \\ \frac{y}{\sqrt{x^2+y^2}} &= \sin(2\pi\theta) \\ \cos(6\pi \theta) &= \cos^3(2\pi\theta) - 3 \cos(2\pi\theta)\sin^2(2\pi\theta) \\ \cos(6\pi\theta) &= (x^3-3xy^2)(x^2+y^2)^{-3/2} \\ \sqrt{x^2+y^2} &= R + r(x^3-3xy^2)(x^2+y^2)^{-3/2} \end{align*} $$
So one solution is
$$ \phi(x,y) = \sqrt{x^2+y^2} - r(x^3-3xy^2)(x^2+y^2)^{-3/2} - R $$
$\phi$ could also be multiplied by any function which is never zero.