Careful measurement of the positions of the planets has led to a solid understanding of gravitational perturbations , and an ability to determine past and future positions of the planets with great accuracy , a field known as celestial mechanics .