There's a one-line formula that is supposed to capture most of these motions. https://en.wikipedia.org/wiki/Hypotrochoid
What always struck me as interesting is how some of them 'seem' like they're a projection of a surface onto the plane.
Edit: In fact, it would be nice to see a 3d version where the z-axis is the angle of incidence between gears (taking one as reference).
Especially in crazier patterns with gears that are not perfect circles. Too sad this is far in the past: https://www.kickstarter.com/projects/465068187/wild-gears-20...
Note: in the starting position when you open the page, fixed 96, rotating 52. 13 revolutions for the curve to close. 52=4x13=gcd(52,96)x13