It seems calling inverse
on any non invertible transformation return the original transform without any warning.
In my code, a chaining of computation creates a non-invertible transformation, then the inverse is called.
During testing, I realized that multiplying one by its inverse doesn’t produce the identity.
I was expecting either nil
or an exception
, as testing the validity of the inverse this way is undocumented and bothersome.
this is my test code ?
log "offset_matrix :\n #{offset_matrix}"
log "offset_matrix inverse:\n #{offset_matrix.inverse}"
log "id = offset_matrix x offset_matrix.inverse:\n #{offset_matrix * offset_matrix.inverse}"
this is the result I get :
offset_matrix :
0.500 0.612 -0.612 0.000
-0.612 0.250 -0.250 0.000
0.612 -0.250 0.250 0.000
0.000 0.000 0.000 1.000
offset_matrix inverse:
0.500 0.612 -0.612 0.000
-0.612 0.250 -0.250 0.000
0.612 -0.250 0.250 0.000
0.000 0.000 0.000 1.000
id = offset_matrix x offset_matrix.inverse:
-0.500 0.612 -0.612 0.000
-0.612 -0.250 0.250 0.000
0.612 0.250 -0.250 0.000
0.000 0.000 0.000 1.000