veky
on Dec. 31, 2013, 2:25 a.m.
<p>Briefly (but not as briefly as the code, of course:)): extract numbers from matrix, calculate determinant, partially invert it mod 360, multiply cofactor matrix by constant target (divided by 45 for shortness:), quotient by gcd of det and 360, divide, lift the world back to Z_360, and reduce the answer to [-180,180>. Questions? :-)</p>