Skip to content

Commit

Permalink
minor comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KatKatKateryna committed Jun 29, 2024
1 parent b2d59d8 commit e8bfa58
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit e8bfa58

Please sign in to comment.