Vector2.divideScaledVector()
Scale the vector given as first parameter with the scalar number given as second parameter then divide the result by this vector
Parameters
Name | Type | Description | |
---|---|---|---|
1 | v | Vector2 | |
2 | scalar | number |
Return value
Vector2
The vector with its new values
Usage
import {Vector2} from '@lcluber/type6js';
let vector1 = new Vector2(16,16);
let vector2 = new Vector2(2,2);
console.log(vector1); //(5,5)
vector1.divideScaledVector(vector2, 2);
console.log(vector1); //(4,4)