| 67 | } |
| 68 | |
| 69 | double greatCircleDistance(const Coordinate coordinate_1, const Coordinate coordinate_2) |
| 70 | { |
| 71 | // Should be within 0.1% or so of Vincenty method (assuming 19 buckets are enough) |
| 72 | // Should be more faster and more precise than Haversine |
| 73 | const auto lon1 = static_cast<double>(util::toFloating(coordinate_1.lon)); |
| 74 | const auto lat1 = static_cast<double>(util::toFloating(coordinate_1.lat)); |
| 75 | const auto lon2 = static_cast<double>(util::toFloating(coordinate_2.lon)); |
| 76 | const auto lat2 = static_cast<double>(util::toFloating(coordinate_2.lat)); |
| 77 | return cheap_ruler_container.getRuler(coordinate_1.lat, coordinate_2.lat) |
| 78 | .distance({lon1, lat1}, {lon2, lat2}); |
| 79 | } |
| 80 | |
| 81 | double perpendicularDistance(const Coordinate segment_source, |
| 82 | const Coordinate segment_target, |
no test coverage detected