node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »



Returns points across one or more hypotrochoids for varying values of t.

Trivia: you can trace out curves like this using a spirograph, yielding similar results to Guilloché machines - which were used to create intricate patterns resistant to counterfeiting.

check out the demo


npm install hypotrochoid


hypotrochoid(distance, radii, t, [result])

  • distance is the distance of each point from the interior circle(s).
  • radii is an array of circle radii - use two elements for a simple hypotrochoid. Three or more will sum the results for each adjacent pair of elements.
  • t the point across the curve.
  • result is an array you can use to output the X/Y position to - otherwise, a new array will be created and returned.