Polar Decomposition Calculator
Enter the entries of a real square matrix and this calculator returns its polar decomposition A = U P, where U is an orthogonal matrix (pure rotation or reflection) and P is a symmetric positive semi-definite matrix (pure stretch). The decomposition is computed via singular value decomposition (SVD). Results update as you type, and the step-by-step panel shows every stage of the working.
Formula
Worked example
For A = [[3,1],[2,4]]: SVD gives singular values sigma1 approx 5.099, sigma2 approx 1.961. U is the orthogonal factor (det close to +1), and P = V diag(sigma) V^T is symmetric positive definite. The residual ||A - UP|| is less than 1e-13.
What is the polar decomposition of a matrix?
Every real square matrix A can be written as A = U P, where U is an orthogonal matrix (U^T U = I, det(U) = +/-1) and P is a symmetric positive semi-definite matrix. This is called the polar decomposition, and it is the matrix analogue of writing a complex number z = r * e^{i*theta} in polar form: the magnitude r corresponds to the stretch factor P, and the angle theta corresponds to the rotation U. The decomposition is unique when A is invertible. When A is singular, U is still unique but P is not, though the semi-definite property is preserved.
How the calculator computes the decomposition
The calculation uses the singular value decomposition (SVD): A = W * Sigma * V^T, where W and V are orthogonal and Sigma is a diagonal matrix of singular values. The orthogonal factor is then U = W * V^T, and the positive semi-definite factor is P = V * Sigma * V^T. The columns of V are the eigenvectors of A^T A, and the diagonal entries of Sigma are the corresponding square roots of those eigenvalues, called singular values. The Jacobi iteration method is used here to diagonalise A^T A, which is numerically stable for small matrices.
Physical and engineering applications
In continuum mechanics, the polar decomposition of the deformation gradient F = R * U (right polar) or F = V * R (left polar) separates rigid-body rotation R from material stretch U or V. In computer graphics, animators use it to remove the rotational component from a transformation so that meshes deform smoothly without spinning artifacts. In machine learning and signal processing, polar decomposition is used to project a matrix onto the closest orthogonal matrix (the Stiefel manifold), which appears in orthogonal regularisation and in optimising rotation matrices in 3D pose estimation. In numerical linear algebra, it is a building block for computing the matrix square root and the matrix sign function.
Properties and verification
Three quick checks confirm a valid polar decomposition: (1) U^T U should equal the identity matrix - the reconstruction residual for this is displayed as det(U) being +1 or -1. (2) P must be symmetric: P = P^T. (3) All eigenvalues of P must be non-negative, which is guaranteed because they equal the singular values of A. The residual ||A - UP||_F shown in the results panel measures how accurately the factors reconstruct A and should be near machine epsilon (around 1e-14 for double precision). A non-zero residual signals a rank-deficient input matrix.
Interpreting the polar factors U and P
| Property | U (orthogonal factor) | P (positive semi-definite factor) |
|---|---|---|
| Columns are... | Orthonormal | Not necessarily orthogonal |
| Determinant | +1 (rotation) or -1 (reflection) | Product of singular values (>= 0) |
| Symmetry | Not symmetric in general | Always symmetric: P = Pᵀ |
| Eigenvalues | Lie on the unit circle | Equal to singular values of A (>= 0) |
| Inverse | U⁻¹ = Uᵀ | P⁻¹ exists iff A is invertible |
| Physical meaning | Rigid body rotation/reflection | Elastic stretch or compression |
| Uniqueness | Unique if A is invertible | Always unique |
Properties guaranteed by the polar decomposition theorem for any real square matrix.
Frequently asked questions
What is the difference between the right polar decomposition and the left polar decomposition?
The right polar decomposition writes A = U * P where U appears on the left. The left polar decomposition writes A = P2 * U where the orthogonal factor is on the right and P2 = U * P * U^T. Both decompositions use the same orthogonal factor U and the same singular values. This calculator computes the right polar form A = U * P. In continuum mechanics, the right form uses the right stretch tensor and the left form uses the left stretch tensor (often called V).
Is the polar decomposition unique?
Yes, if and only if A is invertible (all singular values are strictly positive). When A is singular, P is still unique, but U may not be - there can be multiple orthogonal matrices that satisfy A = U * P. For invertible A, the formula U = A * P^{-1} gives the unique U directly, and P = (A^T A)^{1/2} gives the unique positive definite P.
What does it mean if det(U) = -1?
A determinant of -1 means U is an improper orthogonal transformation: it includes a reflection in addition to (or instead of) a rotation. This happens whenever det(A) < 0. In applications where you need a pure rotation matrix (det = +1), you can force this by flipping the sign of the column of W corresponding to the smallest singular value before computing U = W * V^T. The calculator reports which case applies in the insight panel.
How is polar decomposition related to the SVD?
The SVD A = W * Sigma * V^T is the key computational step. Once the SVD is known, the polar decomposition follows immediately: U = W * V^T and P = V * Sigma * V^T. Every polar decomposition can be derived from the SVD, and the SVD provides a constructive proof that the polar decomposition exists for every real square matrix.
Why are the singular values the eigenvalues of P?
Substituting P = V * Sigma * V^T shows that P * V = V * Sigma, which is the eigenvector equation. The columns of V are the eigenvectors of P, and the corresponding eigenvalues are exactly the diagonal entries of Sigma - the singular values of A. Because Sigma has non-negative diagonal entries and V is orthogonal, P is always positive semi-definite.
Can this calculator handle complex matrices?
No - this tool works only with real matrices. For complex matrices, U would be a unitary matrix (U* U = I where * denotes the conjugate transpose) and P would be a Hermitian positive semi-definite matrix. The mathematics is analogous but the SVD computation requires complex arithmetic.