Trajectory

A 3D trajectory consisting of an order list of vectors describing a path of motion through 3D space.

Hierarchy

  • Trajectory

Index

Constructors

constructor

Find examples in Playground
  • new Trajectory(segmentLength?: number): Trajectory
  • Create a new empty Trajectory.

    Parameters

    • Optional segmentLength: number

      radius of discretization for Trajectory points

    Returns Trajectory

Methods

add

Find examples in Playground
  • Append a new point to the Trajectory. NOTE: This implementation has many allocations.

    Parameters

    Returns void

getLength

Find examples in Playground
  • getLength(): number
  • Get the length of the Trajectory.

    Returns number

    length of the Trajectory

resampleAtTargetResolution

Find examples in Playground
  • resampleAtTargetResolution(targetResolution: number): Trajectory
  • Create a new Trajectory with a segment length chosen to make it probable that the new Trajectory will have a specified number of segments. This operation is imprecise.

    Parameters

    • targetResolution: number

      number of segments desired

    Returns Trajectory

    new Trajectory with approximately the requested number of segments

serialize

Find examples in Playground
  • serialize(): string
  • Serialize to JSON.

    Returns string

    serialized JSON string

tokenize

Find examples in Playground
  • Convert Trajectory segments into tokenized representation. This representation is an array of numbers where each nth number is the index of the token which is most similar to the nth segment of the Trajectory.

    Parameters

    Returns number[]

    list of indices of most similar token per segment

Static Deserialize

Find examples in Playground
  • Deserialize from JSON.

    Parameters

    • json: string

      serialized JSON string

    Returns Trajectory

    deserialized Trajectory

Generated using TypeDoc