MapAround.CoordinateSystems.Transformations.Affine.Inverse C# (CSharp) Method

Inverse() public method

Creates the inverse transform of this object.
This method may fail if the transformation matrix is not invertible.
public Inverse ( ) : IMathTransform
return IMathTransform
        public override IMathTransform Inverse()
        {
            if (_inverseMatrix == null)
            {
                _inverseMatrix = _matrix.GetInverseMatrix();

                //values ​​may differ slightly from the exact, 
                //in which case check the affinity will not be passed, 
                //so set the value of the third column manually
                _inverseMatrix[0, 2] = 0;
                _inverseMatrix[1, 2] = 0;
                _inverseMatrix[2, 2] = 1;
            }

            _inverse = new Affine(_matrix, _inverseMatrix, !_isInverse);

            return _inverse;
        }