After an unsuccessful attempt to solve Mars' motion, Kepler realized that he needed to determine the Earth's exact orbit. To do that, he developed an ingenious method based on four observations of Mars, carried out by Tycho at intervals of 687 days, i.e. Mars' sidereal period of revolution. Next, Kepler returned to his Mars problem and, although he thought planets were moved by a force inversely proportional to their distance from the Sun, he discovered the law today known as Kepler's Second Law. This states that the segment joining the planet to the Sun covers equal areas in equal intervals of time.
A new theory of Mars' motion, based on this law, gave calculated positions that were 8' (minutes of arc) different from the observed ones. This very small difference led Kepler to discover that Mars does not move on a circle, but along an oval-shaped trajectory, which he later realised was an ellipse. He had discovered the law, today known as Kepler's First Law: the orbits of the planets are ellipses, with the Sun at one focus. Kepler expounded these two laws in The New Astronomy (1609).
Later, Kepler established a Third Law, outlined in The Harmony of the World (1619): the squares of the periods of revolution of the planets are proportional to the cubes of the major semi-axes of their orbits.