The electromechanical angle computer inside the B-52 bomber's star tracker

Before GPS, how did aircraft navigate? One important technique was celestial navigation: navigating from the positions of the stars, planets...