summaryrefslogtreecommitdiff
path: root/inst/geodetic2ecef.m
diff options
context:
space:
mode:
Diffstat (limited to 'inst/geodetic2ecef.m')
-rw-r--r--inst/geodetic2ecef.m11
1 files changed, 4 insertions, 7 deletions
diff --git a/inst/geodetic2ecef.m b/inst/geodetic2ecef.m
index af45692..132402b 100644
--- a/inst/geodetic2ecef.m
+++ b/inst/geodetic2ecef.m
@@ -1,4 +1,4 @@
-## Copyright (C) 2018-2020 Philip Nienhuis
+## Copyright (C) 2018-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 the Free Software
@@ -128,13 +128,10 @@ function [X, Y, Z] = geodetic2ecef (varargin)
error ("geodetic2ecef: angleUnit should be one of 'degrees' or 'radians'")
endif
- if (isempty (spheroid))
- E = wgs84Ellipsoid;
- elseif (isstruct (spheroid))
- E = spheroid;
- else
- E = referenceEllipsoid (spheroid);
+ if (isnumeric (spheroid))
+ spheroid = num2str (spheroid);
endif
+ E = sph_chk (spheroid);
if (strncmpi (lower (angleUnit), "r", 1) == 1)
c_p = cos (lat);