-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathradius.m
More file actions
41 lines (31 loc) · 896 Bytes
/
radius.m
File metadata and controls
41 lines (31 loc) · 896 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
function [RM,RN] = radius(lat)
% Ali Mohammadi_INS/GNSS
% radius: calculates meridian and normal radii of curvature.
%
% INPUT:
% lat, Nx1 latitude (rad).
%
% OUTPUT:
% RM, Nx1 meridian radius of curvature (m).
% RN, Nx1 normal radius of curvature (m).
%
% Output values preserve the precision of latitude, single or double
% precision.
%%
if (isa(lat,'single'))
a = single(6378137.0);
e = single(0.0818191908426);
e2 = e^2;
den = 1 - e2 .* single(sin(lat)).^2;
else
a = (6378137.0);
e = (0.0818191908426);
e2 = e^2;
den = 1 - e2 .* (sin(lat)).^2;
end
% Meridian radius of curvature: radius of curvature for north-south motion.
RM = a .* (1-e2) ./ (den).^(3/2);
% Normal radius of curvature: radius of curvature for east-west motion.
% AKA transverse radius.
RN = a ./ sqrt(den);
end