ClosedInterval

A ClosedInterval represents a closed interval [start, end].

Constructor

new ClosedInterval(start, end)

Creates a new Interval from a start and end value.

Parameters:
NameTypeDescription
startnumber

The start of the interval.

endnumber

The end of the interval.

Classes

ClosedInterval

Members

end

Returns the end of the interval.

length

Returns the length of the interval.

start

Returns the start of the interval.

Methods

contains(number) → {boolean}

Checks if a number is contained within the interval.

Parameters:
NameTypeDescription
numbernumber

The number to check if it is contained.

Returns:

Whether the number is contained within the interval.

Type: 
boolean

midpoint() → {number}

Returns the midpoint of the interval.

Returns:

The midpoint of the interval.

Type: 
number

sample(num_points) → {Float32Array}

Samples the interval at a given number of points.

Parameters:
NameTypeDescription
num_pointsnumber

The number of points to sample.

Returns:

The sampled points of the interval.

Type: 
Float32Array