Skip to content

format

typescript
Vector2.Mul(rhs)

class: Vector2

description

Multiplies the current vector object by another vector or a scalar value and returns the resulting vector.

parameter

param_nametypedescription
rhsnumber|Vector2The vector or scalar value to multiply by.

reture

typedescription
Vector2Returns a new Vector2 object representing the result of multiplying the current vector object by rhs.

code example

typescript
let v2 = new Vector2(-1, -2);
let mul_number = v2.Mul(1);
let mul_v2 = v2.Mul(new Vector2(2, 3));