Represents a range with minimum and maximum values, which are single precision numbers (floats).

Namespace:  AForge
Assembly:  AForge (in AForge.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
[SerializableAttribute]
public struct Range

Remarks

The class represents a single precision range with inclusive limits - both minimum and maximum values of the range are included into it. Mathematical notation of such range is [min, max].

Sample usage:

CopyC#
// create [0.25, 1.5] range
Range range1 = new Range( 0.25f, 1.5f );
// create [1.00, 2.25] range
Range range2 = new Range( 1.00f, 2.25f );
// check if values is inside of the first range
if ( range1.IsInside( 0.75f ) )
{
    // ...
}
// check if the second range is inside of the first range
if ( range1.IsInside( range2 ) )
{
    // ...
}
// check if two ranges overlap
if ( range1.IsOverlapping( range2 ) )
{
    // ...
}

See Also