forked from QIJINCHEN/IMA-estimation
-
Notifications
You must be signed in to change notification settings - Fork 6
/
qne2bl.m
25 lines (25 loc) · 865 Bytes
/
qne2bl.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
function [lat, lon] = qne2bl(q_ne)
% -------------------------------------------------------------------------
%QNE2BL Compute latitude and longitude from the quaternion q_ne
% [lat, lon] = qne2bl(q_ne)
%
%INPUTS:
% q_ne = the quaternion q_ne
%OUTPUTS:
% 1. lat = latitude in radians
% 2. lat = longitude in radians
%
% Reference: E.-H. Shin, "Estimation techniques for low-cost inertial navigation,"
% PhD Thesis, Deparment of Geomatics Engineering, 2005.
% pp.23
%
% see also qne
% -------------------------------------------------------------------------
% Author:
% Qijin Chen, GNSS Research Center, Wuhan University, China.;
% chenqijin@whu.edu.cn;
% Nov. 2019;
% -------------------------------------------------------------------------
lat = -2*atan(q_ne(3)/q_ne(1))-pi/2;
lon = 2*atan2(q_ne(4), q_ne(1));
end