Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Vector

Describes a two-dimensional vector and implements various helpful methods to use it.

Hierarchy

  • Vector

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Vector(_x?: number, _y?: number): Vector
  • Parameters

    • Default value _x: number = 0
    • Default value _y: number = 0

    Returns Vector

Properties

x

x: number

y

y: number

Accessors

length

  • get length(): number
  • Returns number

Methods

add

  • Parameters

    Returns void

copy

  • Returns Vector

scale

  • scale(_factor: number): void
  • Parameters

    • _factor: number

    Returns void

set

  • set(_x: number, _y: number): void
  • Parameters

    • _x: number
    • _y: number

    Returns void

Static getDifference

Static getPolar

  • getPolar(_angle: number, _length: number): Vector
  • Parameters

    • _angle: number
    • _length: number

    Returns Vector

Static getRandom

  • getRandom(_minLength: number, _maxLength: number): Vector
  • Parameters

    • _minLength: number
    • _maxLength: number

    Returns Vector

Generated using TypeDoc