Roll a small circle of radius r, without slipping, around the inside of a fixed larger circle of radius R, and track where a point at distance d from the small circle's centre goes. That path is called a hypotrochoid, given exactly by x = (R−r)cos t + d·cos((R−r)/r · t) and y = (R−r)sin t − d·sin((R−r)/r · t).
The ratio of R to r sets the number of "petals." A larger greatest common divisor closes the pattern sooner; ratios closer to coprime need many more revolutions before the curve closes, producing a denser pattern. The physical toy realises this no-slip rolling with interlocking gears; this demo just computes the same curve directly and animates it as if a pen were drawing it.
It's used for pattern design, watermark and security motifs (the intricate guilloché curves on banknotes are a close relative of the same idea), and decorative logo backgrounds.
When to use
Use it for decorative patterns and watermark/motif design. Vary the R, r, d ratio to change petal count and density completely.