https://github.com/jamesplease/within-periodic-hole.js
Determine if a point is inside of a periodic hole.
https://github.com/jamesplease/within-periodic-hole.js
Last synced: 3 months ago
JSON representation
Determine if a point is inside of a periodic hole.
- Host: GitHub
- URL: https://github.com/jamesplease/within-periodic-hole.js
- Owner: jamesplease
- License: mit
- Created: 2015-01-30T04:43:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-03T18:50:12.000Z (over 10 years ago)
- Last Synced: 2025-03-12T17:16:46.744Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 238 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# within-periodic-hole.js
[](https://travis-ci.org/jmeas/within-periodic-hole.js)
[](https://codeclimate.com/github/jmeas/within-periodic-hole.js)
[](https://codeclimate.com/github/jmeas/within-periodic-hole.js)
[](https://david-dm.org/jmeas/within-periodic-hole.js)
[](https://david-dm.org/jmeas/within-periodic-hole.js#info=devDependencies)Determine if a point is inside of a periodic hole.
### Terminology
A hole is a piece of a function that does not exist. Consider the following function:
`0 1 2 _ _ _ 6 7 8 _ _ _ 12 13 14`
This is a function with a hole of length 3 and period 3.
A periodic hole is defined by three properties:
- `length` - The length of the hole
- `period` - How often the hole repeats itself
- `startValue` - A value that marks the (inclusive) start of a holeTo define the hole in the above example, the following definition would be used:
```js
{
length: 3,
period: 3,
startValue: 3
}
```### API
##### `withinPeriodicHole(point, holeDefinition)`
Returns a Boolean indicating whether the point is in the periodic hole defined by `holeDefinition`.