Commit 6cf5b626 authored by Don Gagne's avatar Don Gagne

Fix NaN in calculation

parent c08104b7
......@@ -28,7 +28,13 @@
static const float epsilon = std::numeric_limits<double>::epsilon();
void convertGeoToNed(QGeoCoordinate coord, QGeoCoordinate origin, double* x, double* y, double* z) {
void convertGeoToNed(QGeoCoordinate coord, QGeoCoordinate origin, double* x, double* y, double* z)
{
if (coord == origin) {
// Short circuit to prevent NaNs in calculation
*x = *y = *z = 0;
return;
}
double lat_rad = coord.latitude() * M_DEG_TO_RAD;
double lon_rad = coord.longitude() * M_DEG_TO_RAD;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment