Interval
References[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 16)]
[DebuggerDisplay("({m_t0}, {m_t1})")]
[Serializable]
public struct Interval : ISerializable, IEquatable<Interval>, IComparable<Interval>, IComparable, IEpsilonComparable<Interval>
Represents an interval in one-dimensional space, that is defined as two extrema or bounds.
Constructors
Initializes a new instance of the Rhino.Geometry.Interval class.
Properties
Gets a value indicating whether or not this Interval is valid. Valid intervals must contain valid numbers.
Gets the signed length of the numeric range. If the interval is decreasing, a negative length will be returned.
Gets an Interval whose limits are RhinoMath.UnsetValue.
Gets an Interval whose limits are 0.0 and 1.0.
Indexers
Methods
Compares this Interval with another interval.
The lower bound has first evaluation priority.
Check that all values in other are within epsilon of the values in this
Implements: EpsilonEquals
Equals
#Parameters:
| obj (object) | The other object to compare with. |
Returns: true if obj is an Interval and has the same bounds; false otherwise.
Overrides: ValueType.Equals
Expand an interval by adding the value to T1 and subtracting it from T0. If T1 < T0, T0 and T1 are swapped.
Parameters:
| value (double) |
Returns a new Interval that is the Intersection of the two input Intervals.
Returns: If the intersection is not empty, then intersection = [max(a.Min(),b.Min()), min(a.Max(),b.Max())] The interval [ON.UnsetValue,ON.UnsetValue] is considered to be the empty set interval. The result of any intersection involving an empty set interval or disjoint intervals is the empty set interval.
Returns a new Interval which contains both inputs.
Returns: The union of an empty set and an increasing interval is the increasing interval.
The union of two empty sets is empty.
The union of an empty set an a non-empty interval is the non-empty interval.
The union of two non-empty intervals is [min(a.Min(),b.Min()), max(a.Max(),b.Max())]
GetHashCode
#Computes the hash code for this Interval object.
Returns: A hash value that might be equal for two different Interval values.
Overrides: ValueType.GetHashCode
Grows the Interval to include the given number.
Parameters:
| value (double) | Number to include in this interval. |
Tests another interval for Interval inclusion.
Tests another interval for Interval inclusion.
Parameters:
| interval (Interval) | Interval to test. |
Returns: true if the other interval is contained within or is coincident with the limits of this Interval; otherwise false.
Tests a parameter for Interval inclusion.
Tests a parameter for Interval inclusion.
Parameters:
| t (double) | Parameter to test. |
Returns: true if t is contained within or is coincident with the limits of this Interval.
public void MakeIncreasing()
Ensures this Interval is either singleton or increasing.
Converts interval value, or pair of values, to normalized parameter.
Parameters:
| intervalParameter (Interval) |
Returns: Normalized parameter x so that min*(1.0-x) + max*x = intervalParameter.
Converts interval value, or pair of values, to normalized parameter.
Parameters:
| intervalParameter (double) |
Returns: Normalized parameter x so that min*(1.0-x) + max*x = intervalParameter.
Converts normalized parameter to interval value, or pair of values.
Parameters:
| normalizedParameter (double) |
Returns: Interval parameter min*(1.0-normalizedParameter) + max*normalizedParameter.
Converts normalized parameter to interval value, or pair of values.
Parameters:
| normalizedInterval (Interval) |
Returns: Interval parameter min*(1.0-normalizedParameter) + max*normalized_paramete.
Parameters:
| obj (object) |
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters:
| info (SerializationInfo) | |
| context (StreamingContext) |
ToString
#Returns a string representation of this Interval.
Returns: A string with T0,T1.
Overrides: ValueType.ToString
Operators
| Operation | Result | Description | ||
|---|---|---|---|---|
| double | + | Interval | Interval | Shifts an interval by a specific amount (addition). |
| Interval | + | double | Interval | Shifts a Interval by a specific amount (addition). |
| Interval | == | Interval | bool | Determines whether the two Intervals have equal values. |
| Interval | > | Interval | bool | Determines whether the first specified Interval comes after (has superior sorting value than) the second Interval. The lower bound has first evaluation priority. |
| Interval | >= | Interval | bool | 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. |
| Interval | != | Interval | bool | Determines whether the two Intervals have different values. |
| Interval | < | Interval | bool | Determines whether the first specified Interval comes before (has inferior sorting value than) the second Interval. The lower bound has first evaluation priority. |
| Interval | <= | Interval | bool | 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. |
| double | - | Interval | Interval | Shifts an interval by a specific amount (subtraction). |
| Interval | - | double | Interval | Shifts an interval by a specific amount (subtraction). |