Polar Decomposition Calculator

Decompose a matrix A = UP into a unitary factor U and positive semi-definite factor P. View singular values, condition number, and geometric interpretation.

About the Polar Decomposition Calculator

The polar decomposition factors any square matrix A into the product A = UP, where U is a unitary (orthogonal) matrix and P is a positive semi-definite matrix. This is the matrix analogue of writing a complex number in polar form z = re^{iθ}, where r is the magnitude and e^{iθ} is the rotation. In the matrix version, P captures the "stretching" (analogous to r) and U captures the "rotation" (analogous to e^{iθ}).

For invertible matrices the decomposition is unique: P = √(AᵀA) is computed from the eigenvalues of the Gram matrix AᵀA, and U = AP⁻¹. When A is singular, the unitary factor may not be unique, but the positive factor P remains uniquely determined. The left polar decomposition A = P'U reverses the order and uses P' = √(AAᵀ) instead.

This calculator computes the right polar decomposition for 2×2 and 3×3 matrices. It displays the Gram matrix AᵀA, the positive semi-definite factor P, singular values, the condition number, and a geometric interpretation of what the decomposition means for the linear transformation defined by A. Load a preset or enter your own matrix to explore.

Why Use This Polar Decomposition Calculator?

The polar decomposition separates a linear transformation into its rotational and stretching components, making it essential in continuum mechanics (separating rigid rotation from deformation), computer graphics (interpolating between rotations), and numerical analysis (computing matrix square roots). Computing it by hand requires finding eigenvalues of AᵀA, taking square roots, and inverting — this calculator does it all instantly and shows every intermediate step.

How to Use This Calculator

  1. Select the matrix size (2×2 or 3×3)
  2. Enter the matrix entries or click a preset to load an example
  3. View the computed singular values and condition number in the output cards
  4. Examine the Gram matrix AᵀA and the positive factor P = √(AᵀA)
  5. Check the singular value spectrum bar chart for relative magnitudes
  6. Review the eigenvalue table for detailed breakdown
  7. Read the geometric interpretation table to understand what U and P do

Formula

Right polar decomposition: A = UP, where P = √(AᵀA) and U = AP⁻¹. Left polar decomposition: A = P'U, where P' = √(AAᵀ). Singular values σᵢ = √(λᵢ(AᵀA)).

Example Calculation

Result: Singular values: 5.372, 1.628; Condition number: 3.30

The symmetric matrix [[4,2],[2,3]] has eigenvalues 5 and 2, so singular values are √5 ≈ 2.236 and √2 ≈ 1.414. Since A is already symmetric positive definite, U = I (identity) and P = A.

Tips & Best Practices

The Mathematics of Polar Decomposition

Every square matrix A can be written as A = UP where U is unitary and P = √(AᵀA) is positive semi-definite. Computing P requires finding the eigenvalues λᵢ of the symmetric matrix AᵀA, then P has the same eigenvectors with eigenvalues √λᵢ. When A is invertible, U = AP⁻¹ is uniquely determined and satisfies UᵀU = I (orthogonal for real matrices). The decomposition extends to rectangular matrices via the SVD: if A = WΣVᵀ, then U = WVᵀ and P = VΣVᵀ.

Applications in Physics and Engineering

In solid mechanics, the deformation gradient tensor F maps material coordinates to spatial coordinates. The right polar decomposition F = RU separates the motion into a pure stretch U (the right stretch tensor) followed by a rigid rotation R. Engineers use this to distinguish elastic deformation from rigid body motion, which is essential for constitutive modeling. In fluid mechanics, similar decompositions of the velocity gradient help identify rotational vs. irrotational components of the flow.

Numerical Considerations

Computing the polar decomposition numerically requires care. The naive approach via eigendecomposition of AᵀA can lose accuracy when A is ill-conditioned. More robust methods include the iterative Higham algorithm: U_{k+1} = (U_k + U_k^{-T})/2, which converges quadratically to the unitary factor. The Newton-Schulz iteration avoids explicit inversion and is preferred for parallel implementations. For applications requiring high accuracy, such as rotation extraction in animation, these iterative methods are preferred over the SVD-based approach.

Frequently Asked Questions

What is the polar decomposition of a matrix?

It factors a square matrix A into A = UP, where U is unitary (preserves lengths) and P is positive semi-definite (stretches along principal axes). It is analogous to writing a complex number as z = r·e^{iθ}.

What is the difference between left and right polar decomposition?

The right decomposition is A = UP where P = √(AᵀA), meaning stretching happens first, then rotation. The left decomposition is A = P'U where P' = √(AAᵀ), meaning rotation happens first, then stretching. Both produce the same U.

When is the polar decomposition unique?

The positive semi-definite factor P is always unique. The unitary factor U is unique when A is invertible. When A is singular, U is not unique because there is freedom in how to map the null space.

How is the polar decomposition related to SVD?

If A = UΣVᵀ is the SVD, then the polar decomposition gives U_polar = UVᵀ and P = VΣVᵀ. The SVD provides a finer factorization that reveals the individual singular values and directions.

Where is polar decomposition used?

It is used in continuum mechanics to separate rigid body rotation from material deformation, in computer graphics for rotation interpolation, in robotics for analyzing rigid body motions, and in numerical methods for computing matrix square roots and logarithms. Use this as a practical reminder before finalizing the result.

What does the condition number tell me?

The condition number κ = σ_max / σ_min measures how much the matrix amplifies errors. A condition number near 1 means the transformation is well-behaved; a large condition number means small input changes can cause large output changes.

Related Pages