pub fn inverse2<V: Float>(m: &[V; 4]) -> [V; 4]
Expand description
Find the inverse of a 2-by-2 matrix
Example
use geo_nd::vector::{length, sub};
use geo_nd::matrix::{identity2, inverse2, multiply2, MatrixType};
let i = identity2();
assert!( length(&sub(inverse2(&i), &i, 1.)) < 1E-8 );
for a in &[ [1.,0., 0.,1.],
[1.,0., 1.,1.],
[1.,2., 7.,2.] ] {
let a_inv = inverse2(&a);
assert!( length(&sub(multiply2(&a_inv,&a), &i, 1.)) < 1E-6 );
}