Search Results for

    Show / Hide Table of Contents

    Class Interval

    Represents an (1-dimensional) closed interval on the Real number line.

    Inheritance
    object
    Interval
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Index.Bintree
    Assembly: NetTopologySuite.dll
    Syntax
    [Serializable]
    public class Interval

    Constructors

    | Edit this page View Source

    Interval()

    Creates a new interval instance, setting Min=Max=0d;

    Declaration
    public Interval()
    | Edit this page View Source

    Interval(Interval)

    Creates a new interval instance, setting Min=interval.Min.Min and Max=interval.Max.Max.

    Declaration
    public Interval(Interval interval)
    Parameters
    Type Name Description
    Interval interval
    | Edit this page View Source

    Interval(double, double)

    Creates a new interval instance, setting Min=min and Max=max;

    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 Source

    Centre

    Gets the centre of the interval (Min + Width * 0.5d)

    Declaration
    public double Centre { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    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
    | Edit this page View Source

    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
    | Edit this page View Source

    Width

    Gets the width of the interval (Max - Min)

    Declaration
    public double Width { get; }
    Property Value
    Type Description
    double

    Methods

    | Edit this page View Source

    Contains(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

    true if this interval contains interval

    Remarks

    This is more rigid than Overlaps(Interval)

    | Edit this page View Source

    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

    true if this interval contains the value p

    | Edit this page View Source

    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

    true if this interval contains the interval R[min, max]

    Remarks

    This is more rigid than Overlaps(double, double)

    | Edit this page View Source

    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.

    | Edit this page View Source

    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

    | Edit this page View Source

    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

    true if this interval overlaps interval

    | Edit this page View Source

    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

    true if this interval overlaps the interval R[min, max]

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX