https://github.com/hughsk/hypotrochoid
Plot hypotrochoids for spirographs with JavaScript
https://github.com/hughsk/hypotrochoid
Last synced: 3 months ago
JSON representation
Plot hypotrochoids for spirographs with JavaScript
- Host: GitHub
- URL: https://github.com/hughsk/hypotrochoid
- Owner: hughsk
- Created: 2013-05-11T05:08:05.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-06-18T22:28:13.000Z (almost 12 years ago)
- Last Synced: 2025-02-28T09:21:59.009Z (4 months ago)
- Language: JavaScript
- Homepage: http://hughsk.github.io/hypotrochoid/
- Size: 121 KB
- Stars: 23
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hypotrochoid #
Returns points across one or more
[hypotrochoids](http://en.wikipedia.org/wiki/Hypotrochoid) for varying values
of `t`.Trivia: you can trace out curves like this using a
[spirograph](http://en.wikipedia.org/wiki/Spirograph), yielding similar
results to Guilloché machines - which were used to create intricate patterns
[resistant to counterfeiting](http://en.wikipedia.org/wiki/Guilloch%C3%A9#In_today.E2.80.99s_terminology).[check out the demo](http://hughsk.github.io/hypotrochoid)
## Installation ##
``` bash
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.