distance static method

double distance(
  1. Vec2D a,
  2. Vec2D b
)

Implementation

static double distance(Vec2D a, Vec2D b) {
  double x = b.x - a.x;
  double y = b.y - a.y;
  return math.sqrt(x * x + y * y);
}