tocada
Version:
Touch events with ease! (Inspired by the wonderful Tocca.js library). Written in Typescript with love
14 lines • 399 B
JavaScript
export function difference(num1, num2) {
if (num1 < num2) {
return num2 - num1;
}
else {
return num1 - num2;
}
}
export function getDistanceBetweenTouchPoints(touch0, touch1) {
const distanceX = touch0.clientX - touch1.clientX;
const distanceY = touch0.clientY - touch1.clientY;
return Math.hypot(distanceX, distanceY);
}
//# sourceMappingURL=utils.js.map