calculatePointersDistance method

double calculatePointersDistance(
  1. dynamic p0,
  2. dynamic p1
)
  • Calculate the distance between two pointers
  • p0 The first pointer
  • p1 The second pointer
  • returns double The distance between the two pointers

Implementation

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