summaryrefslogtreecommitdiff
path: root/inst/ned2ecef.m
diff options
context:
space:
mode:
Diffstat (limited to 'inst/ned2ecef.m')
-rw-r--r--inst/ned2ecef.m15
1 files changed, 6 insertions, 9 deletions
diff --git a/inst/ned2ecef.m b/inst/ned2ecef.m
index ac63daa..7a073bb 100644
--- a/inst/ned2ecef.m
+++ b/inst/ned2ecef.m
@@ -1,4 +1,4 @@
-## Copyright (C) 2020 Philip Nienhuis
+## Copyright (C) 2022 Philip Nienhuis
##
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
@@ -127,18 +127,15 @@ function [x, y, z] = ned2ecef (varargin)
if (! all (size (lat) == size (e)) || ...
! all (size (lon) == size (n)) || ...
! all (size (alt) == size (u)))
- error ("ned2ecef: non-matching dimensions of observer points and \
-target points");
+ error (["ned2ecef: non-matching dimensions of observer points and ", ...
+ "target points"]);
endif
endif
- if (isempty (spheroid))
- E = wgs84Ellipsoid;
- elseif (isstruct (spheroid))
- E = spheroid;
- elseif (ischar (spheroid))
- E = referenceEllipsoid (spheroid);
+ if (isnumeric (spheroid))
+ spheroid = num2str (spheroid);
endif
+ E = sph_chk (spheroid);
[x, y, z] = enu2ecef (e, n, -u, lat, lon, alt, E, angleUnit);