AER2ENU convert azimuth, elevation, range to ENU coordinates

Contents

Inputs

Outputs

function [e, n, u] = aer2enu (az, el, slantRange, angleUnit)
arguments
  az {mustBeReal}
  el {mustBeReal}
  slantRange {mustBeReal}
  angleUnit (1,1) string = "d"
end

if startsWith(angleUnit,'d')
  az = deg2rad(az);
  el = deg2rad(el);
end

u = slantRange .* sin(el);
r = slantRange .* cos(el);
e = r .* sin(az);
n = r .* cos(az);

end