The polar decomposition is strongly related with the Singular Value Decomposition.
The SVD looks as follows:
$$A=U\mathrm{\Sigma}V^T$$
$$V\ contains\ the\ eigenvectors\ of\ A^TA\ as\ columns$$
$$U\ contains\ the\ eigenvectors\ of\ AA^T\ as\ columns$$
You do not need to calculate both $U$ and $V$, since they can be derived from the other:
$$(1)\ U=\left[\begin{matrix}|&|\\u_1&u_2\\|&|\\\end{matrix}\right]\ with\ u_i=\frac{Av_i}{\sigma_i}$$
$$(2)\ V=\left[\begin{matrix}|&|\\v_1&v_2\\|&|\\\end{matrix}\right]\ with\ v_i=\frac{A^Tu_i}{\sigma_i}$$
The polar decomposition looks as follows:
$$(3)\ A=\ \left(U\mathrm{\Sigma}U^{T}\right)\ \left(UV^T\right)=S_A\ R_\theta$$
$$(4)\ A=U\mathrm{\Sigma}V^T=\left(UV^T\right)\left(V\mathrm{\Sigma}V^T\right)={R_\theta} S_{AT}$$
So to calculate the polar decomposition you
- Calculate the eigenvalues $\lambda_i$ and eigenvectors $v_i$ of $A^TA$
- The matrix $\Sigma$ contains $\sigma_i=\sqrt{\lambda_i}$ on its diagonal
- Derive eigenvectors $u_i$ of $AA^T$ using (1)
- Now calculate $UV^T$
- if I am not mistaken $\left(V\mathrm{\Sigma}V^{T}\right)=A^TA$, so (3) can be completed
- Now you need to calculate $AA^T$ or $\left(U\mathrm{\Sigma}U^{T}\right)$, to complete (4)
A geometric analysis of polar decomposition can be found on Heaviside's Dinner.
An interactive geogebra plot can be found on the geogebra website: polar decomposition.