Skip to content

format

typescript
Vector4.Add(rhs)

class: Vector4

description

Adds the current vector object with another vector or a scalar value and returns the resulting vector.

parameter

param_nametypedescription
rhsnumber|Vector4The vector or scalar value to add.

reture

typedescription
Vector4Returns a new Vector4 object representing the result of adding the current vector object with rhs.

code example

typescript
let v4 = new Vector4(-1, -2, -3, -4);
let add_number = v4.Add(1);
let add_v4 = v4.Add(new Vector4(2, 3, 4, 5));