mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
refs #395, added isInRange to ATC stations
* use null as default values for some members to detect those are not yet set * used simplified bool formatter for views
This commit is contained in:
committed by
Mathew Sutcliffe
parent
a3b147d59a
commit
3300b1ad9b
@@ -37,7 +37,7 @@ namespace BlackMisc
|
||||
|
||||
PhysicalQuantities::CLength calculateGreatCircleDistance(const ICoordinateGeodetic &coordinate1, const ICoordinateGeodetic &coordinate2)
|
||||
{
|
||||
// same coordinate results in 0 distance
|
||||
// same coordinates results in 0 distance
|
||||
if (coordinate1.latitude() == coordinate2.latitude() && coordinate1.longitude() == coordinate2.longitude())
|
||||
{
|
||||
return CLength(0, CLengthUnit::m());
|
||||
@@ -58,6 +58,7 @@ namespace BlackMisc
|
||||
double c = 2.0 * qAtan(qSqrt(a) / qSqrt(1.0 - a));
|
||||
double distance = earthRadiusM * c;
|
||||
|
||||
Q_ASSERT_X(distance >= 0, Q_FUNC_INFO, "distance < 0");
|
||||
return CLength(distance, CLengthUnit::m());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user