Horizontal to Equatorial Conversion - Code
HorizontalToEquatorial would be like EquatorialToHorizontal in reverse, something like this:

(x, y, z)_hor = rectangular form of (alt, az)

(x, y, z)_sid = (x, y, z)_hor rotated by geographic latitude

(ha, dec) = spherical form of (x, y, z)_sid

ra = local sidereal time - ha