C# 클래스 AForge.Range

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

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:

// 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 ) ) { // ... }
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
Equals ( object obj ) : bool

Check if this instance of Range equal to the specified one.

GetHashCode ( ) : int

Get hash code for this instance.

IsInside ( Range range ) : bool

Check if the specified range is inside of the range.

IsInside ( float x ) : bool

Check if the specified value is inside of the range.

IsOverlapping ( Range range ) : bool

Check if the specified range overlaps with the range.

Range ( float min, float max ) : System

Initializes a new instance of the Range structure.

ToIntRange ( bool provideInnerRange ) : IntRange

Convert the signle precision range to integer range.

If provideInnerRange is set to , then the returned integer range will always fit inside of the current single precision range. If it is set to , then current single precision range will always fit into the returned integer range.

ToString ( ) : string

Get string representation of the class.

operator ( ) : bool

Equality operator - checks if two ranges have equal min/max values.

메소드 상세

Equals() 공개 메소드

Check if this instance of Range equal to the specified one.
public Equals ( object obj ) : bool
obj object Another range to check equalty to.
리턴 bool

GetHashCode() 공개 메소드

Get hash code for this instance.
public GetHashCode ( ) : int
리턴 int

IsInside() 공개 메소드

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

IsInside() 공개 메소드

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

IsOverlapping() 공개 메소드

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

Range() 공개 메소드

Initializes a new instance of the Range structure.
public Range ( float min, float max ) : System
min float Minimum value of the range.
max float Maximum value of the range.
리턴 System

ToIntRange() 공개 메소드

Convert the signle precision range to integer range.
If provideInnerRange is set to , then the returned integer range will always fit inside of the current single precision range. If it is set to , then current single precision range will always fit into the returned integer range.
public ToIntRange ( bool provideInnerRange ) : IntRange
provideInnerRange bool Specifies if inner integer range must be returned or outer range.
리턴 IntRange

ToString() 공개 메소드

Get string representation of the class.
public ToString ( ) : string
리턴 string

operator() 공개 정적인 메소드

Equality operator - checks if two ranges have equal min/max values.
public static operator ( ) : bool
리턴 bool