studio_geo_const.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*****************************************************************//**
  2. * \file studio_geo_const.h
  3. * \brief
  4. *
  5. * \author wangyingjie
  6. * \date April 2025
  7. *********************************************************************/
  8. #ifndef STUDIO_GEO_CONST_H
  9. #define STUDIO_GEO_CONST_H
  10. namespace EarthRadius
  11. {
  12. static constexpr double MEAN = 6371000.0; // 平均半径 米
  13. static constexpr double EQUATORIAL = 6378137.0; // 赤道半径 米
  14. static constexpr double POLAR = 6356752.3142; // 极地半径 米
  15. } // namespace EarthRadius
  16. namespace WGS84
  17. {
  18. static constexpr double A = 6378137.0; // 长半轴 米
  19. static constexpr double INVF = 298.257223563; // 扁率的倒数
  20. static constexpr double F = (1.0 / INVF); // 扁率
  21. static constexpr double B = (A * (1.0 - F)); // 短半轴
  22. static constexpr double E2 = (2 * F - F * F); // 第一偏心扁率的平方
  23. static constexpr double GM = 3.986004418e14; // 地心引力常数 立方米/秒的平方
  24. static constexpr double W = 7.2921151467e-5; // 自转角速度 弧度每秒
  25. static constexpr double J2 = 1.08262983226e-3;
  26. } // namespace WGS84
  27. namespace CGCS2000
  28. {
  29. // CGCS2000 大多数参数跟WGS84 一致
  30. static constexpr double A = 6378137.0;
  31. static constexpr double INVF = 298.257222101;
  32. static constexpr double F = (1.0 / INVF);
  33. static constexpr double B = (A * (1.0 - F));
  34. static constexpr double E2 = (2 * F - F * F);
  35. static constexpr double GM = 3.9860044181e14; // 地心引力常数 立方米/秒的平方
  36. static constexpr double W = 7.2921151467e-5; // 自转角速度 弧度每秒
  37. static constexpr double J2 = 1.08262983226e-3; // 重力场谐系数
  38. } // namespace CGCS2000
  39. namespace XIAN80
  40. {
  41. static constexpr double A = 6378140.0; // 长半轴
  42. static constexpr double INVF = 298.257; // 扁率的倒数
  43. static constexpr double F = (1.0 / INVF); // 扁率
  44. static constexpr double B = (A * (1.0 - F));
  45. static constexpr double E2 = (2 * F - F * F);
  46. } // namespace XIAN80
  47. namespace BEIJING54
  48. {
  49. static constexpr double A = 6378245.0; // 长半轴
  50. static constexpr double INVF = 298.3; // 扁率的倒数
  51. static constexpr double F = (1.0 / INVF); // 扁率
  52. static constexpr double B = (A * (1.0 - F));
  53. static constexpr double E2 = (2 * F - F * F);
  54. } // namespace BEIJING54
  55. #endif // STUDIO_GEO_CONST_H