  function [xE,yE] = Earth(t)
% (xE,yE) is the location of Earth at time t (days).
P = 147.1; A = 152.1; phi = 102*pi/180; Y = 365.24;
x = (P-A)/2 + ((P+A)/2)*cos((2*pi/Y)*t);
y = sqrt(P*A)*sin((2*pi/Y)*t);
c = cos(phi); s = sin(phi);
xE = c*x - s*y;
yE = s*x + c*y;

