/** * * A Segment1d is an interval of an axis named x. * * The interval is defined by two values x0 and x1. * * The x0 and x1 values can be in either order. * * if `x0 < x1` fractional coordinates within the segment move from left to right. * * if `x0 > x1` fractional coordinates within the segment move from right to left. * * This differs from a Range1d in that: * * For a Range1d the reversed ordering of its limit values means "empty interval". * * For a Segment1d the reversed ordering is a real interval but fractional positions move backwards. * * The segment is parameterized with a fraction * * * Fraction 0 is the start (`x0`) * * * Fraction 1 is the end (`x1`) * * * The fraction equation is `x = x0 + fraction * (x1-x0)` or (equivalently) `x = (1-fraction) * x0 + fraction * x1` * @public */ export declare class Segment1d { /** start coordinate */ x0: number; /** end coordinate */ x1: number; private constructor(); /** * replace both end values. * @param x0 new x0 value * @param x1 new y0 value */ set(x0: number, x1: number): void; /** * shift (translate) the segment along its axis by adding `dx` to both `x0` and `x1`. * @param dx value to add to both x0 and x1 */ shift(dx: number): void; /** * create segment1d with given end values * @param x0 start value * @param x1 end value * @param result optional pre-existing result to be reinitialized. */ static create(x0?: number, x1?: number, result?: Segment1d): Segment1d; /** * Copy both end values from other Segment1d * @param other source Segment1d */ setFrom(other: Segment1d): void; /** * clone this Segment1d, return as a separate object. */ clone(): Segment1d; /** * Returns true if both coordinates (`x0` and `x1`) are in the 0..1 range. */ get isIn01(): boolean; /** * Evaluate the segment at fractional position * @returns position within the segment * @param fraction fractional position within this segment */ fractionToPoint(fraction: number): number; /** * Return the signed start-to-end shift (aka signed distance) */ signedDelta(): number; /** * Return the absolute start-to-end shift (aka distance) */ absoluteDelta(): number; /** * * swap the x0 and x1 member values. * * This makes the fractionToPoint evaluates reverse direction. */ reverseInPlace(): void; /** * * if `x1