/** * Represents an interval in one-dimensional space that is defined as two extrema or bounds. */ export declare class Interval { private t0; private t1; /** * Initializes a new instance of the Interval class. * @param t0 The first bound of the interval. * @param t1 The second bound of the interval. */ constructor(t0: number, t1: number); /** * Initializes a new instance copying the other instance values. * @param other * @returns */ static CreateFromInternal(other: Interval): Interval; /** * returns an empty interval that goes from 0 to 0. */ static get Empty(): Interval; /** * returns an invalid interval that goes from NaN to NaN. * @remarks An invalid interval is not valid and cannot be used for any calculations. */ static get Invalid(): Interval; /** * Gets a value indicating whether or not this Interval is valid. Valid intervals must contain valid numbers. */ get IsValid(): boolean; /** * Gets or sets the lower bound of the Interval. */ get T0(): number; /** * Gets or sets the lower bound of the Interval. */ set T0(value: number); /** * Gets or sets the upper bound of the Interval. */ get T1(): number; /** * Gets or sets the upper bound of the Interval. */ set T1(value: number); /** * Gets the smaller of T0 and T1. * If the interval is not valid, NaN is returned. */ get Min(): number; /** * Gets the larger of T0 and T1. * If the interval is not valid, NaN is returned. */ get Max(): number; /** * Gets the average of T0 and T1. * If the interval is not valid, NaN is returned. */ get Mid(): number; /** * Gets the signed length of the numeric range. * If the interval is not valid, 0 is returned. * @remarks If the interval is decreasing, a negative length will be returned. */ get Length(): number; /** * Returns true if T0 == T1. */ get IsSingleton(): boolean; /** * Returns true if T0 < T1. */ get IsIncreasing(): boolean; /** * Returns true if T0 > T1. */ get IsDecreasing(): boolean; /** * Determines whether the specified interval is equal to the current interval, */ Equals(other: Interval): boolean; /** * Clones this instance and returns a new Interval. * @returns A new Interval with the same values as this instance. */ Clone(): Interval; /** * Returns a ensured increasing interval. */ MakeIncreasing(): Interval; /** * Exchanges T0 and T1. * @returns A new Interval with T0 and T1 swapped. */ Swap(): Interval; /** * Changes interval to [-T1, -T0]. * @returns A new Interval with [-T1, -T0]. * @remarks If the interval is not valid, an empty interval will be returned. */ Reverse(): Interval; /** * Grows the interval to include the given number. * @param value Number to include in this interval. * @returns A new Interval that includes the given number. */ Grow(value: number): Interval; /** * Converts normalized parameter to interval value, or pair of values. * @param normalizedParameter * @returns Interval parameter min*(1.0-normalizedParameter) + max*normalizedParameter. */ ParameterAt(normalizedParameter: number): number; /** * Converts normalized parameter to interval value, or pair of values. * @param normalizedInterval * @returns Interval parameter min*(1.0-normalizedParameter) + max*normalized_paramete. */ ParameterIntervalAt(normalizedInterval: Interval): Interval; /** * Converts interval value, or pair of values, to normalized parameter. * @param intervalParameter * @returns Normalized parameter x so that min*(1.0-x) + max*x = intervalParameter. */ NormalizedParameterAt(intervalParameter: number): number; /** * Converts interval value, or pair of values, to normalized parameter. * @param intervalParameter * @returns Normalized parameter x so that min*(1.0-x) + max*x = intervalParameter. */ NormalizedIntervalAt(intervalParameter: Interval): Interval; /** * Tests a parameter for Interval inclusion. * @param parameter * @param strict If true, the parameter must be fully on the inside of the Interval. default is false. * @returns true if t is contained within the limits of this Interval. */ IncludesParameter(parameter: number, strict?: boolean): boolean; /** * Tests a parameter for Interval inclusion. * @param other * @param strict If true, the parameter must be fully on the inside of the Interval. default is false. * @returns true if the other interval is contained within or is coincident with the limits of this Interval; otherwise false. */ IncludesInterval(other: Interval, strict?: boolean): boolean; /** * Union of two intervals. * @param other * @returns A new Interval that is the union of this and other. */ Union(other: Interval): Interval; /** * Intersection of two intervals. * @param other * @returns A new Interval that is the intersection of this and other. */ Intersect(other: Interval): Interval; /** * Check that all values in other are within epsilon of the values in this * @returns */ EpsilonEquals(other: Interval, epsilon?: number): boolean; ToString(): string; /** * Shifts a interval by a specific amount (addition). * @param value * @returns >A new interval where T0 and T1 are summed with number. */ Add(value: number): Interval; /** * Shifts an interval by a specific amount (subtraction). * @param value * @returns A new interval with [T0-number, T1-number]. */ Subtract(value: number): Interval; /** * Check if the interval is less than another interval. * @param other * @returns */ LessThan(other: Interval): boolean; /** * Determines whether the first specified Interval comes before (has inferior sorting value than) the second Interval, or is equal to it. * @param other * @returns */ LessThanOrEqual(other: Interval): boolean; /** * Check if the interval is greater than another interval. * @param other * @returns */ GreaterThan(other: Interval): boolean; /** * Determines whether the first specified Interval comes after (has superior sorting value than) the second Interval, or is equal to it. * @param other * @returns */ GreaterThanOrEqual(other: Interval): boolean; /** * Compares this interval with another interval. * The lower bound has first evaluation priority. * @param other * @returns 0: if this is identical to other; -1: if this is less than other; 1: if this is greater than other. * @remarks if either interval is invalid, the comparison is invalid and returns NaN. */ CompareTo(other: Interval): number; /** * Union of two intervals. * @param a * @param b * @returns a new Interval that is the union of a and b. */ static Union(a: Interval, b: Interval): Interval; /** * Intersection of two intervals. * @param a * @param b * @returns a new Interval that is the intersection of a and b. */ static Intersect(a: Interval, b: Interval): Interval; }