Represents a double range with minimum and maximum values.

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

Syntax

C#
[SerializableAttribute]
public struct DoubleRange

Remarks

The class represents a double 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
DoubleRange range1 = new DoubleRange( 0.25, 1.5 );
// create [1.00, 2.25] range
DoubleRange range2 = new DoubleRange( 1.00, 2.25 );
// check if values is inside of the first range
if ( range1.IsInside( 0.75 ) )
{
    // ...
}
// 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