Skip to content

format

typescript
Vector2.Div(rhs)

class: Vector2

description

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

parameter

param_nametypedescription
rhsnumber|Vector2The divisor, which can be a scalar value or a vector.

reture

typedescription
Vector2A new Vector2 object representing the result of dividing the current vector object by rhs.

code example

typescript
let lhs = new Vector2(1, 2);
let div_number = lhs.Div(1);
let div_v2 = lhs.Div(new Vector2(1, 2));