A ship’s position as determined by the observation of celestial bodies is a traditional method with important advantages, such as reliability, independence and a low cost. Global satellite navigation systems, with many outstanding advantages in terms of accuracy and continuity, have become the main method of ship positioning in offshore navigation. Ship positioning using celestial body observation is still a backup method in the event of unusual incidents. Currently, during the daytime, it is only possible to apply the celestial navigation method to determine the ship’s position by observing the altitude of the sun. In order to reduce geometrical errors, this traditional method requires time for a certain change of the azimuth of the sun and therefore depends much on estimated errors and the effects of external conditions. Moreover, the basic requirement of the backup method is to provide a ship position quickly during offshore navigation, without the position being determined by a global satellite positioning system. To overcome the above limitations, the paper proposes a new approach to determine a ship's position by simultaneously observing the altitude and azimuth of the sun. A program for calculating the position of a ship with high reliability and applicability based on the new algorithm is also devised and shown to be highly effective in practice.