Skip to content

Instantly share code, notes, and snippets.

View pedrocamargo's full-sized avatar
💭
OpenSourcy

Pedro Camargo pedrocamargo

💭
OpenSourcy
View GitHub Profile
@pedrocamargo
pedrocamargo / compassbearing.py
Created April 17, 2017 07:48 — forked from jeromer/compassbearing.py
compass bearing between two points in Python
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))
:Parameters:
- `pointA: The tuple representing the latitude/longitude for the