UNPKG

@mui/x-internal-gestures

Version:

The core engine of GestureEvents, a modern and robust multi-pointer gesture detection library for JavaScript.

8 lines 231 B
/** * Calculate the distance between two points */ export function getDistance(pointA, pointB) { const deltaX = pointB.x - pointA.x; const deltaY = pointB.y - pointA.y; return Math.sqrt(deltaX * deltaX + deltaY * deltaY); }