GeomeGeome
Home
API
GitHub
Home
API
GitHub
  • Range

geome v0.2.0


geome / Range

Range

Functions for manipulating ranges.

Generators

of()

of(a, b): Range

Defined in: Range.ts:19

Creates a range from two given values.

Parameters

ParameterTypeDescription
anumberThe first value of the range.
bnumberThe second value of the range.

Returns

Range

The created range.

Properties

center()

center(range): number

Defined in: Range.ts:63

Get the center of the given range.

Parameters

ParameterTypeDescription
rangeRangeThe range to get the center of.

Returns

number

The center of the range.


max()

max(range): number

Defined in: Range.ts:41

Get the maximum value of the given range.

Parameters

ParameterTypeDescription
rangeRangeThe range to get the maximum value of.

Returns

number

The maximum value of the range.


min()

min(range): number

Defined in: Range.ts:30

Get the minimum value of the given range.

Parameters

ParameterTypeDescription
rangeRangeThe range to get the minimum value of.

Returns

number

The minimum value of the range.


span()

span(range): number

Defined in: Range.ts:52

Get the span of the given range.

Parameters

ParameterTypeDescription
rangeRangeThe range to get the span of.

Returns

number

The span of the range.

Functions

offset()

offset(range, offset): Range

Defined in: Range.ts:74

Offset the given range by the given offset.

Parameters

ParameterTypeDescription
rangeRangeThe range to offset.
offsetnumberThe offset to apply.

Returns

Range

The offset range.


scale()

scale(range, scale, origin): Range

Defined in: Range.ts:86

Scale the given range by the given scale factor and origin. If no center is provided, the origin will be zero.

Parameters

ParameterTypeDefault valueDescription
rangeRangeundefinedThe range to scale.
scalenumberundefinedThe scale factor.
originnumber0The center of the range to scale around.

Returns

Range

The scaled range.

Edit this page