Vector2.cubicBezier()
Set the interpolation point between the four vectors given as first, second, third and fourth parameters using the normalized amount given as fifth parameter
Parameters
Name | Type | Description | |
---|---|---|---|
1 | p0 | Vector2 | |
2 | p1 | Vector2 | |
3 | p2 | Vector2 | |
4 | p3 | Vector2 | |
5 | t | number |
Return value
Vector2
The vector with its new values
Usage
import {Vector2} from '@lcluber/type6js';
let array = [2,2];
let p0 = Vector2(2,4);
let p1 = Vector2(4,6);
let p2 = Vector2(8,8);
let p3 = Vector2(8,8);
let t = 4;
let vector = new Vector2(1,1);
console.log(vector); //(1,1)
vector.cubicBezier(p0, p1, p2, p3, t);
console.log(vector);