Nikolay Sivov (@nsivov) commented about dlls/d2d1/factory.c:
- TRACE("matrix %p.\n", matrix);
- /* 2x2 matrix, _31 and _32 are ignored. */
- a1 = m[0][0] * m[0][0] + m[1][0] * m[1][0];
- a2 = m[0][1] * m[0][1] + m[1][1] * m[1][1];
- c = m[0][0] * m[0][1] + m[1][0] * m[1][1];
- /* Maximum scale factor refers to maximum value of |Mv|/|v| over all vectors, where |.| is vector length.
- That is defined as matrix spectral norm (see https://en.wikipedia.org/wiki/Matrix_norm, Spectral norm).
- Spectral norm equals to the maximum of the singular values s1, s2 for 2x2 matrix M
- s_i^2 = e_i where e_i (e1, e2) are eigenvalues of (transpose(M) * M)
- e1 + e2 = trace(transpose(M) * M) = a1 + a2
- e1 * e2 = det(transpose(M) * M) = a1 * a2 - c ^ 2.
- return sqrtf(0.5f *(a1 + a2 + sqrtf((a1 - a2) * (a1 - a2) + 4 * c * c)));
Sorry, I missed that it's been said already that this is based on singular values. We don't really need any references for common characteristics like that, mentioning what it's based on is enough information to look up details. Formulas are fine to keep of course, but let's remove the links. Sorry for the noise.