Polar Decomposition Calculator

Enter the four entries of a 2×2 matrix A to compute its polar decomposition A = QS, where Q is an orthogonal rotation/reflection matrix and S is a symmetric positive semi-definite stretch matrix.

Quick Facts

Decomposition
A = QS
Q is orthogonal (rotation/reflection); S is symmetric positive semi-definite (pure stretch).
Stretch factor
S = √(AᵀA)
The unique symmetric positive semi-definite square root of AᵀA.
Rotation factor
Q = A·S⁻¹
QᵀQ = I; det Q = +1 for a rotation, −1 if a reflection is included.
Uniqueness
Requires det A ≠ 0
Defined for any square matrix, but unique only when A is invertible.

Your Results

Calculated
Orthogonal factor Q
-
Rotation/reflection matrix, A = QS
Symmetric factor S
-
Stretch matrix, S = √(AᵀA)
Rotation angle of Q
-
θ = atan2(Q₂₁, Q₁₁)
Determinant of A
-
Sign matches sign of det Q

Ready

Enter the four matrix entries, then press Calculate.

Formula and Method for Polar Decomposition

The polar decomposition writes any square matrix A as the product A = QS, where Q is an orthogonal matrix (QᵀQ = I, a pure rotation or reflection) and S is a symmetric positive semi-definite matrix (a pure stretch along a set of perpendicular axes). It is the matrix generalization of writing a complex number in polar form, z = r·e^(iθ) — S plays the role of the magnitude r, and Q plays the role of the rotation e^(iθ). This calculator computes the decomposition for a general 2×2 real matrix A = [[a₁₁, a₁₂], [a₂₁, a₂₂]].

How the calculation works

First form M = AᵀA, which is always symmetric positive semi-definite. Its unique symmetric positive semi-definite square root S = √M is computed with the closed-form 2×2 identity S = (M + √det(M)·I) / √(tr(M) + 2√det(M)), which follows from the Cayley-Hamilton theorem (every 2×2 matrix satisfies its own characteristic equation, so its square root can be written as a linear combination of M and the identity I). Once S is known, the orthogonal factor is recovered as Q = A·S⁻¹, using the standard 2×2 inverse S⁻¹ = adj(S)/det(S). The rotation angle of Q is θ = atan2(Q₂₁, Q₁₁), and det(A) = det(Q)·det(S) tells you whether Q is a proper rotation (det Q = +1, so det A and det S share the same sign) or includes a reflection (det Q = −1).

Common mistakes

  • Confusing left and right polar decomposition: this calculator computes the "right" decomposition A = QS; the "left" form A = KQ (with K = √(AAᵀ)) uses the same Q but a generally different symmetric factor K = QSQᵀ.
  • Assuming Q is always a rotation: Q is only guaranteed to be orthogonal. If det(A) is negative, Q has determinant −1 and represents a rotation combined with a reflection, not a pure rotation.
  • Applying the formula to a singular matrix: when det(A) = 0, S is still well defined but is only positive semi-definite (not invertible), so Q = AS⁻¹ cannot be computed this way and the decomposition is no longer unique.

Real-world applications

  • Computer graphics and animation extract a clean rotation from an interpolated or skewed transform matrix by taking its Q factor, avoiding shearing artifacts.
  • Continuum mechanics uses polar decomposition of the deformation gradient to separate pure stretch (strain) from rigid-body rotation at a material point.
  • Robotics and biomechanics use it to find the best-fit rigid rotation between two sets of corresponding points (e.g., motion capture markers).
  • Numerical linear algebra uses the polar decomposition, computed via the SVD, to find the nearest orthogonal matrix to a given matrix — useful for re-orthogonalizing rotation matrices that have drifted from numerical error.

Frequently Asked Questions

What is the polar decomposition of a matrix?
The polar decomposition writes any square matrix A as A = QS, where Q is an orthogonal matrix (QᵀQ = I, representing a rotation or reflection) and S is a symmetric positive semi-definite matrix (representing a pure stretch). It is the matrix analog of writing a complex number as z = r·e^(iθ), separating magnitude/shape (S) from orientation (Q).
How is the stretch factor S computed?
S is the unique symmetric positive semi-definite square root of AᵀA, written S = √(AᵀA). For a 2×2 matrix M = AᵀA with determinant det(M) and trace tr(M), the square root has the closed form S = (M + √det(M)·I) / √(tr(M) + 2√det(M)), which follows from the Cayley-Hamilton theorem.
What does a negative determinant of A mean for Q?
The sign of det(A) equals the sign of det(Q). If det(A) is positive, Q is a proper rotation matrix (det Q = +1). If det(A) is negative, Q includes a reflection (det Q = -1), meaning A flips orientation in addition to stretching and rotating.
Does every matrix have a polar decomposition, and is it unique?
Every square matrix has at least one polar decomposition. When A is invertible (det A ≠ 0), the decomposition A = QS is unique, with S always positive definite. When A is singular, S is only positive semi-definite and Q is no longer uniquely determined, which is why this calculator requires det A ≠ 0.