HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Python Labs
  2. /Separation of two aircraft
MathematicsEasyHigh School (11–12)Trigonometry › Heights and Distances

Separation of two aircraft

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 ttt hours each aircraft is vtvtvt 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.

  1. Finish separation(v1, b1, v2, b2, t). Return the distance between the aircraft after t hours, from the cosine rule.
  2. Finish position(v, b, t). Return the pair (east, north) of an aircraft after t hours.
  3. Finish bearing_between(v1, b1, v2, b2, t). Return the bearing of the second aircraft from the first, between 000 and 360360360.

Run it first, just as it is. The checker at the end prints FAIL for each task. Then do the tasks one at a time, and run the program again after each one. A Hint appears under every check that still fails.

When every line says PASS, find the first time at which two aircraft on 065∘065^\circ065∘ at 480 km/h480\ \text{km/h}480 km/h and 140∘140^\circ140∘ at 360 km/h360\ \text{km/h}360 km/h are 1000 km1000\ \text{km}1000 km apart. Try values of t until you are close.

StemPy LabContributed by StemPy Lab
python
Loading Python runtime…

A worked solution

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 save
← All Labs
← A triangle solverFinding the best viewing distance →
More onTrigonometry › Heights and Distances

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Navigation with the sine and cosine rulesSine and Cosine Rules in Heights and Distances

More labs on this topic

  1. Tracking an aircraftEasy
  2. Finding the best viewing distanceEasy
  3. A triangle solverEasy
  4. A route planner with bearingsEasy
A height finder for two stationsEasy
All labs on this topic →