These shapes are generated by tracing the sum of 2 vectors with different lengths rotating in opposite directions at different frequencies. I am trying to obtain these images using only fragment shaders, so I am unable to record each location of the sum as the vectors rotate.
Rotating vector function of $\theta$ (angle) and $\ell$ (length)
$$\theta = [0, 2\pi]$$
$$ \vec{R}\left(\theta, \ell\right)= \begin{bmatrix} \ell \cos{\theta} \\ \ell \sin{\theta} \end{bmatrix} $$
Two vectors rotating at different frequencies, $f$ $$ \vec{a} = \vec{R}\left(f\theta, 1\right) \quad f=1 $$ $$ \vec{b} = \vec{R}\left(f\theta, \frac{1}{2}\right) \quad f=-3 $$
The line is traced at $\vec{c}$ $$ \vec{c} = \vec{a} + \vec{b} $$
This process resembles figures produced by a Spirograph, which requires $\vec{c}$ to be recorded for every value of $\theta$.
One way to obtain these shapes with fragment shaders is to recycle the output of the buffer, tracing the shape over time. My goal is to be able to generate these shapes in parallel, without having to reuse any frame-buffers. I have been trying to find a method to compose a distance field that would produce a similar pattern, when intersected with a plane.
The function $f(x,y)=\sqrt{x^2 + y^2}$ plots the distance from $(x,y)$ to the origin. How may I find a function $f(x,y)$ which is the distance between $(x,y)$, and the nearest point that $\vec{c}$ may pass through?
If there is a better method to achieve this please let me know!

