If I have a point and a Matrix:
float point[] = new float[]{x,y};
Matrix matrix = new Matrix();
and call:
matrix.mapPoints(point);
how could I reverse the effects that matrix.mapPoints(point)
has on point
?
This isn't the actual application that I will use the answer for, but an answer for this will would work for what I need.
Thanks for any help.
If you don't want yourMatrix
to change
Matrix inverseCopy = new Matrix();
if(yourMatrix.invert(inverseCopy)){
inverseCopy.mapPoints(transformedPoint);
//Now transformedPoint is reverted to original state.
}
If you want yourMatrix
to change
if(yourMatrix.invert(yourMatrix)){
yourMatrix.mapPoints(transformedPoint);
//Now transformedPoint is reverted to original state.
}
matrix.invert()
returns false
if the matrix
cannot be inverted. If your matrix
cannot be inverted there is no way to revert your points to original state.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With