isOrthonormal function
Whether g's linear part is orthonormal (spec 09c W-8, S-10):
|a² + b² − 1|, |c² + d² − 1| and |ac + bd| each at most
Tolerance.standard.linear. A mirror is orthonormal; a scale is not.
Implementation
bool isOrthonormal(Transform2 g) {
final tol = Tolerance.standard.linear;
return (g.a * g.a + g.b * g.b - 1).abs() <= tol &&
(g.c * g.c + g.d * g.d - 1).abs() <= tol &&
(g.a * g.c + g.b * g.d).abs() <= tol;
}