The intrinsic _rotatePoly function is meant to return a rotated version of a given polygon (with rotations specified in degrees counter-clockwise, despite the incorrect comment in mathUtil.ms). But it is actually distorting the polygon at some angles. In fact this can be seen even with a rotation of 0:
]p = [[0,0], [100,0], [100,10]]
]_rotatePoly(p, 0)
[[0, 0], [100, 0], [90, 10]]
Note how the last point is [90,10] rather than [100,10].
I'm not sure exactly what it's doing, but it's definitely not usable as it is.

The intrinsic
_rotatePolyfunction is meant to return a rotated version of a given polygon (with rotations specified in degrees counter-clockwise, despite the incorrect comment in mathUtil.ms). But it is actually distorting the polygon at some angles. In fact this can be seen even with a rotation of 0:Note how the last point is [90,10] rather than [100,10].
I'm not sure exactly what it's doing, but it's definitely not usable as it is.