distanceSqr method

num distanceSqr (
  1. Vector vec
)

Implementation

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