From 251be4a6990d0f6fc06e5744c1d9cea191e0960b Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Sat, 1 Apr 2023 20:19:59 +0200 Subject: [PATCH] Fix bearings on road info, and German words for those --- api/obs/api/routes/mapdetails.py | 6 ++++-- frontend/src/translations/de.yaml | 16 ++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/api/obs/api/routes/mapdetails.py b/api/obs/api/routes/mapdetails.py index 40c6edc..ef82c74 100644 --- a/api/obs/api/routes/mapdetails.py +++ b/api/obs/api/routes/mapdetails.py @@ -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')] diff --git a/frontend/src/translations/de.yaml b/frontend/src/translations/de.yaml index aa0f57c..84149a4 100644 --- a/frontend/src/translations/de.yaml +++ b/frontend/src/translations/de.yaml @@ -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