Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/hypotrochoid
Plot hypotrochoids for spirographs with JavaScript
https://github.com/hughsk/hypotrochoid
Last synced: 12 days 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 (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-06-18T22:28:13.000Z (over 11 years ago)
- Last Synced: 2024-10-17T16:41:27.036Z (22 days 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.![Hypotrochoid](http://upload.wikimedia.org/wikipedia/commons/f/fa/HypotrochoidOutThreeFifths.gif)