Constructor
new ClosedInterval(start, end)
Creates a new Interval from a start and end value.
Parameters:
Name | Type | Description |
---|---|---|
start | number | The start of the interval. |
end | number | The end of the interval. |
- Source
Classes
Members
end
Returns the end of the interval.
- Source
length
Returns the length of the interval.
- Source
start
Returns the start of the interval.
- Source
Methods
contains(number) → {boolean}
Checks if a number is contained within the interval.
Parameters:
Name | Type | Description |
---|---|---|
number | number | The number to check if it is contained. |
- Source
Returns:
Whether the number is contained within the interval.
- Type:
- boolean
midpoint() → {number}
Returns the midpoint of the interval.
- Source
Returns:
The midpoint of the interval.
- Type:
- number
sample(num_points) → {Float32Array}
Samples the interval at a given number of points.
Parameters:
Name | Type | Description |
---|---|---|
num_points | number | The number of points to sample. |
- Source
Returns:
The sampled points of the interval.
- Type:
- Float32Array