distance function

double distance(
  1. num x1,
  2. num y1,
  3. num x2,
  4. num y2,
)

Implementation

double distance(num x1, num y1, num x2, num y2) =>
    sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));