Vector2.addScalar()

Add a scalar number to each component of this vector

Parameters

NameTypeDescription
1scalarnumber

Return value

Vector2

The vector with its new values

Usage

import {Vector2} from '@lcluber/type6js';

let vector1 = new Vector2(5,5);
console.log(vector1); //(5,5)
vector1.addScalar(2);
console.log(vector1); //(7,7)