Skip to content

Instantly share code, notes, and snippets.

View mapcloud's full-sized avatar

Aquabiota Solutions AB mapcloud

View GitHub Profile
foo bar baz
a 1
b 2
c
4
e 5
@mapcloud
mapcloud / compassbearing.py
Created July 27, 2017 12:50 — 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
@mapcloud
mapcloud / custom_gremlin_step_pyorient.py
Created June 8, 2017 09:01 — forked from lebedov/custom_gremlin_step_pyorient.py
Define and use custom step in Gremlin via pyorient.
#!/usr/bin/env python
"""
Define and use custom step in Gremlin via pyorient.
"""
from pyorient.ogm import Graph, Config
from pyorient.ogm.declarative import declarative_node, declarative_relationship
from pyorient.ogm.property import String