mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Ref T372, avoid issues by calculating with null values
This commit is contained in:
@@ -52,6 +52,7 @@ namespace BlackMisc
|
||||
|
||||
CAngle calculateBearing(const ICoordinateGeodetic &coordinate1, const ICoordinateGeodetic &coordinate2)
|
||||
{
|
||||
if (coordinate1.isNull() || coordinate2.isNull()) { return CAngle::null(); }
|
||||
static const QVector3D northPole { 0, 0, 1 };
|
||||
const QVector3D c1 = QVector3D::crossProduct(coordinate1.normalVector(), coordinate2.normalVector());
|
||||
const QVector3D c2 = QVector3D::crossProduct(coordinate1.normalVector(), northPole);
|
||||
|
||||
Reference in New Issue
Block a user