distance static method

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

Returns the distance between p1 and p2.

Implementation

static double distance(GPoint p1, GPoint p2) {
  var dx = p2.x - p1.x;
  var dy = p2.y - p1.y;
  dx *= dx;
  dy *= dy;
  return math.sqrt(dx + dy);
}