Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Vector2

Represents 2D points and vectors.

Hierarchy

  • Vector2

Index

Constructors

Properties

Constructors

constructor

  • Returns Vector2

  • Parameters

    • x: number
    • y: number

    Returns Vector2

Properties

length

length: number

Returns the length of this vector.

The length is calculated by the square root of (x * x + y * y)

returns

length of this vector.

normalized

normalized: Vector2

Returns a copy of this vector with length 1.

sqrLength

sqrLength: number

Returns the squared length of this vector.

If you use vector lengths to compare distances, squared lengths are more performant and preferred to use.

returns

squared length of this vector

x

x: number

y

y: number

Generated using TypeDoc