C# Class AForge.DoubleRange

Represents a double range with minimum and maximum values.

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:

// 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 ) ) { // ... }
Show file Open project: atosorigin/Kinect Class Usage Examples

Public Methods

Method Description
DoubleRange ( double min, double max )

Initializes a new instance of the DoubleRange class.

IsInside ( DoubleRange range ) : bool

Check if the specified range is inside of the range.

IsInside ( double x ) : bool

Check if the specified value is inside of the range.

IsOverlapping ( DoubleRange range ) : bool

Check if the specified range overlaps with the range.

Method Details

DoubleRange() public method

Initializes a new instance of the DoubleRange class.
public DoubleRange ( double min, double max )
min double Minimum value of the range.
max double Maximum value of the range.

IsInside() public method

Check if the specified range is inside of the range.
public IsInside ( DoubleRange range ) : bool
range DoubleRange Range to check.
return bool

IsInside() public method

Check if the specified value is inside of the range.
public IsInside ( double x ) : bool
x double Value to check.
return bool

IsOverlapping() public method

Check if the specified range overlaps with the range.
public IsOverlapping ( DoubleRange range ) : bool
range DoubleRange Range to check for overlapping.
return bool