mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
refs #552 CCoordinateGeodetic: Using double precision in the conversion from n-vector to lat/lon.
This commit is contained in:
@@ -168,14 +168,12 @@ namespace BlackMisc
|
|||||||
|
|
||||||
CLatitude CCoordinateGeodetic::latitude() const
|
CLatitude CCoordinateGeodetic::latitude() const
|
||||||
{
|
{
|
||||||
const QVector3D v = this->normalVector();
|
return { std::atan2(m_z, std::hypot(m_x, m_y)), PhysicalQuantities::CAngleUnit::rad() };
|
||||||
return { std::atan2(v.z(), std::hypot(v.x(), v.y())), PhysicalQuantities::CAngleUnit::rad() };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CLongitude CCoordinateGeodetic::longitude() const
|
CLongitude CCoordinateGeodetic::longitude() const
|
||||||
{
|
{
|
||||||
const QVector3D v = this->normalVector();
|
return { std::atan2(m_y, m_x), PhysicalQuantities::CAngleUnit::rad() };
|
||||||
return { std::atan2(v.y(), v.x()), PhysicalQuantities::CAngleUnit::rad() };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector3D CCoordinateGeodetic::normalVector() const
|
QVector3D CCoordinateGeodetic::normalVector() const
|
||||||
|
|||||||
Reference in New Issue
Block a user