GeographicLib::Geocentric 类的参数

解释说明:
Geocentric coordinates
Convert between geodetic coordinates latitude = lat, longitude = lon, height = h (measured vertically from the surface of the ellipsoid) to geocentric coordinates (X, Y, Z). The origin of geocentric coordinates is at the center of the earth. The Z axis goes thru the north pole, lat = 90°. The X axis goes thru lat = 0, lon = 0. Geocentric coordinates are also known as earth centered, earth fixed (ECEF) coordinates.
(地心坐标
将大地坐标纬度=纬度,经度=经度,高度= h(从椭球表面垂直测量)转换为地心坐标(X, Y, Z)。地心坐标的原点在地球的中心。Z轴穿过北极,纬度为90度。X轴经纬度为0,经度为0。地心坐标也被称为地球中心,地球固定(ECEF)坐标。)

引用方式
#include <GeographicLib/Geocentric.hpp>
Public Member Functions

	Geocentric (real a, real f)
 	Geocentric ()
void 	Forward (real lat, real lon, real h, real &X, real &Y, real &Z) const
 
void 	Forward (real lat, real lon, real h, real &X, real &Y, real &Z, std::vector< real > &M) const
 
void 	Reverse (real X, real Y, real Z, real &lat, real &lon, real &h) const
 
void 	Reverse (real X, real Y, real Z, real &lat, real &lon, real &h, std::vector< real > &M) const

Static Public Member Functions

static const Geocentric & 	WGS84 ()

Example of use:

// Example of using the GeographicLib::Geocentric class
#include <iostream>
#include <exception>
#include <cmath>
#include <GeographicLib/Geocentric.hpp>
using namespace std;
using namespace GeographicLib;
int main() {
  try {
    Geocentric earth(Constants::WGS84_a(), Constants::WGS84_f());
    // Alternatively: const Geocentric& earth = Geocentric::WGS84();
    {
      // Sample forward calculation
      double lat = 27.99, lon = 86.93, h = 8820; // Mt Everest
      double X, Y, Z;
      earth.Forward(lat, lon, h, X, Y, Z);
      cout << floor(X / 1000 + 0.5) << " "
           << floor(Y / 1000 + 0.5) << " "
           << floor(Z / 1000 + 0.5) << "\n";
    }
    {
      // Sample reverse calculation
      double X = 302e3, Y = 5636e3, Z = 2980e3;
      double lat, lon, h;
      earth.Reverse(X, Y, Z, lat, lon, h);
      cout << lat << " " << lon << " " << h << "\n";
    }
  }
  catch (const exception& e) {
    cerr << "Caught exception: " << e.what() << "\n";
    return 1;
  }
}
  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值