Hypotrochoid

r = 2 (slider from 1 to 36, step 1)
θ = 720 (slider from 0 to (360 * p), step 1)
O = Intersect(xAxis, yAxis)
α: (θ / 180 * π)
R = 5 (slider from 1 to 36, step 1)
T = Rotate((R, 0), α, O)
b = Circle(T, r)
n = Ray(O, T)
C = Intersect(b, n, 1)
p = 2 (slider from 1 to 30, step 1)
d = 1 (slider from 1 to 36, step 1)
k: R / r
a = Circle(O, R)
c = Circle(C, T)
c_d = Circle(C, d)
T_d = Intersect(c_d, n, 1)
P = Rotate(T_d, ((-k) * α), C)
r_P = Segment(C, P)
r_T = Segment(C, T)
θ_C = Angle(P, C, T)
f = CurveCartesian(((r * (k - 1)) * cos(t)) + (d * cos(((k - 1) * t))), ((r * (k - 1)) * sin(t)) - (d * sin(((k - 1) * t))), t, 0, α)