circleToCircle method

bool circleToCircle(
  1. DFCircle other
)

圆形与圆形重叠

Implementation

bool circleToCircle(DFCircle other) {
  if (!this.toRect().rectToRect(other.toRect())) return false;
  final distance = this.radius + other.radius;
  final w = this.center.x - other.center.x;
  final h = this.center.y - other.center.y;
  return sqrt(w * w + h * h) <= distance;
}