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())); }
void Renderer::draw ( const Circle& ent ) { vec2d pos = ent.get_position(); circleColor( m_renderer, pos.x, pos.y, ent.get_radius(), ent.get_colour() ); }
bool Intersector::intersect(const Circle &circle, const Line &line) { return is_less_equal( Distance::compute(line, circle.get_centre()), circle.get_radius()); }