@mui/x-internal-gestures
Version:
The core engine of GestureEvents, a modern and robust multi-pointer gesture detection library for JavaScript.
14 lines (13 loc) • 339 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDistance = getDistance;
/**
* Calculate the distance between two points
*/
function getDistance(pointA, pointB) {
const deltaX = pointB.x - pointA.x;
const deltaY = pointB.y - pointA.y;
return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
}