calculatePointersDistance method

dynamic calculatePointersDistance(
  1. dynamic p0,
  2. dynamic p1
)
  • Calculate the distance between two pointers
    • @param {PointerEvent} p0 The first pointer
      • @param {PointerEvent} p1 The second pointer
      • @returns {number} The distance between the two pointers

Implementation

calculatePointersDistance(p0, p1) {
  return Math.sqrt(Math.pow(p1.clientX - p0.clientX, 2) +
      Math.pow(p1.clientY - p0.clientY, 2));
}