Skip to content

format

typescript
Vector4.Sub(rhs)

class: Vector4

description

Subtracts another vector or a scalar from the current vector object and returns the resulting vector.

parameter

param_nametypedescription
rhsnumber|Vector4The vector or scalar to subtract.

reture

typedescription
Vector4Returns a new Vector4 object representing the result of subtracting the current vector object from rhs.

code example

typescript
let v4 = new Vector4(-1, -2, -3, -4);
let sub_number = v4.Sub(1);
let sub_v4 = v4.Sub(new Vector4(2, 3, 4, 5));