num distanceSqr(Vector vec)

Source

num distanceSqr(Vector vec) {
  num xd = x - vec.x;
  num yd = y - vec.y;
  return xd * xd + yd * yd;
}