Class Interval
Represents an (1-dimensional) closed interval on the Real number line.
Inherited Members
Namespace: NetTopologySuite.Index.Bintree
Assembly: NetTopologySuite.dll
Syntax
[Serializable]
public class Interval
Constructors
| Edit this page View SourceInterval()
Declaration
public Interval()
Interval(Interval)
Declaration
public Interval(Interval interval)
Parameters
| Type | Name | Description |
|---|---|---|
| Interval | interval |
Interval(double, double)
Declaration
public Interval(double min, double max)
Parameters
| Type | Name | Description |
|---|---|---|
| double | min | The minimum value |
| double | max | The maximum value |
Properties
| Edit this page View SourceCentre
Declaration
public double Centre { get; }
Property Value
| Type | Description |
|---|---|
| double |
Max
Gets or sets a value indicating the maximum value of the closed interval.
Declaration
public double Max { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Min
Gets or sets a value indicating the minimum value of the closed interval.
Declaration
public double Min { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Width
Declaration
public double Width { get; }
Property Value
| Type | Description |
|---|---|
| double |
Methods
| Edit this page View SourceContains(Interval)
Function to test if this Interval contains interval.
Declaration
public bool Contains(Interval interval)
Parameters
| Type | Name | Description |
|---|---|---|
| Interval | interval | The interval to test |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
This is more rigid than Overlaps(Interval)
Contains(double)
Function to test if this Interval contains the value p.
Declaration
public bool Contains(double p)
Parameters
| Type | Name | Description |
|---|---|---|
| double | p | The value to test |
Returns
| Type | Description |
|---|---|
| bool |
|
Contains(double, double)
Function to test if this Interval contains the interval R[min, max].
Declaration
public bool Contains(double min, double max)
Parameters
| Type | Name | Description |
|---|---|---|
| double | min | The mimimum value of the interval |
| double | max | The maximum value of the interval |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
This is more rigid than Overlaps(double, double)
ExpandToInclude(Interval)
Method to expand this interval to contain interval.
Declaration
public void ExpandToInclude(Interval interval)
Parameters
| Type | Name | Description |
|---|---|---|
| Interval | interval | The interval to contain. |
Init(double, double)
Method to initialize the interval with the given min and max values.
If max < min, their values are exchanged.
Declaration
public void Init(double min, double max)
Parameters
| Type | Name | Description |
|---|---|---|
| double | min | The minimum value |
| double | max | The maximum value |
Overlaps(Interval)
Function to test if this Interval overlaps interval.
Declaration
public bool Overlaps(Interval interval)
Parameters
| Type | Name | Description |
|---|---|---|
| Interval | interval | The interval to test |
Returns
| Type | Description |
|---|---|
| bool |
|
Overlaps(double, double)
Function to test if this Interval overlaps the interval R[min, max].
Declaration
public bool Overlaps(double min, double max)
Parameters
| Type | Name | Description |
|---|---|---|
| double | min | The mimimum value of the interval |
| double | max | The maximum value of the interval |
Returns
| Type | Description |
|---|---|
| bool |
|