Skip to content

Commit 3510ebd

Browse files
committed
add eci2ecef and ecef2eci tests
fixes #1
1 parent 499b297 commit 3510ebd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_matlab.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,19 @@
170170
eci = [-2981784, 5207055, 3161595];
171171
[x, y, z] = eci2ecef(utc, eci(1), eci(2), eci(3));
172172
assert_allclose([x,y,z], [-5.7627e6, -1.6827e6, 3.1560e6], 0.02)
173-
173+
%% eci2ecef multiple
174+
utc = [2019, 1, 4, 12,0,0]; utc = [utc;utc];
175+
eci = [-2981784, 5207055, 3161595]; eci = [eci; eci];
176+
[x, y, z] = eci2ecef(utc, eci(:,1), eci(:,2), eci(:,3));
177+
assert_allclose([x(1,1), y(1,1), z(1,1)], [-5.7627e6, -1.6827e6, 3.1560e6], 0.02)
178+
assert_allclose([x(2,1), y(2,1), z(2,1)], [-5.7627e6, -1.6827e6, 3.1560e6], 0.02)
174179
%% ecef2eci
175180
ecef = [-5762640, -1682738, 3156028];
176181
utc = [2019, 1, 4, 12,0,0];
177182
[x,y,z] = ecef2eci(utc, ecef(1), ecef(2), ecef(3));
178183
assert_allclose([x,y,z], [-2.9818e6, 5.2070e6, 3.1616e6], 0.01)
179184

180-
%% ecef2eci multiple times
185+
%% ecef2eci multiple
181186
ecef = [-5762640, -1682738, 3156028]; ecef = [ecef; ecef];
182187
utc = [2019, 1, 4, 12, 0, 0]; utc = [utc; utc];
183188
[x,y,z] = ecef2eci(utc, ecef(:,1), ecef(:,2), ecef(:,3));

0 commit comments

Comments
 (0)