feat: directionalProjection

This commit is contained in:
cha0s 2019-05-27 16:54:43 -05:00
parent 67be4a9a29
commit 005cb837ad

View File

@ -325,6 +325,19 @@ export function fromDirection(direction) {
}
}
export function directionalProjection(direction, vector) {
switch (direction) {
case 0:
return [vector[0], -vector[1]];
case 1:
return [vector[1], vector[0]];
case 2:
return [vector[0], vector[1]];
case 3:
return [-vector[1], vector[0]];
}
}
export function interpolate(ultimate, actual, easing = 0) {
if (0 === easing) {
return ultimate;