Added a new method for calculating the gesture triangle shape

and moved gesture data to a separate file
This commit is contained in:
Mitchell McCaffrey 2020-04-21 17:05:38 +10:00
parent 8f1bcf3806
commit 3c204377d6
3 changed files with 1518 additions and 1208 deletions

File diff suppressed because it is too large Load Diff

1444
src/helpers/gesturesData.js Normal file

File diff suppressed because it is too large Load Diff

20
src/helpers/vector2.js Normal file
View File

@ -0,0 +1,20 @@
export function lengthSquared(p) {
return p.x * p.x + p.y * p.y;
}
export function length(p) {
return Math.sqrt(lengthSquared(p));
}
export function normalize(p) {
const l = length(p);
return { x: p.x / l, y: p.y / l };
}
export function dot(a, b) {
return a.x * b.x + a.y * b.y;
}
export function subtract(a, b) {
return { x: a.x - b.x, y: a.y - b.y };
}