faster Matrix3 determinant and inverse lifted from cocos.euclid