|
|
@@ -87,7 +87,8 @@ namespace math {
|
|
|
bool intersects(dim2::line const & lhs, dim2::circle const & rhs) {
|
|
|
dim2::line const orth = lines::orthogonal(lhs, rhs.center);
|
|
|
vec2 const delta = orth.second - orth.first;
|
|
|
- return delta.dot(delta) <= std::pow(rhs.radius, 2);
|
|
|
+ float delsq = delta.dot(delta), rsq = std::pow(rhs.radius, 2);
|
|
|
+ return delsq < rsq || (delsq == rsq && contains(lhs, orth.second));
|
|
|
}
|
|
|
|
|
|
bool intersects(dim2::line const & lhs, dim2::quad const & rhs) {
|