A rigidtform2d object stores only rotation and translation information, and the shear 0.0004 exists in the T matrix above.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1173083/image.jpeg)
It is actually a robustness problem, Hopefully future versions enhance the double type of issue,caused by the following functions:
the constrained matrix is not within floating-point round-off error of the original matrix, then the original matrix is not a valid transformation matrix for the subclass.
function tf = matricesNearlyEqual(A,B)
% matricesNearlyEqual
% matricesNearlyEqual(A,B) returns true if A and B are the
% same, within floating-point round-off error. A and B are assumed to
% be square and of the same class, and this is not checked.
coder.inline('always');
coder.internal.prefer_const(A,B);
t = eps(class(A)) ^ (3/4);
R = max(norm(A),norm(B));
R0 = 100 * realmin(class(A)) / t;
R = max(R,R0);
tf = (norm(A - B) / R) <= t;
end