mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-24 09:54:16 +08:00
committed by
Mathew Sutcliffe
parent
229d7c6068
commit
978f3c88e5
@@ -21,112 +21,112 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Geo
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief Coordinate transformation class between different systems
|
||||
*/
|
||||
class CCoordinateTransformation
|
||||
{
|
||||
private:
|
||||
/*!
|
||||
* \brief Equatorial radius of WGS84 ellipsoid (6378137 m)
|
||||
* \return
|
||||
*/
|
||||
static const double &EarthRadiusMeters()
|
||||
namespace Geo
|
||||
{
|
||||
static double erm = 6378137.0;
|
||||
return erm;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Flattening of WGS84 ellipsoid (1/298.257223563)
|
||||
* \return
|
||||
*/
|
||||
static const double &Flattening()
|
||||
{
|
||||
static double f = 1.0 / 298.257223563;
|
||||
return f;
|
||||
}
|
||||
/*!
|
||||
* \brief Coordinate transformation class between different systems
|
||||
*/
|
||||
class CCoordinateTransformation
|
||||
{
|
||||
private:
|
||||
/*!
|
||||
* \brief Equatorial radius of WGS84 ellipsoid (6378137 m)
|
||||
* \return
|
||||
*/
|
||||
static const double &EarthRadiusMeters()
|
||||
{
|
||||
static double erm = 6378137.0;
|
||||
return erm;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief First eccentricity squared
|
||||
* \return
|
||||
*/
|
||||
static const double &e2()
|
||||
{
|
||||
static double e2 = (Flattening() * (2 - Flattening()));
|
||||
return e2;
|
||||
}
|
||||
/*!
|
||||
* \brief Flattening of WGS84 ellipsoid (1/298.257223563)
|
||||
* \return
|
||||
*/
|
||||
static const double &Flattening()
|
||||
{
|
||||
static double f = 1.0 / 298.257223563;
|
||||
return f;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief First eccentricity to power of four
|
||||
* \return
|
||||
*/
|
||||
static const double &e4()
|
||||
{
|
||||
static double e4 = BlackMisc::Math::CMath::square(e2());
|
||||
return e4;
|
||||
}
|
||||
/*!
|
||||
* \brief First eccentricity squared
|
||||
* \return
|
||||
*/
|
||||
static const double &e2()
|
||||
{
|
||||
static double e2 = (Flattening() * (2 - Flattening()));
|
||||
return e2;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief First eccentricity squared absolute
|
||||
* \return
|
||||
*/
|
||||
static const double &e2abs()
|
||||
{
|
||||
static double e2abs = qAbs(e2());
|
||||
return e2abs;
|
||||
}
|
||||
/*!
|
||||
* \brief First eccentricity to power of four
|
||||
* \return
|
||||
*/
|
||||
static const double &e4()
|
||||
{
|
||||
static double e4 = BlackMisc::Math::CMath::square(e2());
|
||||
return e4;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Eccentricity e2m
|
||||
* \return
|
||||
*/
|
||||
static const double &e2m()
|
||||
{
|
||||
static double e2m = BlackMisc::Math::CMath::square(1.0 - Flattening());
|
||||
return e2m;
|
||||
}
|
||||
/*!
|
||||
* \brief First eccentricity squared absolute
|
||||
* \return
|
||||
*/
|
||||
static const double &e2abs()
|
||||
{
|
||||
static double e2abs = qAbs(e2());
|
||||
return e2abs;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Default constructor, deleted
|
||||
*/
|
||||
CCoordinateTransformation();
|
||||
/*!
|
||||
* \brief Eccentricity e2m
|
||||
* \return
|
||||
*/
|
||||
static const double &e2m()
|
||||
{
|
||||
static double e2m = BlackMisc::Math::CMath::square(1.0 - Flattening());
|
||||
return e2m;
|
||||
}
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief NED to ECEF
|
||||
* \param ned
|
||||
* \return
|
||||
*/
|
||||
static CCoordinateEcef toEcef(const CCoordinateNed &ned);
|
||||
/*!
|
||||
* \brief Default constructor, deleted
|
||||
*/
|
||||
CCoordinateTransformation();
|
||||
|
||||
/*!
|
||||
* \brief Geodetic to ECEF
|
||||
* \param geo
|
||||
* \return
|
||||
*/
|
||||
static CCoordinateEcef toEcef(const CCoordinateGeodetic &geo);
|
||||
public:
|
||||
/*!
|
||||
* \brief NED to ECEF
|
||||
* \param ned
|
||||
* \return
|
||||
*/
|
||||
static CCoordinateEcef toEcef(const CCoordinateNed &ned);
|
||||
|
||||
/*!
|
||||
* \brief ECEF via Geodetic to NED
|
||||
* \param ecef
|
||||
* \param referencePosition
|
||||
* \return
|
||||
*/
|
||||
static CCoordinateNed toNed(const CCoordinateEcef &ecef, const CCoordinateGeodetic &referencePosition);
|
||||
/*!
|
||||
* \brief Geodetic to ECEF
|
||||
* \param geo
|
||||
* \return
|
||||
*/
|
||||
static CCoordinateEcef toEcef(const CCoordinateGeodetic &geo);
|
||||
|
||||
/*!
|
||||
* \brief ECEF to Geodetic
|
||||
* \param ecef
|
||||
* \return
|
||||
*/
|
||||
static CCoordinateGeodetic toGeodetic(const CCoordinateEcef &ecef);
|
||||
};
|
||||
/*!
|
||||
* \brief ECEF via Geodetic to NED
|
||||
* \param ecef
|
||||
* \param referencePosition
|
||||
* \return
|
||||
*/
|
||||
static CCoordinateNed toNed(const CCoordinateEcef &ecef, const CCoordinateGeodetic &referencePosition);
|
||||
|
||||
} // namespace
|
||||
/*!
|
||||
* \brief ECEF to Geodetic
|
||||
* \param ecef
|
||||
* \return
|
||||
*/
|
||||
static CCoordinateGeodetic toGeodetic(const CCoordinateEcef &ecef);
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user