From: Nebula
If both are anticlockwise, then it still works the same way I described it. Your compass is at -90, and since rotatepoints is anticlockwise, rotating by -90 (the positive value) will rotate the point to -180. So you have to rotate by the negative value (90) to return things to how they would be if the compass was north.
When compass is at west, the angle retrieved is 90 (or p/2 in rad), and RotatePoint will rotate the point by 90 anticlockwise, so the point go from north to west. Rotating it by -90 cause it to go east.
Eg.
writeln(RotatePoint(Point(0, 2), 3.142/2, 0,0));
returns (-2, 0), the negative x axis (west) which is correct.
Rotating it by -3.142/2 results in (2,0) (east), so i don't understand why i get the right box only when i rotate it by negative rs_GetCompassAngleRadians.
Anyway i tried out drawing lines today:

At good angles it draws out nicely, but it gets worse at diagonal compass. Apparently ReadySteadyGo managed to debug them nicely (
http://villavu.com/forum/showthread.php?t=72985), and he create his own point rotation functions, so i'd assume that Simba's RotatePoint is flawed? Box rotation also seems to behave differently during run time despite constant compass dir.
Function RotatePoint(Const p: TPoint; angle, mx, my: Extended): TPoint;
Begin
Result.X := Trunc(mx + cos(angle) * (p.x - mx) - sin(angle) * (p.y - my));
Result.Y := Trunc(my + sin(angle) * (p.x - mx) + cos(angle) * (p.y- my));
End;
ReadySteadyGo's: (i'm not sure how a rotation requires so much addition and subtraction)
m.Data := [Cos(r.y)*Cos(r.z), -Cos(r.x)*Sin(r.z) + Sin(r.x)*Sin(r.y)*Cos(r.z), Sin(r.x)*Sin(r.z)+Cos(r.x)*Sin(r.y)*Cos(r.z),
Cos(r.y)*Sin(r.z), Cos(r.x)*Cos(r.z) + Sin(r.x)*Sin(r.y)*Sin(r.z), -Sin(r.x)*Cos(r.z)+Cos(r.x)*Sin(r.y)*Sin(r.z),
-Sin(r.y), Sin(r.x)*Cos(r.y), Cos(r.x)*Cos(r.y)];
Also just checked out FindGapsTPA, it seems to be somewhat like SplitTPA?
FindGapsTPAWrap([Point(1,1),Point(2,2),Point(12,12),Point(3,3),Point(50,50),Point(5,5)],1,ATPA);
writeln(ATPA);
debug: [[(1, 1), (2, 2), (3, 3), (5, 5)], [(12, 12)], [(50, 50)]]
I'd retrieve the exact same result with SplitTPAWrap.