You will write three functions that read an orbit from one position and one speed. Distances are in AU, speeds in km/s, and for the Sun.
The idea. The vis-viva equation gives . The escape speed is . A speed below it gives an ellipse, equal to it a parabola, above it a hyperbola.
Your tasks.
escape_speed, return the escape speed at distance r.semi_major_axis, return from r and v. It is negative for a hyperbola.kind, return "ellipse", "parabola" or "hyperbola". Treat speeds within of escape as a parabola.Run your code once to unlock the worked solution.
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…