The earliest applications of trigonometry were in the fields of navigation, surveying, and astronomy, in which the main problem generally was to determine an inaccessible distance, such as the distance between the earth and the moon, or of a distance that could not be measured directly, such as the distance across a large lake. Other applications of trigonometry are found in physics, chemistry, and almost all branches of engineering, particularly in the study of periodic phenomena, such as vibration studies of sound, a bridge, or a building, or the flow of alternating current.