Interval
Represents an interval in one-dimensional space, that is defined as two extrema or bounds.
Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll)
Syntax
[SerializableAttribute]public struct Interval : ISerializable, IEquatable<Interval>, IComparable<Interval>, IComparable, IEpsilonComparable<Interval>
The Interval type exposes the following members.
Constructors
Name
Description
Public Method
Interval(Interval)
Initializes a new instance copying the other instance values.
Public Method
Interval(Double, Double)
Initializes a new instance of the Rhino.Geometry.Interval class.
Properties
Name
Description
Public Property
IsDecreasing
Returns true if T[0] > T[1].
Public Property
IsIncreasing
Returns true if T0 < T1.
Public Property
IsSingleton
Returns true if T0 == T1 != ON.UnsetValue.
Public Property
IsValid
Gets a value indicating whether or not this Interval is valid. Valid intervals must contain valid numbers.
Public Property
Item
Gets or sets the indexed bound of this Interval.
Public Property
Length
Gets the signed length of the numeric range. If the interval is decreasing, a negative length will be returned.
Public Property
Max
Gets the larger of T0 and T1.
Public Property
Code Example
Mid
Gets the average of T0 and T1.
Public Property
Min
Gets the smaller of T0 and T1.
Public Property
T0
Gets or sets the lower bound of the Interval.
Public Property
T1
Gets or sets the upper bound of the Interval.
Public Property
Static Member
Unset
Gets an Interval whose limits are RhinoMath.UnsetValue.
Methods
Name
Description
Public Method
CompareTo
Compares this Interval with another interval.
The lower bound has first evaluation priority.
Public Method
EpsilonEquals
Check that all values in other are within epsilon of the values in this
Public Method
Equals(Interval)
Determines whether the specified Interval is equal to the current Interval, comparing by value.
Public Method
Equals(Object)
Determines whether the specified Object is equal to the current Interval, comparing by value.
(Overrides ValueType.Equals(Object).)
Public Method
Static Member
FromIntersection
Returns a new Interval that is the Intersection of the two input Intervals.
Public Method
Static Member
FromUnion
Returns a new Interval which contains both inputs.
Public Method
GetHashCode
Computes the hash code for this Interval object.
(Overrides ValueType.GetHashCode..)
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public Method
Grow
Grows the Interval to include the given number.
Public Method
IncludesInterval(Interval)
Tests another interval for Interval inclusion.
Public Method
IncludesInterval(Interval, Boolean)
Tests another interval for Interval inclusion.
Public Method
IncludesParameter(Double)
Tests a parameter for Interval inclusion.
Public Method
IncludesParameter(Double, Boolean)
Tests a parameter for Interval inclusion.
Public Method
MakeIncreasing
Ensures this Interval is either singleton or increasing.
Public Method
NormalizedIntervalAt
Converts interval value, or pair of values, to normalized parameter.
Public Method
NormalizedParameterAt
Converts interval value, or pair of values, to normalized parameter.
Public Method
ParameterAt
Converts normalized parameter to interval value, or pair of values.
Public Method
ParameterIntervalAt
Converts normalized parameter to interval value, or pair of values.
Public Method
Reverse
Changes interval to [-T1, -T0].
Public Method
Swap
Exchanges T0 and T1.
Public Method
ToString
Returns a string representation of this Interval.
(Overrides ValueType.ToString..)
Operators
Name
Description
Public Operator
Static Member
Addition(Double, Interval)
Shifts an interval by a specific amount (addition).
Public Operator
Static Member
Addition(Interval, Double)
Shifts a Interval by a specific amount (addition).
Public Operator
Static Member
Equality
Determines whether the two Intervals have equal values.
Public Operator
Static Member
GreaterThan
Determines whether the first specified Interval comes after (has superior sorting value than) the second Interval.
The lower bound has first evaluation priority.
Public Operator
Static Member
GreaterThanOrEqual
Determines whether the first specified Interval comes after (has superior sorting value than) the second Interval, or is equal to it.
The lower bound has first evaluation priority.
Public Operator
Static Member
Inequality
Determines whether the two Intervals have different values.
Public Operator
Static Member
LessThan
Determines whether the first specified Interval comes before (has inferior sorting value than) the second Interval.
The lower bound has first evaluation priority.
Public Operator
Static Member
LessThanOrEqual
Determines whether the first specified Interval comes before (has inferior sorting value than) the second Interval, or is equal to it.
The lower bound has first evaluation priority.
Public Operator
Static Member
Subtraction(Double, Interval)
Shifts an interval by a specific amount (subtraction).
Public Operator
Static Member
Subtraction(Interval, Double)
Shifts an interval by a specific amount (subtraction).