RangeD

Description

struct Tinman.Core.Math.RangeD

A closed interval of numbers (64-bit floating-point): [Start..End]

 +----+----+----+----O----+----+----+----+--->  Number axis
-4   -3   -2   -1    0    1    2    3    4
      ^                   ^
      Start               End
      \___________________/
       Length := End - Start

Public / Constants

Inv


public static readonly attribute Inv → (RangeD)

The value of Max, with swapped start and end values.

This range can be used as the initial value for finding the minimum/maximum of a series of numbers (see Grow).

Max


public static readonly attribute Max → (RangeD)

A range that contains all 64-bit floating-point values.

Pos


public static readonly attribute Pos → (RangeD)

A range that contains all positive 64-bit floating-point values.

Unit


public static readonly attribute Unit → (RangeD)

The unit interval: [0..1].

Zero


public static readonly attribute Zero → (RangeD)

A range at offset zero with zero length.

Public / Constructors

Closed


[Pure]
public static method Closed → (2)

in : float64

Left value of interval.

in : float64

Right value of interval.

returns → RangeD

The range value.

Returns a range that represents the closed interval [a..b] (i.e. both a and b are contained in the range).

From


[Pure]
public static method From → (1)

in : float64

The range start value.

returns → RangeD

The range value.

Returns a range that contains all values greater than or equal to in.

Of

3 overloads


[Pure]
public static method Of1 → (1)

in : float64

The value to contain.

returns → RangeD

The range value.

Returns the shortest possible range that contains the given value.


[Pure]
public static method Of2 → (2)

in : float64

First value to contain.

in : float64

Second value to contain.

returns → RangeD

The range value.

Returns the shortest possible range that contains the given values.


[Pure]
public static method Of3 → (3)

in : float64

First value to contain.

in : float64

Second value to contain.

in : float64

Third value to contain.

returns → RangeD

The range value.

Returns the shortest possible range that contains the given values.

To


[Pure]
public static method To → (1)

in : float64

The range end value.

returns → RangeD

The range value.

Returns a range that contains all values less than or equal to in.

Public / Attributes

End


public readonly attribute End → (float64)

End of number range (inclusive).

Mid


public attribute Mid → (get)

value : float64

The mid value, defines as (Start + End) / 2.

Returns the mid value of this number range.

Start


public readonly attribute Start → (float64)

Start of number range (inclusive).

Serialization

Serializer


public static readonly attribute Serializer → (ITypeSerializer<RangeD>)

The serialization helper object for values of RangeD.