MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / get_new_coords

Function get_new_coords

pogom/transform.py:49–56  ·  view source on GitHub ↗

Given an initial lat/lng, a distance(in kms), and a bearing (degrees), this will calculate the resulting lat/lng coordinates.

(init_loc, distance, bearing)

Source from the content-addressed store, hash-verified

47
48
49def get_new_coords(init_loc, distance, bearing):
50 """
51 Given an initial lat/lng, a distance(in kms), and a bearing (degrees),
52 this will calculate the resulting lat/lng coordinates.
53 """
54 origin = geopy.Point(init_loc[0], init_loc[1])
55 destination = geopy.distance.distance(kilometers=distance).destination(origin, bearing)
56 return (destination.latitude, destination.longitude)

Callers 2

hex_boundsFunction · 0.85
_generate_locationsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected