• 经纬高坐标转东北天坐标


    1 问题描述

    已知A、B两点的经度( λ \lambda λ)、纬度( ϕ \phi ϕ)和高度( h h h)分别为 ( λ 1 , ϕ 1 , h 1 ) (\lambda_1,\phi_1,h_1) (λ1,ϕ1,h1) ( λ 2 , ϕ 2 , h 2 ) (\lambda_2,\phi_2,h_2) (λ2,ϕ2,h2),以A点为东北天坐标系的原点,求B点在该坐标系下的坐标值。

    2 解决方案

    2.1 经纬高转ECEF

    在这里插入图片描述

    图1 经度和纬度示意图


    已知某点的经纬高坐标 ( λ , ϕ , h ) (\lambda, \phi, h) (λ,ϕ,h),通过公式(1)-(3)转换成ECEF坐标 ( X , Y , Z ) (X,Y,Z) (X,Y,Z)
    X = ( N + h ) c o s ϕ c o s λ (1) X = (N + h) cos \phi cos \lambda \tag{1} X=(N+h)cosϕcosλ(1)
    Y = ( N + h ) c o s ϕ s i n λ (2) Y = (N + h) cos \phi sin\lambda \tag{2} Y=(N+h)cosϕsinλ(2)
    Z = [ N ( 1 − e 2 ) + h ] s i n ϕ (3) Z = [N(1-e^2) + h]sin\phi \tag{3} Z=[N(1e2)+h]sinϕ(3)
    其中 e e e为椭圆偏心率, N N N是基准椭球体的卯酉曲率半径,这两个值可通过公式(4)-(5)来计算,
    e 2 = a 2 − b 2 a 2 (4) e^2 = \frac{a^2 - b^2}{a^2} \tag{4} e2=a2a2b2(4)
    N = a 1 − e 2 s i n 2 ϕ (5) N = \frac{a}{\sqrt{1-e^2sin^2 \phi}} \tag{5} N=1e2sin2ϕ a(5)
    其中 a a a为基准椭球体的长半径, b b b为基准椭球体的短半径。


    2.2 ECEF转东北天

    已知 A A A点的ECEF坐标为 ( X 1 , Y 1 , Z 1 ) (X_1,Y_1,Z_1) (X1,Y1,Z1),A点的经度为 λ 1 \lambda_1 λ1,A点的纬度为 ϕ 1 \phi_1 ϕ1;B点的 E C E F ECEF ECEF坐标为 ( X 2 , Y 2 , Z 2 ) (X_2,Y_2,Z_2) (X2,Y2,Z2);以A点为东北天坐标系的原点,求B点在该坐标系下的坐标。

    通过公式(6)-(8)求得A点 ( e 1 , n 1 , u 1 ) (e_1,n_1,u_1) (e1,n1,u1)和B点 ( e 2 , n 2 , u 2 ) (e_2,n_2,u_2) (e2,n2,u2)的坐标差值,
    e 2 − e 1 = − s i n λ 1 ⋅ ( X 2 − X 1 ) + c o s λ 1 ⋅ ( Y 2 − Y 1 ) (6) e_2-e_1=-sin\lambda_1 \cdot (X_2-X_1) + cos\lambda_1 \cdot (Y_2-Y_1) \tag{6} e2e1=sinλ1(X2X1)+cosλ1(Y2Y1)(6)
    n 2 − n 1 = − s i n ϕ 1 ⋅ c o s λ 1 ⋅ ( X 2 − X 1 ) − s i n ϕ 1 ⋅ s i n λ 1 ⋅ ( Y 2 − Y 1 ) + c o s ϕ 1 ⋅ ( Z 2 − Z 1 ) (7) n_2-n_1 = -sin\phi_1 \cdot cos\lambda_1 \cdot (X_2-X_1) - sin\phi_1 \cdot sin\lambda_1 \cdot (Y_2-Y_1) + cos\phi_1 \cdot (Z_2-Z_1) \tag{7} n2n1=sinϕ1cosλ1(X2X1)sinϕ1sinλ1(Y2Y1)+cosϕ1(Z2Z1)(7)
    u 2 − u 1 = c o s ϕ 1 ⋅ c o s λ 1 ⋅ ( X 2 − X 1 ) + c o s ϕ 1 ⋅ s i n λ 1 ⋅ ( Y 2 − Y 1 ) + s i n ϕ 1 ⋅ ( Z 2 − Z 1 ) (8) u_2-u_1 = cos\phi_1 \cdot cos\lambda_1 \cdot (X_2 - X_1) + cos\phi_1 \cdot sin\lambda_1 \cdot (Y_2-Y_1) + sin\phi_1 \cdot (Z_2 - Z_1) \tag{8} u2u1=cosϕ1cosλ1(X2X1)+cosϕ1sinλ1(Y2Y1)+sinϕ1(Z2Z1)(8)
    已知A点为原点,即 e 1 = 0 e_1 = 0 e1=0 n 1 = 0 n_1=0 n1=0 u 1 = 0 u_1=0 u1=0,则可求得 e 2 e_2 e2 n 2 n_2 n2 u 2 u_2 u2的值。

    2.3 代入求解

    2.3.1 东向化简

    代入 X 2 − X 1 X_2-X_1 X2X1的值和 Y 2 − Y 1 Y_2-Y_1 Y2Y1的值,公式(6)可写成,
    e 2 − e 1 = − s i n λ 1 ⋅ [ ( N + h 2 ) c o s ϕ 2 c o s λ 2 − ( N + h 1 ) c o s ϕ 1 c o s λ 1 ] + c o s λ 1 ⋅ [ ( N + h 2 ) c o s ϕ 2 s i n λ 2 − ( N + h 1 ) c o s ϕ 1 s i n λ 1 ] = ( N + h 2 ) c o s ϕ 2 ( s i n λ 2 s i n λ 1 − c o s λ 2 s i n λ 1 ) = ( N + h 2 ) c o s ϕ 2 s i n ( λ 2 − λ 1 ) (9) e2e1=sinλ1[(N+h2)cosϕ2cosλ2(N+h1)cosϕ1cosλ1]+cosλ1[(N+h2)cosϕ2sinλ2(N+h1)cosϕ1sinλ1]=(N+h2)cosϕ2(sinλ2sinλ1cosλ2sinλ1)=(N+h2)cosϕ2sin(λ2λ1)

    \tag{9} e2e1=sinλ1[(N+h2)cosϕ2cosλ2(N+h1)cosϕ1cosλ1]+cosλ1[(N+h2)cosϕ2sinλ2(N+h1)cosϕ1sinλ1]=(N+h2)cosϕ2(sinλ2sinλ1cosλ2sinλ1)=(N+h2)cosϕ2sin(λ2λ1)(9)
    由于点A和点B相隔较近,故经度差 λ 2 − λ 1 \lambda_2-\lambda_1 λ2λ1是一个极小量, s i n ( λ 2 − λ 1 ) ≈ ( λ 2 − λ 1 ) sin(\lambda_2-\lambda_1) \approx (\lambda_2 - \lambda_1) sin(λ2λ1)(λ2λ1)。那么 e 2 − e 1 e_2-e_1 e2e1可写成,
    e 2 − e 1 = ( N + h 2 ) c o s ϕ 2 ⋅ ( λ 2 − λ 1 ) (10) e_2-e_1 = (N+h_2)cos\phi_2 \cdot (\lambda_2- \lambda_1) \tag{10} e2e1=(N+h2)cosϕ2(λ2λ1)(10)

    2.3.2 北向化简

    代入 X 2 − X 1 X_2-X_1 X2X1 Y 2 − Y 1 Y_2-Y_1 Y2Y1 Z 2 − Z 1 Z_2-Z_1 Z2Z1的值,公式(7)可写成,
    n 2 − n 1 = − ( N + h 2 ) c o s ϕ 2 s i n ϕ 1 ( c o s λ 2 c o s λ 1 + s i n λ 2 s i n λ 1 ) + ( N + h 1 ) s i n ϕ 1 c o s ϕ 1 ( c o s 2 λ 1 + s i n 2 λ 1 ) + c o s ϕ 1 [ [ N ( 1 − e 2 ) + h 2 ] s i n ϕ 2 − [ N ( 1 − e 2 ) + h 1 ] s i n ϕ 1 ] (11) n2n1=(N+h2)cosϕ2sinϕ1(cosλ2cosλ1+sinλ2sinλ1)+(N+h1)sinϕ1cosϕ1(cos2λ1+sin2λ1)+cosϕ1[[N(1e2)+h2]sinϕ2[N(1e2)+h1]sinϕ1]

    \tag{11} n2n1=(N+h2)cosϕ2sinϕ1(cosλ2cosλ1+sinλ2sinλ1)+(N+h1)sinϕ1cosϕ1(cos2λ1+sin2λ1)+cosϕ1[[N(1e2)+h2]sinϕ2[N(1e2)+h1]sinϕ1](11)
    将地球近似处理成标准球体,即 e = 0 e=0 e=0
    c o s ϕ 1 [ [ N ( 1 − e 2 ) + h 2 ] s i n ϕ 2 − [ N ( 1 − e 2 ) + h 1 ] s i n ϕ 1 ] (12) cos\phi_1\Big[[N(1-e^2)+h_2]sin\phi_2-[N(1-e^2)+h_1]sin\phi_1\Big] \tag{12} cosϕ1[[N(1e2)+h2]sinϕ2[N(1e2)+h1]sinϕ1](12)
    可以化简为,
    ( N + h 2 ) s i n ϕ 2 c o s ϕ 1 − ( N + h 1 ) s i n ϕ 1 c o s ϕ 1 (13) (N+h_2)sin\phi_2cos\phi_1-(N+h_1)sin\phi_1cos\phi_1 \tag{13} (N+h2)sinϕ2cosϕ1(N+h1)sinϕ1cosϕ1(13)
    将式子(13)代入到公式(11)中,有,
    n 2 − n 1 = − ( N + h 2 ) c o s ϕ 2 s i n ϕ 1 c o s ( λ 2 − λ 1 ) + ( N + h 1 ) s i n ϕ 1 c o s ϕ 1 + ( N + h 2 ) s i n ϕ 2 c o s ϕ 1 − ( N + h 1 ) s i n ϕ 1 c o s ϕ 1 (14) n2n1=(N+h2)cosϕ2sinϕ1cos(λ2λ1)+(N+h1)sinϕ1cosϕ1+(N+h2)sinϕ2cosϕ1(N+h1)sinϕ1cosϕ1
    \tag{14}
    n2n1=(N+h2)cosϕ2sinϕ1cos(λ2λ1)+(N+h1)sinϕ1cosϕ1+(N+h2)sinϕ2cosϕ1(N+h1)sinϕ1cosϕ1(14)

    进一步化简,可得,
    n 2 − n 1 = − ( N + h 2 ) c o s ϕ 2 s i n ϕ 1 c o s ( λ 2 − λ 1 ) + ( N + h 2 ) s i n ϕ 2 c o s ϕ 1 (15) n2n1=(N+h2)cosϕ2sinϕ1cos(λ2λ1)+(N+h2)sinϕ2cosϕ1
    \tag{15}
    n2n1=(N+h2)cosϕ2sinϕ1cos(λ2λ1)+(N+h2)sinϕ2cosϕ1(15)

    由于A点和B点离得很近,经度差 λ 2 − λ 1 \lambda_2-\lambda_1 λ2λ1是极小量,故有 c o s ( λ 2 − λ 1 ) ≈ 1 cos(\lambda_2-\lambda_1)\approx1 cos(λ2λ1)1。那么 n 2 − n 1 n_2-n_1 n2n1可以进一步化简为,
    n 2 − n 1 = − ( N + h 2 ) c o s ϕ 2 s i n ϕ 1 + ( N + h 2 ) s i n ϕ 2 c o s ϕ 1 = ( N + h 2 ) ( s i n ϕ 2 c o s ϕ 1 − c o s ϕ 2 s i n ϕ 1 ) = ( N + h 2 ) s i n ( ϕ 2 − ϕ 1 ) (16) n2n1=(N+h2)cosϕ2sinϕ1+(N+h2)sinϕ2cosϕ1=(N+h2)(sinϕ2cosϕ1cosϕ2sinϕ1)=(N+h2)sin(ϕ2ϕ1)
    \tag{16}
    n2n1=(N+h2)cosϕ2sinϕ1+(N+h2)sinϕ2cosϕ1=(N+h2)(sinϕ2cosϕ1cosϕ2sinϕ1)=(N+h2)sin(ϕ2ϕ1)(16)

    由于A点和B点离得很近,纬度差 ϕ 2 − ϕ 1 \phi_2-\phi_1 ϕ2ϕ1是极小量,故 s i n ( ϕ 2 − ϕ 1 ) ≈ ϕ 2 − ϕ 1 sin(\phi_2-\phi_1)\approx \phi_2-\phi_1 sin(ϕ2ϕ1)ϕ2ϕ1。那么 n 2 − n 1 n_2-n_1 n2n1可以进一步化简为,
    n 2 − n 1 = ( N + h 2 ) ( ϕ 2 − ϕ 1 ) (17) n_2-n_1=(N+h_2)(\phi_2-\phi_1) \tag{17} n2n1=(N+h2)(ϕ2ϕ1)(17)

    2.3.3 天向化简

    X 2 − X 1 X_2-X_1 X2X1 Y 2 − Y 1 Y_2-Y_1 Y2Y1 Z 2 − Z 1 Z_2-Z_1 Z2Z1代入公式(8),有,
    u 2 − u 1 = ( N + h 2 ) c o s ϕ 1 c o s λ 1 c o s ϕ 2 c o s λ 2 − ( N + h 1 ) c o s 2 ϕ 1 c o s 2 λ 1 + ( N + h 2 ) c o s ϕ 1 s i n λ 1 c o s ϕ 2 s i n λ 2 − ( N + h 1 ) c o s 2 ϕ 1 s i n 2 λ 1 + s i n ϕ 1 [ [ N ( 1 − e 2 ) + h 2 ] s i n ϕ 2 − [ N ( 1 − e 2 ) + h 1 ] s i n ϕ 1 ] (18) u2u1=(N+h2)cosϕ1cosλ1cosϕ2cosλ2(N+h1)cos2ϕ1cos2λ1+(N+h2)cosϕ1sinλ1cosϕ2sinλ2(N+h1)cos2ϕ1sin2λ1+sinϕ1[[N(1e2)+h2]sinϕ2[N(1e2)+h1]sinϕ1]

    \tag{18} u2u1=++(N+h2)cosϕ1cosλ1cosϕ2cosλ2(N+h1)cos2ϕ1cos2λ1(N+h2)cosϕ1sinλ1cosϕ2sinλ2(N+h1)cos2ϕ1sin2λ1sinϕ1[[N(1e2)+h2]sinϕ2[N(1e2)+h1]sinϕ1](18)
    将地球近似成标准球体,有 e = 0 e=0 e=0,则
    s i n ϕ 1 [ [ N ( 1 − e 2 ) + h 2 ] s i n ϕ 2 − [ N ( 1 − e 2 ) + h 1 ] s i n ϕ 1 ] (19) sin\phi_1\Big[ [N(1-e^2)+h_2]sin\phi_2 - [N(1-e^2)+h_1]sin\phi_1 \Big] \tag{19} sinϕ1[[N(1e2)+h2]sinϕ2[N(1e2)+h1]sinϕ1](19)
    可化简为,
    ( N + h 2 ) s i n ϕ 2 s i n ϕ 1 − ( N + h 1 ) s i n 2 ϕ 1 (20) (N+h_2)sin\phi_2sin\phi_1-(N+h_1)sin^2\phi_1 \tag{20} (N+h2)sinϕ2sinϕ1(N+h1)sin2ϕ1(20)
    因此, u 2 − u 1 u_2-u_1 u2u1可以进一步化简为,
    u 2 − u 1 = ( N + h 2 ) [ c o s ϕ 1 c o s ϕ 2 ( c o s λ 1 c o s λ 2 + s i n λ 1 s i n λ 2 ) + s i n ϕ 2 s i n ϕ 1 ] − ( N + h 1 ) [ c o s 2 ϕ 1 ( c o s 2 λ 1 + s i n 2 λ 2 ) + s i n 2 ϕ 1 ] (21) u2u1=(N+h2)[cosϕ1cosϕ2(cosλ1cosλ2+sinλ1sinλ2)+sinϕ2sinϕ1](N+h1)[cos2ϕ1(cos2λ1+sin2λ2)+sin2ϕ1]
    \tag{21}
    u2u1=(N+h2)[cosϕ1cosϕ2(cosλ1cosλ2+sinλ1sinλ2)+sinϕ2sinϕ1](N+h1)[cos2ϕ1(cos2λ1+sin2λ2)+sin2ϕ1](21)

    继续化简,可得,
    u 2 − u 1 = ( N + h 2 ) [ c o s ϕ 1 c o s ϕ 2 c o s ( λ 2 − λ 1 ) + s i n ϕ 2 s i n ϕ 1 ] − ( N + h 1 ) (22) u2u1=(N+h2)[cosϕ1cosϕ2cos(λ2λ1)+sinϕ2sinϕ1](N+h1)
    \tag{22}
    u2u1=(N+h2)[cosϕ1cosϕ2cos(λ2λ1)+sinϕ2sinϕ1](N+h1)(22)

    由于A点和B点距离很近,因此经度差 λ 2 − λ 1 \lambda_2-\lambda_1 λ2λ1是一个极小量,有 c o s ( λ 2 − λ 1 ) ≈ 1 cos(\lambda_2-\lambda_1)\approx1 cos(λ2λ1)1,故 u 2 − u 1 u_2-u_1 u2u1可以化简为,
    u 2 − u 1 = ( N + h 2 ) ( c o s ϕ 1 c o s ϕ 2 + s i n ϕ 2 s i n ϕ 1 ) − ( N + h 1 ) = ( N + h 2 ) c o s ( ϕ 2 − ϕ 1 ) − ( N + h 1 ) (23) u2u1=(N+h2)(cosϕ1cosϕ2+sinϕ2sinϕ1)(N+h1)=(N+h2)cos(ϕ2ϕ1)(N+h1)
    \tag{23}
    u2u1==(N+h2)(cosϕ1cosϕ2+sinϕ2sinϕ1)(N+h1)(N+h2)cos(ϕ2ϕ1)(N+h1)(23)

    由于A点和B点距离很近,因此纬度差 ϕ 2 − ϕ 1 \phi_2-\phi_1 ϕ2ϕ1是一个极小量,有 c o s ( ϕ 2 − ϕ 1 ) ≈ 1 cos(\phi_2-\phi_1)\approx1 cos(ϕ2ϕ1)1,故 u 2 − u 1 u_2-u_1 u2u1可以继续化简为,
    u 2 − u 1 = ( N + h 2 ) − ( N + h 1 ) = h 2 − h 1 (24) u_2-u_1=(N+h_2)-(N+h_1)=h_2-h_1 \tag{24} u2u1=(N+h2)(N+h1)=h2h1(24)

    2.4 总结

    由2.3小节可知,在如下前提条件下,

    1. A点和B点的经度差 λ 2 − λ 1 \lambda_2-\lambda_1 λ2λ1是一个极小值,则有 s i n ( λ 2 − λ 1 ) ≈ ( λ 2 − λ 1 ) sin(\lambda_2-\lambda_1)\approx(\lambda_2-\lambda_1) sin(λ2λ1)(λ2λ1) c o s ( λ 2 − λ 1 ) ≈ 1 cos(\lambda_2-\lambda_1)\approx1 cos(λ2λ1)1
    2. A点和B点的纬度差 ϕ 2 − ϕ 1 \phi_2-\phi_1 ϕ2ϕ1是一个极小值,则有 s i n ( ϕ 2 − ϕ 1 ) ≈ ( ϕ 2 − ϕ 1 ) sin(\phi_2-\phi_1)\approx(\phi_2-\phi_1) sin(ϕ2ϕ1)(ϕ2ϕ1) c o s ( ϕ 2 − ϕ 1 ) ≈ 1 cos(\phi_2-\phi_1)\approx1 cos(ϕ2ϕ1)1
    3. 地球近似为标准球体,则有 e = 0 e=0 e=0

    可以得到如下解,
    e 2 − e 1 = ( N + h 2 ) c o s ϕ 2 ⋅ ( λ 2 − λ 1 ) n 2 − n 1 = ( N + h 2 ) ( ϕ 2 − ϕ 1 ) u 2 − u 1 = h 2 − h 1 (25) e2e1=(N+h2)cosϕ2(λ2λ1)n2n1=(N+h2)(ϕ2ϕ1)u2u1=h2h1

    \tag{25} e2e1n2n1u2u1=(N+h2)cosϕ2(λ2λ1)=(N+h2)(ϕ2ϕ1)=h2h1(25)


    更形象的理解,依据公式,
    l = R ⋅ θ (26) l = R \cdot \theta \tag{26} l=Rθ(26)
    其中 R R R为圆的半径, θ \theta θ为角度, l l l为该角度对应的弧长。

    将地球近似为标准球体,那么东向弧长 e 2 − e 1 e_2-e_1 e2e1等于半径 ( N + h 2 ) c o s ϕ 2 (N+h_2)cos\phi_2 (N+h2)cosϕ2乘以经度差值 ( λ 2 − λ 1 ) (\lambda_2-\lambda_1) (λ2λ1),北向弧长 n 2 − n 1 n_2-n_1 n2n1等于半径 ( N + h 2 ) (N+h_2) (N+h2)乘以纬度差值 ( ϕ 2 − ϕ 1 ) (\phi_2-\phi_1) (ϕ2ϕ1)

    天向差值 u 2 − u 1 u_2-u_1 u2u1等于高度差 h 2 − h 1 h_2-h_1 h2h1

  • 相关阅读:
    C++核心编程(三十四)容器(set/multiset)
    Tomcat为什么支持线程池?
    RTL8720DN开发笔记一 环境搭建与mqtt实例
    NGINX配置SSL支持
    结构体内存对齐详解
    【LeetCode】剑指 Offer Ⅱ 第8章:树(12道题) -- Java Version
    【C语言入门】ZZULIOJ 1026-1030
    git Husky
    【dyn_threshold_划痕检测】
    从零开始搭建一个组件库(二)
  • 原文地址:https://blog.csdn.net/YMWM_/article/details/126803846