Skip to content
Determine if a point is inside of a periodic hole.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
config
dist
src
test
.gitignore
.jshintrc
.travis.yml
LICENSE
README.md
bower.json
gulpfile.js
package.json

README.md

within-periodic-hole.js

Travis build status Code Climate Test Coverage Dependency Status devDependency Status

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 hole

To define the hole in the above example, the following definition would be used:

{
  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.

Something went wrong with that request. Please try again.