Skip to content

Commit

Permalink
Syntax error (#58)
Browse files Browse the repository at this point in the history
* don't reassign values; division in brackets

* new syntax
  • Loading branch information
KatKatKateryna authored Jul 23, 2024
1 parent c639fcb commit f4e7214
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public SOG.Point OffsetRotateOnSend(SOG.Point point)

// 1. offset coordinates
NormalizeAngle();
double x2 = point.x - LonOffset;
double y2 = point.y - LatOffset;
double x = point.x - LonOffset;
double y = point.y - LatOffset;
// 2. rotate coordinates
x2 = x2 * Math.Cos(TrueNorthRadians) + y2 * Math.Sin(TrueNorthRadians);
y2 = -x2 * Math.Sin(TrueNorthRadians) + y2 * Math.Cos(TrueNorthRadians);
double x2 = x * Math.Cos(TrueNorthRadians) + y * Math.Sin(TrueNorthRadians);
double y2 = -x * Math.Sin(TrueNorthRadians) + y * Math.Cos(TrueNorthRadians);
SOG.Point movedPoint = new(x2, y2, point.z, SpeckleUnitString);

return movedPoint;
Expand All @@ -72,7 +72,7 @@ private void NormalizeAngle()
{
if (TrueNorthRadians < -2 * Math.PI || TrueNorthRadians > 2 * Math.PI)
{
TrueNorthRadians = TrueNorthRadians % 2 * Math.PI;
TrueNorthRadians %= 2 * Math.PI;
}
}

Expand Down

0 comments on commit f4e7214

Please sign in to comment.