Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Trajectory

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

Hierarchy

  • Trajectory

Index

Constructors

constructor

  • new Trajectory(segmentLength?: number): Trajectory
  • Create a new empty Trajectory.

    Parameters

    • Optional segmentLength: number

      radius of discretization for Trajectory points

    Returns Trajectory

Methods

addSearch playground for add

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

    Parameters

    Returns void

getLengthSearch playground for getLength

  • getLength(): number
  • Get the length of the Trajectory.

    Returns number

    length of the Trajectory

resampleAtTargetResolutionSearch playground for resampleAtTargetResolution

  • 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

serializeSearch playground for serialize

  • serialize(): string
  • Serialize to JSON.

    Returns string

    serialized JSON string

tokenizeSearch playground for tokenize

  • 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 DeserializeSearch playground for Deserialize

  • Deserialize from JSON.

    Parameters

    • json: string

      serialized JSON string

    Returns Trajectory

    deserialized Trajectory

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method