summaryrefslogtreecommitdiff
path: root/inst/geodetic2aer.m
diff options
context:
space:
mode:
Diffstat (limited to 'inst/geodetic2aer.m')
-rw-r--r--inst/geodetic2aer.m23
1 files changed, 10 insertions, 13 deletions
diff --git a/inst/geodetic2aer.m b/inst/geodetic2aer.m
index 6d8df9a..f1772c8 100644
--- a/inst/geodetic2aer.m
+++ b/inst/geodetic2aer.m
@@ -1,6 +1,6 @@
-## Copyright (c) 2014-2018 Michael Hirsch, Ph.D.
-## Copyright (c) 2013-2020 Felipe Geremia Nievinski
-## Copyright (C) 2020 Philip Nienhuis
+## Copyright (c) 2014-2022 Michael Hirsch, Ph.D.
+## Copyright (c) 2013-2022 Felipe Geremia Nievinski
+## Copyright (C) 2020-2022 Philip Nienhuis
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
@@ -73,7 +73,7 @@
## slantRange = 846.65
## @end example
##
-## @seealso {aer2geodetic, geodetic2ecef, geodetic2enu, geodetic2ned,
+## @seealso{aer2geodetic, geodetic2ecef, geodetic2enu, geodetic2ned,
## referenceEllipsoid}
## @end deftypefn
@@ -129,24 +129,21 @@ function [az, el, slantRange] = geodetic2aer (varargin)
if (! all (size (lat0) == size (lat)) || ...
! all (size (lon0) == size (lon)) || ...
! all (size (alt0) == size (alt)))
- error ("geodetic2aer: non-matching dimensions of geodetic locations \
-and AER target points");
+ error (["geodetic2aer: non-matching dimensions of geodetic locations ", ...
+ "and AER target points"]);
endif
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 (! ischar (angleUnit) || ! ismember (lower (angleUnit(1)), {"d", "r"}))
error ("geodetic2aer: angleUnit should be one of 'degrees' or 'radians'")
endif
- [e, n, u] = geodetic2enu (lat, lon, alt, lat0, lon0, alt0, spheroid, angleUnit);
+ [e, n, u] = geodetic2enu (lat, lon, alt, lat0, lon0, alt0, E, angleUnit);
[az, el, slantRange] = enu2aer (e, n, u, angleUnit);
endfunction