s2js
    Preparing search index...

    Class Interval

    Interval represents a closed interval on ℝ. Zero-length intervals (where lo == hi) represent single points. If lo > hi then the interval is empty.

    Index

    Constructors

    Other

    hi: number = 0.0
    lo: number = 0.0
    • Reports whether the interval can be transformed into the given interval by moving each endpoint a small distance. The empty interval is considered to be positioned arbitrarily on the real line, so any interval with a small enough length will match the empty interval.

      Parameters

      Returns boolean

    • Returns the closest point in the interval to the given point p. The interval must be non-empty.

      Parameters

      • p: number

      Returns number

    • Returns the Hausdorff distance to the given interval. For two intervals x and y, this distance is defined as: h(x, y) = max_{p in x} min_{q in y} d(p, q).

      Parameters

      Returns number

    • Returns an interval that has been expanded on each side by margin. If margin is negative, then the function shrinks the interval on each side by margin instead. The resulting interval may be empty. Any expansion of an empty interval remains empty.

      Parameters

      • margin: number

      Returns r1.Interval

    • Returns true iff the interval strictly contains p.

      Parameters

      • p: number

      Returns boolean