Beispiel #1
0
 bool Intersector::intersect(const Circle &circle0, const Circle &circle1) {
   if (are_equal(circle0.get_centre().x(), circle1.get_centre().x()) &&
       are_equal(circle0.get_centre().y(), circle1.get_centre().y())) {
     return are_equal(circle0.get_radius(), circle1.get_radius());
   }
   return is_less_equal(
       Distance::compute(circle0.get_centre(), circle1.get_centre()),
       (circle0.get_radius() + circle1.get_radius()));
 }
Beispiel #2
0
 bool Intersector::intersect(const Circle &circle, const Line &line) {
   return is_less_equal(
       Distance::compute(line, circle.get_centre()),
       circle.get_radius());
 }