| 223 | } |
| 224 | |
| 225 | bool IndexRouter::BestEdgeComparator::IsAlmostCodirectional(Edge const & edge) const |
| 226 | { |
| 227 | CHECK(IsDirectionValid(), ()); |
| 228 | |
| 229 | auto const edgeDirection = edge.GetDirection(); |
| 230 | if (edgeDirection.IsAlmostZero()) |
| 231 | return false; |
| 232 | |
| 233 | double const cosAng = m2::DotProduct(m_direction.Normalize(), edgeDirection.Normalize()); |
| 234 | // Note. acos(0.97) ≈ 14 degrees. |
| 235 | double constexpr kMinCosAngForAlmostCodirectionalVectors = 0.97; |
| 236 | return cosAng >= kMinCosAngForAlmostCodirectionalVectors; |
| 237 | } |
| 238 | |
| 239 | double IndexRouter::BestEdgeComparator::GetSquaredDist(Edge const & edge) const |
| 240 | { |
no test coverage detected