Hierarchy

Constructors

Properties

x: number

X coordinate of the vector

y: number

Y coordinate of the vector

z: number

Z coordinate

Accessors

  • get angle(): number
  • Returns the current vector angle, based on x,y values

    Returns number

    the current vector angle, based on x,y values

  • set angle(angle): void
  • Sets the x,y values using an angle, length must be greater than 0

    Parameters

    • angle: number

      the angle to set

    Returns void

  • get length(): number
  • Returns the current vector length, based on x,y values

    Returns number

    the current vector length, based on x,y values

  • set length(length): void
  • Sets the x,y values using the length

    Parameters

    • length: number

      the length to set

    Returns void

  • get origin(): Vector
  • A new vector, with coordinates in the origin point

    Returns Vector

    a new vector, with coordinates in the origin point

Methods

  • Calculates the distance between the current vector and the given one

    Parameters

    • v: Vector3d

      the vector used for calculating the distance from the current one

    Returns number

    the distance between the vectors

  • Get the distance squared between two vectors

    Parameters

    • v: Vector3d

      the vector used for calculating the distance from the current one

    Returns number

    the distance squared between the vectors

  • Divides the given scalar and the current vector together, without modifying it

    Parameters

    • n: number

      the scalar value to divide from the current vector

    Returns Vector3d

    the divided vector

  • Divides the given scalar from the current vector, modifying it

    Parameters

    • n: number

      the scalar value to divide from the current vector

    Returns void

  • Multiplies the given scalar to the current vector, modifying it

    Parameters

    • n: number

      the scalar value to multiply to the vector

    Returns void