distance function

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

Implementation

num distance(num x1, num y1, num x2, num y2) {
  var dx = x1 - x2;
  var dy = y1 - y2;
  return sqrt(dx * dx + dy * dy);
}