Fix bearings on road info, and German words for those

This commit is contained in:
Paul Bienkowski 2023-04-01 20:19:59 +02:00
parent dd72ed791f
commit 251be4a699
2 changed files with 12 additions and 10 deletions

View file

@ -18,14 +18,16 @@ round_speed = partial(round_to, multiples=0.1)
log = logging.getLogger(__name__)
def get_bearing(a, b):
def get_bearing(b, a):
# longitude, latitude
dL = b[0] - a[0]
X = numpy.cos(b[1]) * numpy.sin(dL)
Y = numpy.cos(a[1]) * numpy.sin(b[1]) - numpy.sin(a[1]) * numpy.cos(
b[1]
) * numpy.cos(dL)
return numpy.arctan2(X, Y)
return numpy.arctan2(Y, X) + 0.5 * math.pi
# Bins for histogram on overtaker distances. 0, 0.25, ... 2.25, infinity
DISTANCE_BINS = numpy.arange(0, 2.5, 0.25).tolist() + [float('inf')]

View file

@ -204,14 +204,14 @@ MapPage:
cardinalDirections:
unknown: unbekannt
north: nordwärts
northEast: nordostwärts
east: ostwärts
southEast: südostwärts
south: südwärts
southWest: südwestwärts
west: westwärts
northWest: nordwestwärts
north: Norden
northEast: Nordosten
east: Osten
southEast: Südosten
south: Süden
southWest: Südwesten
west: Westen
northWest: Nordwesten
regionInfo:
unnamedRegion: Unbenannte Region