Understanding the polar decomposition calculator — concept and principle
This calculator writes a square matrix A as A = U·P, where U is orthogonal (a rotation, possibly with a reflection) and P is symmetric positive semidefinite (a pure stretch). It also gives the left form A = P′·U, det(U), the rotation angle for 2 × 2 matrices and whether the decomposition is unique. It is used in linear algebra, continuum mechanics, computer graphics and robotics to separate rotation from deformation.
How it is calculated
- Compute the singular value decomposition A = W·Σ·Vᵀ.
- P = V·Σ·Vᵀ = √(AᵀA).
- U = W·Vᵀ.
- Left form: P′ = W·Σ·Wᵀ = √(AAᵀ), with the same U, so A = P′·U.
det(U) is +1 for a pure rotation and −1 if a reflection is included; it has the sign of det A. For a 2 × 2 rotation, the angle is atan2(U₂₁, U₁₁).
The principle
The polar decomposition is the matrix version of writing a complex number as z = e^(iθ)·r: a direction part times a size part. Any linear map first stretches space along perpendicular axes (P) and then rotates or reflects it (U). The SVD makes this explicit: Vᵀ turns the input to the stretch axes, Σ stretches, and W turns to the output. Grouping W·Vᵀ gives the rotation and V·Σ·Vᵀ gives the stretch expressed in the original axes. P is always unique; U is unique exactly when A is invertible.
Worked example
Default matrix: A = [2 −1; 1 3].
- AᵀA = [5 1; 1 10]. Its square root is P = [2.22834 0.185695; 0.185695 3.15682].
- The singular values are about 3.19258 and 2.19258 (det A = 7 = their product).
- U = A·P⁻¹ = [0.928477 −0.371391; 0.371391 0.928477].
- det(U) = +1, a rotation by atan2(0.371391, 0.928477) ≈ 21.8014°.
- P′ = [2.22834 −0.185695; −0.185695 3.15682]. A is invertible, so the decomposition is unique.
How to read the result
U tells you how much the matrix rotates (or reflects). The eigenvalues of P are the singular values, the stretch factors; its eigenvectors are the stretch directions. If P is close to the identity, A is almost a pure rotation. In mechanics, for a deformation gradient F = R·U, R is the rigid rotation and U the stretch tensor.
Common mistakes
- Confusing the right form U·P with the left form P′·U; U is the same but P differs.
- Expecting U to be unique for a singular matrix; it is not.
- Thinking P is diagonal; it is symmetric but usually not diagonal.
- Using it for non-square matrices, where only the SVD applies directly.
Frequently asked questions
How is polar decomposition related to SVD?
It is a regrouping of the SVD: U = W·Vᵀ and P = V·Σ·Vᵀ.
Can det(U) be −1?
Yes, when det A is negative; U then includes a reflection.
Why is P positive semidefinite?
It equals √(AᵀA), and AᵀA has non-negative eigenvalues, so its square root does too.
Sources: Wolfram MathWorld, "Singular Value" · Coordinated Linear Algebra (University of Nebraska–Lincoln), §7.7 Singular Value Decomposition