A matrix used in robot geometry can contain rotation, stretching, and shear at the same time. Calling its columns direction vectors does not make them a perpendicular frame. The right polar decomposition gives a precise separation: A = QH, where Q is orthogonal and H is symmetric positive semidefinite. When A is a nonsingular real square matrix, H is positive definite and both factors are unique. The distinction is useful when analyzing a mathematical transformation that should be compared with a rigid orientation.
This article works through a small invented matrix rather than reporting calibration results. SciPy documents the right and left factorizations, and Nicholas Higham explains the square-root construction and nearest-orthogonal property. The numerical example, comparisons, and direct optimization below are independently constructed. No calibration device or polar-decomposition software was run.
A matrix whose columns expose the problem
Take the dimensionless transformation A = [[2, 1], [0, 1]]. Its first column is (2, 0), and its second is (1, 1). Independently normalizing them produces the columns (1, 0) and (1/sqrt(2), 1/sqrt(2)). Both now have length one, but their dot product is 1/sqrt(2). They remain nonperpendicular. Column normalization removes individual column lengths without removing the relationship between the columns.
For this A, define Q = [[3, 1], [-1, 3]]/sqrt(10) and H = [[6, 2], [2, 4]]/sqrt(10). Multiplying Q transpose by Q gives the identity: the diagonal numerators are 10, and the off-diagonal numerators cancel. Its determinant is (9 + 1)/10 = 1, so this particular orthogonal factor is a proper rotation. Its angle is negative arctan(1/3), approximately -18.434949 degrees.
H is symmetric. Its first leading principal entry is positive, and its determinant is (24 - 4)/10 = 2, so it is positive definite. Direct multiplication gives QH = [[20, 10], [0, 10]]/10 = A. These checks establish the proposed decomposition without asking a numerical library to choose the factors.
Why a matrix square root appears
Starting from A = QH, form A transpose A. Orthogonality removes Q, leaving H squared. In this example, A transpose A = [[4, 2], [2, 2]]. Squaring our H produces [[40, 20], [20, 20]]/10, exactly the same matrix. Thus H is the symmetric positive definite square root of A transpose A.
The square root here is a matrix operation. Taking the square root of each entry separately would generally fail the requirement that multiplying the resulting matrix by itself recovers A transpose A. The operation must preserve the transformation's coupled directions, including the off-diagonal terms. After H is found, Q = A times the inverse of H.
This also explains the right-factor interpretation. An input vector x first becomes Hx, and Q then rotates that stretched vector. H describes stretch in the input coordinate system. It is not generally legitimate to swap the two factors merely because one has been named rotation and the other stretch.
Nearest in a declared matrix distance
The squared Frobenius distance is the sum of the squared differences between corresponding entries. For our A and any planar proper rotation R(theta), expanding that sum gives 8 - 2[3 cos(theta) - sin(theta)]. The bracket is at most sqrt(10), attained when cos(theta) = 3/sqrt(10) and sin(theta) = -1/sqrt(10). This recovers Q directly from a one-variable optimization.
The minimum squared distance is therefore 8 - 2 sqrt(10), approximately 1.675444680. The identity matrix has squared distance 2 from A. Both the identity and Q are perfectly orthogonal, but Q is the closer one by this entrywise squared-error criterion. The improvement is a statement about this defined objective, not evidence that a particular robot's orientation error has been corrected.
QR answers a different question
A already is upper triangular with positive diagonal entries. Consequently, A = I times A is its QR factorization under the usual positive-diagonal convention. QR provides an orthogonal factor and a triangular factor; it does not require the second factor to be symmetric stretch. Here its orthogonal factor is the identity, which our explicit distance calculation shows is farther from A than the polar factor.
Neither result is an arithmetic mistake. The factorizations impose different structural conditions. Replacing a polar decomposition with QR solely because both return an orthogonal matrix changes the mathematical question. Likewise, normalizing columns does not even guarantee the orthogonality both factorizations provide.
Left stretch and proper-rotation limits
The same A also has a left polar form A = KQ. Multiplication gives K = A Q transpose = [[7, 1], [1, 3]]/sqrt(10). This K is symmetric, but it differs from H. It describes stretch in the output coordinate system, after the orientation has been changed. Both KQ and QH recover A; HQ generally does not.
An orthogonal factor is not automatically a proper rotation for every possible input. For example, diag(1, -1) is orthogonal with determinant -1 and represents a reflection. Its polar orthogonal factor remains that reflection. Constraining an answer to determinant +1 is an additional optimization requirement. Our example has positive determinant, so its Q needs no such distinction in the calculation, but the general terminology still matters.
Singular inputs introduce another boundary: the symmetric factor remains defined, while a full orthogonal factor can cease to be unique. The inverse-H construction used above requires nonsingularity. These model conditions should be checked before treating a factor as a unique orientation.
Sources checked October 24, 2026: SciPy's polar reference and Nicholas Higham's article linked below support the definitions and general properties. The displayed matrix and all numerical comparisons are original educational calculations. Concept illustration: robotics imagery provides context and does not depict a measured stretch, calibration outcome, or executed algorithm.
Reference links:
SciPy: scipy.linalg.polar: https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.polar.html
Nicholas Higham: What Is the Polar Decomposition?: https://nhigham.com/2020/07/28/what-is-the-polar-decomposition/