ixfx
    Preparing search index...

    Class PointTracker

    Point tracker. Create via Trackers.point().

    Hierarchy (View Summary)

    Constructors

    Properties

    debug: boolean
    id: string
    initialRelation: undefined | PointRelation
    lastResult:
        | undefined
        | Readonly<
            {
                fromInitial: PointRelationResult;
                fromLast: PointRelationResult;
                fromMark: undefined
                | PointRelationResult;
                values: readonly Geometry.Point[];
            },
        >
    markRelation: undefined | PointRelation

    Accessors

    • get elapsed(): number

      Returns the elapsed time, in milliseconds since the initial value

      Returns number

    • get length(): number

      Returns the total length of accumulated points. Returns 0 if points were not saved, or there's only one

      Returns number

    • get line(): Geometry.PolyLine

      Returns a polyline representation of stored points. Returns an empty array if points were not saved, or there's only one.

      Returns Geometry.PolyLine

    • get lineStartEnd(): Geometry.Line

      Returns a line from initial point to last point.

      If there are less than two points, Lines.Empty is returned

      Returns Geometry.Line

    • get size(): number

      Returns number of recorded values (includes the initial value in the count)

      Returns number

    • get vectorCartesian(): Geometry.Point

      Returns a vector of the initial/last points of the tracker. Returns as a Cartesian coordinate

      Returns Geometry.Point

    • get vectorPolar(): Coord

      Returns a vector of the initial/last points of the tracker. Returns as a polar coordinate

      Returns Coord

    • get x(): number

      Returns the last x coord

      Returns number

    • get y(): number

      Returns the last y coord

      Returns number

    • get z(): undefined | number

      Returns the last z coord (or undefined if not available)

      Returns undefined | number

    Methods

    • Returns angle (in radians) from latest point to the initial point If there are less than two points, undefined is return.

      Returns undefined | number

      Angle in radians

    • Returns distance from latest point to initial point. If there are less than two points, zero is returned.

      This is the direct distance from initial to last, not the accumulated length.

      Returns number

      Distance

    • Makes a 'mark' in the tracker, allowing you to compare values to this point.

      Returns void

    • Notification that buffer has been knocked down to sampleLimit.

      This will reset the initialRelation, which will use the new oldest value.

      Parameters

      Returns void

    • Adds a value, returning computed result.

      At this point, we check if the buffer is larger than resetAfterSamples. If so, reset() is called. If not, we check sampleLimit. If the buffer is twice as large as sample limit, trimStore() is called to take it down to sample limit, and onTrimmed() is called.

      Parameters

      Returns Readonly

    • Adds a PointerEvent along with its coalesced events, if available.

      Parameters

      • p: PointerEvent

      Returns Readonly

    • Reduces size of value store to limit. Returns number of remaining items

      Parameters

      • limit: number

      Returns number