From e8bfa581e79db2f5de7af8e064c857f800ddd727 Mon Sep 17 00:00:00 2001 From: KatKatKateryna Date: Sat, 29 Jun 2024 14:29:52 +0100 Subject: [PATCH] minor comments --- .../Utils/CRSoffsetRotation.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CRSoffsetRotation.cs b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CRSoffsetRotation.cs index 4aaedc6559..746f11e3a8 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CRSoffsetRotation.cs +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CRSoffsetRotation.cs @@ -21,16 +21,15 @@ public SOG.Point OffsetRotateOnReceive(SOG.Point point) string originalUnits = point.units; point = ScalePoint(point, originalUnits, SpeckleUnitString); + // rotate coordinates NormalizeAngle(); double x2 = point.x * Math.Cos(TrueNorthRadians) - point.y * Math.Sin(TrueNorthRadians); double y2 = point.x * Math.Sin(TrueNorthRadians) + point.y * Math.Cos(TrueNorthRadians); + // offset coordinates x2 += LonOffset; y2 += LatOffset; SOG.Point movedPoint = new(x2, y2, point.z, SpeckleUnitString); - // scale back to original units - // movedPoint = ScalePoint(movedPoint, SpeckleUnitString, originalUnits); - return movedPoint; } @@ -40,17 +39,15 @@ public SOG.Point OffsetRotateOnSend(SOG.Point point) string originalUnits = point.units; point = ScalePoint(point, originalUnits, SpeckleUnitString); - // rotate and move point + // rotate coordinates NormalizeAngle(); double x2 = point.x - LonOffset; double y2 = point.y - LatOffset; + // offset coordinates x2 = x2 * Math.Cos(TrueNorthRadians) + y2 * Math.Sin(TrueNorthRadians); y2 = -x2 * Math.Sin(TrueNorthRadians) + y2 * Math.Cos(TrueNorthRadians); SOG.Point movedPoint = new(x2, y2, point.z, SpeckleUnitString); - // scale back to original units - // movedPoint = ScalePoint(movedPoint, SpeckleUnitString, originalUnits); - return movedPoint; }