Setup

a = 1 (slider from 1 to 10, step 1)
b = 20 (slider from 1 to 20, step 1)
n = 20 (slider from 1 to 20, step 1)
R(x, y, z, w) = x + (1 / y * tanh((y * sin((z * w)))))
phase = 1.76 (slider from 0 to 6.28, step 0.01)
gear2 = CurveCartesian((R((2 * a), b, (2 * n), t) * cos(t - phase / 2)) + 3, (R((2 * a), b, (2 * n), t) * sin(t - phase / 2)), t, 0, (2 * π))
gear = CurveCartesian((R(a, b, n, t) * cos(t + phase)), (R(a, b, n, t) * sin(t + phase)), t, 0, (2 * π))