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

NameTypeDescription
1p0Vector2
2p1Vector2
3p2Vector2
4p3Vector2
5tnumber

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);