You will write a small tool for an air traffic controller. Two aircraft leave one airport at the same moment, each with a speed in km/h and a bearing in degrees.
The idea. After hours each aircraft is kilometres from the airport. The angle between the tracks is the difference of the bearings, so the cosine rule gives the separation. The bearing of one from the other comes from east and north parts.
Your tasks.
separation(v1, b1, v2, b2, t). Return the distance between the aircraft after t hours, from the cosine rule.position(v, b, t). Return the pair (east, north) of an aircraft after t hours.bearing_between(v1, b1, v2, b2, t). Return the bearing of the second aircraft from the first, between and .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…