fn check_collision(
  cluster: &Vec<Point>,
  _p: Point2,
  size: f32,
  min_dist: f32,
  max_dist: f32,
) -> bool {
  for point in cluster {
    if pt2(point.x, point.y).distance(pt2(_p.x, _p.y)) < size * min_dist {
      return false;
    }
  }

  for p in cluster {
    if pt2(p.x, p.y).distance(pt2(_p.x, _p.y)) < size * max_dist {
      return true;
    }
  }
  return false;
}
/// check collision between a point and the cluster.
check collision between a point and the cluster.
check collision between a point and the cluster .
fn check_collision(
  cluster: &Vec<Point>,
  _p: Point2,
  size: f32,
  min_dist: f32,
  max_dist: f32,
) -> bool {
  for point in cluster {
    if pt2(point.x, point.y).distance(pt2(_p.x, _p.y)) < size * min_dist {
      return false;
    }
  }
  for p in cluster {
    if pt2(p.x, p.y).distance(pt2(_p.x, _p.y)) < size * max_dist {
      return true;
    }
  }
  return false;
}
fn check_collision ( cluster : & Vec < Point > , _p : Point2 , size : f32 , min_dist : f32 , max_dist : f32 , ) -> bool { for point in cluster { if pt2 ( point . x , point . y ) . distance ( pt2 ( _p . x , _p . y ) ) < size * min_dist { return false ; } } for p in cluster { if pt2 ( p . x , p . y ) . distance ( pt2 ( _p . x , _p . y ) ) < size * max_dist { return true ; } } return false ; }
check collision between a point and the cluster.
check collision between a point and the cluster .
cluster
&Vec<Point>
_p
Point2
size
f32
min_dist
f32
max_dist
f32