Hierarchy

  • Vector2

Implements

  • Vec2

Constructors

Properties

type: string = "vec2"
x: number
y: number

Accessors

Methods

  • The distance between two Vectors.

    Returns

    Distance between this and another vector.

    Parameters

    • v: Vector2Type

      Vector2 to find distance between.

    Returns number

  • The product of the Euclidean magnitudes of this and another Vector2.

    Returns

    Euclidean magnitude with another vector.

    Parameters

    • v: Vector2Type

      Vector2 to find Euclidean magnitude between.

    Returns number

  • Parameters

    • v: Vector2Type

    Returns number

  • Parameters

    • v: Vector2Type

    Returns void

  • Parameters

    • v1: Vector2Type
    • v2: Vector2Type

    Returns number

  • Creates a vector from an array of numbers

    Parameters

    • primitive: number[] | [number, number]

      An array of numbers (usually returned by a native) ```

    Returns Vector2

  • Creates an array of vectors from an array number arrays

    Parameters

    • primitives: [number, number][] | number[][]

      A multi-dimensional array of number arrays ```

    Returns Vector2[]

Generated using TypeDoc