You will write three small functions for a planet on an epicycle. The Earth is at the centre. Lengths are in units of the deferent's radius, and times are in years.
The idea. The epicycle's centre goes round the deferent in years, and the planet goes round the epicycle once a year. If is the epicycle radius, the planet is at
and its direction in the sky is the angle of the point .
Your tasks.
position, return the pair (x, y).direction, return the direction in degrees, using math.atan2(y, x).is_backwards, return True if the direction one day later is smaller.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…