Plot hypotrochoids for spirographs with JavaScript
JavaScript
Switch branches/tags
Nothing to show
Latest commit 1999a87 Jun 18, 2013 @hughsk Undulate by default
Permalink
Failed to load latest commit information.
vendor
.gitignore
README.md
demo.js
index.html
index.js
package.json

README.md

hypotrochoid

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

Installation

npm install hypotrochoid

Usage

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.

Hypotrochoid