From 9359c388d108d3f8d67384405be7f724e4e0a8d4 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 27 Jul 2020 18:38:34 +1000 Subject: [PATCH] Add true north conversion function to IfcOpenShell geolocation util lib --- src/ifcopenshell-python/ifcopenshell/util/geolocation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/util/geolocation.py b/src/ifcopenshell-python/ifcopenshell/util/geolocation.py index b37402b98f..115bd659ef 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/geolocation.py +++ b/src/ifcopenshell-python/ifcopenshell/util/geolocation.py @@ -24,3 +24,7 @@ def xyz2enh(x, y, z, eastings, northings, orthogonal_height, x_axis_abscissa, x_ northings = (b * x) + (a * y) + northings height = z + orthogonal_height return (eastings, northings, height) + +# Used for converting the X and Y vectors of the X Axis in IFC geolocation +def xy2angle(x, y): + return math.degrees(math.atan2(y, x)) - 90