Stonehenge is said to have been constructed as an astronomical observatory. Although we have no way of knowing whether that was the prime purpose of the structure, it did somehow serve an important function.
In his famous study of the monument, ‘Stonehenge Decoded’, Gerald Hawkins , used a computer to check the sight lines (lines of site running from different locations at Stonehenge that run through important points on the stones themselves) and their relation to important celestial objects, most notably the sun and the moon.
The fact that drew people’s attention to the idea that Stonehenge might have been built as an observatory was its similarity in the direction of the middle path at Stonehenge, known today as the Avenue to the Heel Stone, to the direction the sun is found in during the summer solstice. The summer solstice is the day during the year at which the sun reaches the highest distance above the horizon. It is also the time of year when the day is longest (assuming we exclude polar regions where daytime can extend for longer than 24 hours).
We cannot be totally sure that Stonehenge was built as an observatory because there are many different sightlines. If you have enough sightlines, then some of them are bound to line up with important celestial objects at one time of year or another. The most commonly used locations to line up with the stones are the 56 chalk pits noted by John Aubrey in 1666, now know as Aubrey Holes. With so many stones available to line up with so many holes, we can generate thousands of site lines.
An additional problem in checking the site lines is that some of them may have been based on wooden posts driven into the ground, which obviously are no longer present. Also when you find a site line that lines up with a celestial object today, you must realize that the object was in a different apparent location at the time that Stonehenge was built.
The fact that complex mathematics must have been used to compensate for the effects of the movements of the earth and the stars themselves, in order to account for their apparent positions at a given point in time, makes it less likely that amateur astronomers will accidentally discover what a particular site line was meant for. The fact that we don’t have the exact date that any given part of the monument was built, complicates the task even further.
In Conjunction with Seasons
However the fact that the main, central avenue almost lines up with the summer solstice, and the fact that the raised berm that Stonehenge is built upon (which helps compensates for geographic variations and other obstructions of the sky at the horizon), make most scholars agree that it was built as an astronomical observatory.
As you can see the task of figuring out the exact purpose of every site line at Stonehenge, is an enormous one that may take astronomers and archeologist many years of co-operation, if indeed they can ever fully unlock the puzzle.