Search Results for

    Show / Hide Table of Contents

    Struct Interval

    Structure for a closed 1-dimensional ℝ-interval

    Implements
    IEquatable<Interval>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: NetTopologySuite.DataStructures
    Assembly: NetTopologySuite.dll
    Syntax
    [Serializable]
    public struct Interval : IEquatable<Interval>

    Fields

    | Edit this page View Source

    Max

    The upper bound of the interval

    Declaration
    public double Max
    Field Value
    Type Description
    double
    | Edit this page View Source

    Min

    The lower bound of the interval

    Declaration
    public readonly double Min
    Field Value
    Type Description
    double

    Properties

    | Edit this page View Source

    Centre

    Gets a value indicating the centre of the interval (Min + Width * 0.5)

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

    Width

    Gets a value indicating the width of the Interval

    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 ℝ[min, max].

    Declaration
    public bool Contains(double min, double max)
    Parameters
    Type Name Description
    double min

    The minimum value of the interval

    double max

    The maximum value of the interval

    Returns
    Type Description
    bool

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

    Remarks

    This is more rigid than Overlaps(double, double)

    | Edit this page View Source

    Create()

    Creates an empty or uninitialized Interval

    Declaration
    public static Interval Create()
    Returns
    Type Description
    Interval

    An empty or uninitialized Interval

    | Edit this page View Source

    Create(Interval)

    Creates an interval with the range ℝ[Min,Max].

    Declaration
    public static Interval Create(Interval interval)
    Parameters
    Type Name Description
    Interval interval

    The template interval

    Returns
    Type Description
    Interval

    An Interval

    | Edit this page View Source

    Create(double)

    Creates an interval with the range ℝ[value,value]

    Declaration
    public static Interval Create(double value)
    Parameters
    Type Name Description
    double value

    The value

    Returns
    Type Description
    Interval

    An Interval

    | Edit this page View Source

    Create(double, double)

    Creates an interval with the range ℝ[val1,val2].
    If necessary, val1 and val2 are exchanged.

    Declaration
    public static Interval Create(double val1, double val2)
    Parameters
    Type Name Description
    double val1

    The minimum value

    double val2

    The maximum value

    Returns
    Type Description
    Interval

    An Interval

    | Edit this page View Source

    Equals(Interval)

    Declaration
    public bool Equals(Interval other)
    Parameters
    Type Name Description
    Interval other
    Returns
    Type Description
    bool
    | Edit this page View Source

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)
    | Edit this page View Source

    ExpandedByInterval(Interval)

    Function to compute an interval that contains this and interval Interval

    Declaration
    public Interval ExpandedByInterval(Interval interval)
    Parameters
    Type Name Description
    Interval interval

    The interval

    Returns
    Type Description
    Interval

    An interval

    | Edit this page View Source

    ExpandedByValue(double)

    Method to expand

    Declaration
    public Interval ExpandedByValue(double p)
    Parameters
    Type Name Description
    double p
    Returns
    Type Description
    Interval
    | Edit this page View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()
    | Edit this page View Source

    Intersects(Interval)

    Function to test if this Interval intersects the interval other.

    Declaration
    public bool Intersects(Interval other)
    Parameters
    Type Name Description
    Interval other
    Returns
    Type Description
    bool
    | Edit this page View Source

    Intersects(double, double)

    Function to test if this Interval intersects the interval ℝ[min, max].

    Declaration
    public bool Intersects(double min, double max)
    Parameters
    Type Name Description
    double min

    The minimum value of the interval

    double max

    The maximum value of the interval

    Returns
    Type Description
    bool

    true if this interval intersects the interval ℝ[min, max].

    | 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 ℝ[min, max].

    Declaration
    public bool Overlaps(double min, double max)
    Parameters
    Type Name Description
    double min

    The minimum value of the interval

    double max

    The maximum value of the interval

    Returns
    Type Description
    bool

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

    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    Operators

    | Edit this page View Source

    operator ==(Interval, Interval)

    Equality operator for Intervals

    Declaration
    public static bool operator ==(Interval lhs, Interval rhs)
    Parameters
    Type Name Description
    Interval lhs

    The left-hand-side Interval

    Interval rhs

    The right-hand-side Interval

    Returns
    Type Description
    bool

    true if the Intervals are equal.

    | Edit this page View Source

    operator !=(Interval, Interval)

    Inequality operator for Intervals

    Declaration
    public static bool operator !=(Interval lhs, Interval rhs)
    Parameters
    Type Name Description
    Interval lhs

    The left-hand-side Interval

    Interval rhs

    The right-hand-side Interval

    Returns
    Type Description
    bool

    true if the Intervals are not equal.

    Implements

    IEquatable<T>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX