feat: directionalProjection
This commit is contained in:
parent
67be4a9a29
commit
005cb837ad
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user