Constructors
constructor
- new Vector2(x: number, y: number): Vector2
Properties
Methods
addMultiply
- addMultiply(vector: Readonly<Vector2>, scale: number): this
Returns this
This instance.
addMultiplyXY
- addMultiplyXY(x: number, y: number, scale: number): this
Parameters
- x: number
- y: number
- scale: number
Returns this
This instance.
addXY
- addXY(x: number, y: number): this
Returns this
This instance.
clamp
- clamp(floor: number, ceil: number): this
Parameters
- floor: number
- ceil: number
Returns this
This instance.
divideScale
- divideScale(scale: number): this
Returns this
This instance.
divideXY
- divideXY(x: number, y: number): this
Returns this
This instance.
invertAdd
- invertAdd(): this
Returns this
This instance.
invertMultiply
- invertMultiply(): this
Returns this
This instance.
multiplyScale
- multiplyScale(scale: number): this
Returns this
This instance.
multiplyXY
- multiplyXY(x: number, y: number): this
Returns this
This instance.
normalize
- normalize(): this
Returns this
This instance.
rotate
- rotate(angle: number): this
Returns this
This instance.
setXY
- setXY(x: number, y: number): this
Returns this
This instance.
subtractXY
- subtractXY(x: number, y: number): this
Returns this
This instance.
A vector with 2 components, labeled:
X
,Y
.