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

Function jitterLocation

pogom/search.py:50–55  ·  view source on GitHub ↗
(location=None, maxMeters=10)

Source from the content-addressed store, hash-verified

48
49# Apply a location jitter
50def jitterLocation(location=None, maxMeters=10):
51 origin = geopy.Point(location[0], location[1])
52 b = random.randint(0, 360)
53 d = math.sqrt(random.random()) * (float(maxMeters) / 1000)
54 destination = geopy.distance.distance(kilometers=d).destination(origin, b)
55 return (destination.latitude, destination.longitude, location[2])
56
57
58# Thread to handle user input

Callers 1

map_requestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected