Sun 21 May 2017 03:42:39 PM UTC, comment #8:
Consider the following script:
The first 3 command give 1, which is wrong.
The last command fails with an error.
The reasons are:
isTranslation: the check is
check = all ((abs (abs (submatrix)  eye (this.Dimensionality)) < e^10)(:));
which is wrong  the 2nd abs should be removed. It should be
check = all ((abs(submatrix  eye (this.Dimensionality)) < e^10)(:));
Since I do not like those e^10, I would prefer
check = all (abs (submatrix  eye (this.Dimensionality)) < eps)(:));
or even
check = !any (abs (submatrix  eye (this.Dimensionality)) > 0)(:));
Explanation: submatrix should be the Identity matrix (in the accuracy limits), so maybe the check should be different for
the diagonal entries (which should be 1), and the nondiagonal
(which should be 0)
isRigid: The submatrix should be a rotation matrix, without
scale or shear, so its determinant should be 1:
check = abs ((det (submatrix)) 1) < eps;
isSimilarity: The submatrix should be a rotation matrix multiplied by constant, so the condition is something like
s2 = submatrix*submatrix';
ans = all((abs(s2  s2(1,1)eye(2)) < ones(2)eps)(:));
s2 should be the Identity Matrix multiplied by a constant.
When I do
a = invert(affine2d ([1 2 0; 3 4 0; 10 20 1]))
a.T(3,3)1 = 1.1102e016
so a.T(3,3) is not 1, and b = affine2d(a.T) fails.
there should be something like
this.T(:,3) = [0; 0; 1];
BTW, line 72 should be:
this.T = inv (this.T);
