# Sidereal time calculation from orbital elements and mean anomaly

I'm following the instructions given here for calculating the apparent position of the planets in the sky and I've come to calculating the sidereal time in section 1.8.

The formula for calculating the sidereal time at Greenwich at a given moment is given as: $$\Theta = M_E + \Omega_E + \omega_E + 15^\circ t$$ Where (all angles are in degrees) $M_E$ is the mean anomaly of the earth at that instant, $\Omega_E$ is the longitude of the ascending node for the Earth, $\omega_E$ is the argument of the periapsis for the Earth, and $t$ is the number of hours since the most recent midnight at Greenwich.

Where does this formula come from? I cannot find any other sources that use orbital elements to calculate sidereal times. Instead, they all appear to use 1st or 2nd order polynomials in $t$ with hardcoded coefficients to (approximately) calculate the sidereal time.

Recall that the sidereal time at a certain moment at a certain location is "equal to the right ascension that passes through the celestial meridian". In other words, the angle eastwards away from the vernal equinox. If we know the angle of Greenwich relative to midnight, and the angle of midnight relative to the vernal equinox, then we can calculate the sidereal time. Since $e \approx 0$, we can just directly add a bunch of orbital element angles (and use mean anomaly instead of true anomaly) to get those values. Because we can calculate the sidereal time just from angles that we already have, we don't really need the date here.
To elaborate: Suppose the Earth is in an orbit around the sun with $e = 0.01671$, $i = 0$, $\omega_E = 0$, $\Omega_E = 0$, and $M_E = 0$. For convenience, let's keep the Earth rotated so that it remains midnight at Greenwich. Then, right now, the Earth is at periapsis and at the ascending node in its orbit, with zenith at Greenwich pointing along the vernal equinox. So, by the definition of sidereal time, the sidereal time at Greenwich right now is 0°.
Then, rotate the orbit prograde so that the Earth + ascending node + periapsis are $\Omega_E$ degrees away from vernal equinox. Then push the periapsis + Earth a further $\omega_E$ degrees. Then, push the Earth a further $M_E$ degrees along its orbit. Then, rotate the Earth eastwards on its axis so that Greenwich is now rotated $15°t$ degrees away from midnight. So, it is now $t$ o'clock at Greenwich, and the sidereal time at Greenwich is now (approximately) $M_E + \Omega_E + \omega_E + 15°t$.