A planet starts from the Sun, moving at right angles to the line to the Sun at per year. That is slower than a circular orbit needs, so it falls inward on an ellipse. You will make the program step it forward with the law of gravitation, check Kepler's law of equal areas, and find its year.
The idea. In units of AU and years, for the Sun, and the pull gives . In each small step , the line to the Sun sweeps the triangle of area . Kepler's third law gives the year: , with half of the nearest plus farthest distance.
Your tasks.
a from the law of gravitation.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…