1.0.0 • Published 9 years ago

within-periodic-hole v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

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.