forked from QIJINCHEN/IMA-estimation
-
Notifications
You must be signed in to change notification settings - Fork 6
/
cne.m
30 lines (29 loc) · 1.04 KB
/
cne.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function C_ne = cne(lat, lon)
% -------------------------------------------------------------------------
%CNE The transformation matrix from local geodetic frame (n-frame) to
% ECEF frame (e-frame) -NED system
% C_ne = cne(lat, lon)
%
%INPUTS:
% 1. lat = latitude in radians
% 2. lat = longitude in radians
%OUTPUTS:
% C_ne = transformation matrix from n-frame to e-frame.
%
% Reference: R. M. Rogers, Applied mathematics in integrated navigation systems,
% 3rd ed. Reston, VA: American Institute of Aeronautics and
% Astronautics, 2007. pp57
% -------------------------------------------------------------------------
% Author:
% Qijin Chen, GNSS Research Center, Wuhan University, China.;
% chenqijin@whu.edu.cn;
% Nov. 2019;
% -------------------------------------------------------------------------
s_lat = sin(lat);
c_lat = cos(lat);
s_lon = sin(lon);
c_lon = cos(lon);
C_ne = [-s_lat*c_lon, -s_lon, -c_lat*c_lon;
-s_lat*s_lon, c_lon, -c_lat*s_lon;
c_lat, 0.0, -s_lat];
end