Skip to content

Instantly share code, notes, and snippets.

View Mehmetulas98's full-sized avatar
🏠
Working from home

Mehmetulas98

🏠
Working from home
View GitHub Profile
@Mehmetulas98
Mehmetulas98 / compassbearing.py
Created March 3, 2022 13:24 — forked from jeromer/compassbearing.py
compass bearing between two points in Python
# LICENSE: public domain
def calculate_initial_compass_bearing(pointA, pointB):
"""
Calculates the bearing between two points.
The formulae used is the following:
θ = atan2(sin(Δlong).cos(lat2),
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong))