distance static method

double distance(
  1. Offset p1,
  2. Offset p2
)

Implementation

static double distance(Offset p1, Offset p2) {
  return sqrt(pow(p2.dy - p1.dy, 2) + pow(p2.dx - p1.dx, 2));
}