How to write a program in Python to calculate flight path