ECEF2ECI_NAIVE rotate ECEF coordinates to ECI

because this doesn't account for nutation, etc. error is generally significant

Contents

Inputs

x0, y0, z0: ECEF position (meters) utc: time UTC

Outputs

function [x,y,z] = ecef2eci_naive(utc, x0, y0, z0)
arguments
  utc (:,1) datetime
  x0 (:,1) {mustBeReal,mustBeEqualSize(utc,x0)}
  y0 (:,1) {mustBeReal,mustBeEqualSize(utc,y0)}
  z0 (:,1) {mustBeReal,mustBeEqualSize(utc,z0)}
end

% Greenwich hour angles (radians)
gst = matmap3d.greenwichsrt(juliandate(utc));

% Convert into ECEF
x = nan(like=gst);
y = nan(like=gst);
z = nan(like=gst);

for j = 1:length(x)
  eci = matmap3d.R3(gst(j)).' * [x0(j), y0(j), z0(j)].';
  x(j) = eci(1);
  y(j) = eci(2);
  z(j) = eci(3);
end
end