ENU2ECEFV convert from ENU to ECEF coordinates

Contents

Inputs

outputs

function [u, v, w] = enu2ecefv(east, north, up, lat0, lon0, angleUnit)
if nargin < 6
  angleUnit = 'd';
end

if strncmp(angleUnit, 'd', 1)
  lat0 = deg2rad(lat0);
  lon0 = deg2rad(lon0);
end

t = cos(lat0) .* up - sin(lat0) .* north;
w = sin(lat0) .* up + cos(lat0) .* north;

u = cos(lon0) .* t - sin(lon0) .* east;
v = sin(lon0) .* t + cos(lon0) .* east;

end