edit: I replaced minimap.pointsToMainscreen() with this in my PC script and it's a massive improvement. It's accurate ~90% of the time.
Got bored and started messing around.
(sorry for garbage quality vid)
I'm manually changing the compass angle while the script is running to show how it tracks at any angle.
This function should work pretty well on flat land. I haven't made a non-manual calibration process yet (and probably never will).
Simba Code:
function TPoint.MM2MS(): TPoint;
var
a, b, c, d, e, f, g, h: extended;
x: TExtendedArray;
begin
x := [
3.41898284234469, // a = fixed scale factor in X direction with scale Y unchanged.
-0.842020268789697, // b = scale factor in X direction proportional to Y distance from origin.
-2101.27407475151, // c = origin translation in X direction.
-0.0150738403260808, // d = scale factor in Y direction proportional to X distance from origin.
2.58817766359727, // e = fixed scale factor in Y direction with scale X unchanged.
-162.127294292026, // f = origin translation in Y direction.
-0.000237848858259821, // g = proportional scale factors X and Y in function of X.
-0.00286437539759803 // h = proportional scale factors X and Y in function of Y.
];
a := x[0]; b := x[1]; c := x[2]; d := x[3];
e := x[4]; f := x[5]; g := x[6]; h := x[7];
result.x := round((a*self.x + b*self.y +c)/(g*self.x + h*self.y +1));
result.y := round((d*self.x + e*self.y +f)/(g*self.x + h*self.y +1));
end;
This is where I got the method from:
http://www.corrmap.com/features/homo...sformation.php