Defines a vector in two-dimensional coordinates.

Hierarchy

  • Vector2d

Constructors

Properties

x: number
y: number

Accessors

  • get angle(): number
  • Gets the angle, in degrees, from the x axis.

    Returns number

  • get magnitude(): number
  • Gets the magnitude, or length, of the vector.

    Returns number

Methods

  • Parameters

    • scalar: number

    Returns void

  • Parameters

    • scalar: number

    Returns void

  • Creates a Vector from its polar coordinates.

    Parameters

    • magnitude: number

      The magnitude or length.

    • angle: number

      The angle in degrees.

    Returns Vector2d

    The Vector in Cartesian coordinates.

Generated using TypeDoc