A
closed
interval
of
numbers
(32-bit
floating-point):
[Start..End]
struct
|
RangeF
|
implements
|
IEquatable<RangeF>
|
+----+----+----+----+----+----+----+----+---> Number axis -4 -3 -2 -1 0 1 2 3 4 ^ ^ Start End \___________________/ Length := End - Start
The serialization helper object for values of RangeF.
public
static
readonly
field
|
Serializer
|
||
type
|
ITypeSerializer<RangeF>
|
The value of Max, with swapped start and end values.
public
static
readonly
field
|
Inv
|
||
type
|
RangeF
|
Remarks:
This
range
can
be
used
as
the
initial
value
for
finding
the
minimum/maximum
of
a
series
of
numbers
(see
Grow
).
A range that contains all 64-bit floating-point values.
public
static
readonly
field
|
Max
|
||
type
|
RangeF
|
The
unit
interval:
[0..1]
.
public
static
readonly
field
|
Unit
|
||
type
|
RangeF
|
A range at offset zero with zero length.
public
static
readonly
field
|
Zero
|
||
type
|
RangeF
|
End of number range (inclusive).
public
readonly
field
|
End
|
||
type
|
float32
|
Is this number range empty?
public
property
|
IsEmpty
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
range
is
empty,
false
if
it
is
not. |
Length of this number range.
public
property
|
Length
{
get
}
|
||
type
|
float32
|
||
value
|
The range length. |
Start of number range (inclusive).
public
readonly
field
|
Start
|
||
type
|
float32
|
Returns
a
range
that
represents
the
closed
interval
[a..b]
(i.e.
both
a
and
b
are
contained
in
the
range).
[Pure]
|
||||
public
static
method
|
Closed
(float32 a,
float32 b)
|
|||
type
|
RangeF
|
|||
params
|
a
|
Left value of interval. | ||
b
|
Right value of interval. | |||
returns
|
The range value. |
Returns the shortest possible range that contains the given value.
[Pure]
|
||||
public
static
method
|
Of
(float32 a)
|
|||
type
|
RangeF
|
|||
params
|
a
|
The value to contains. | ||
returns
|
The range value. |
Returns the shortest possible range that contains the given values.
[Pure]
|
||||
public
static
method
|
Of
(float32 a,
float32 b)
|
|||
type
|
RangeF
|
|||
params
|
a
|
First value to contains. | ||
b
|
Second value to contains. | |||
returns
|
The range value. |
Returns the shortest possible range that contains the given values.
[Pure]
|
||||
public
static
method
|
Of
(float32 a,
float32 b,
float32 c)
|
|||
type
|
RangeF
|
|||
params
|
a
|
First value to contains. | ||
b
|
Second value to contains. | |||
c
|
Third value to contains. | |||
returns
|
The range value. |
Clamps the given value to this range.
[Pure]
|
||||
public
method
|
Clamp
(float32 value)
|
|||
type
|
float32
|
|||
params
|
value
|
The value to clamp. | ||
returns
|
The clamped value. |
Checks if this range contains the given value.
[Pure]
|
||||
public
method
|
Contains
(float32 value)
|
|||
type
|
bool
|
|||
params
|
value
|
The value. | ||
returns
|
true
if
value
is
contained
in
this
range,
false
if
not.
|
Checks if this range fully contains the given range.
[Pure]
|
||||
public
method
|
Contains
(RangeF range)
|
|||
type
|
bool
|
|||
params
|
range
|
The range. | ||
returns
|
true
if
range
is
fully
contained
in
this
range,
false
if
not.
|
public
method
|
Equals
(RangeF other)
|
||
type
|
bool
|
||
params
|
other
|
Grows this range so that it contains the given value.
[Pure]
|
||||
public
method
|
Grow
(float32 value)
|
|||
type
|
RangeF
|
|||
params
|
value
|
The value. | ||
returns
|
The resulting range. |
Grows this range so that it fully contains the given range.
[Pure]
|
||||
public
method
|
Grow
(RangeF range)
|
|||
type
|
RangeF
|
|||
params
|
range
|
The range. | ||
returns
|
The resulting range. |
Intersects this range with the given one.
[Pure]
|
||||
public
method
|
Intersection
(RangeF other)
|
|||
type
|
RangeF
|
|||
params
|
other
|
The other range. | ||
returns
|
The resulting range. |
Checks if this range intersects with the given one.
[Pure]
|
||||
public
method
|
Intersects
(RangeF other)
|
|||
type
|
bool
|
|||
params
|
other
|
The other range. | ||
returns
|
true
if
both
ranges
intersect,
false
if
not. |
Scales this range.
[Pure]
|
||||
public
method
|
Scale
(float32 factor)
|
|||
type
|
RangeF
|
|||
params
|
factor
|
[>0]
|
The scale factor. | |
returns
|
The scaled range. |
public
override
method
|
ToString
()
|
||
type
|
string
|
Transforms the given value from this range to the given range.
[Pure]
|
||||
public
method
|
Transform
(float32 value,
RangeF target)
|
|||
type
|
float32
|
|||
params
|
value
|
The value to transform. | ||
target
|
The target range. | |||
returns
|
The transformed value. |
Remarks:
The
method
maps
Start
to
target.
RangeF
and
End
to
target.
RangeF.
No
clamping
is
performed
by
this
method.