Maths WorkshopMaths problems with full solutions
Exercise 1460Topology › Topology of Mn(ℝ) › Applications and the case n = 2L3Added 10 Nov 2026

The distance from a 2×2 matrix to the rotation group

#nearest rotation#Frobenius norm#SO(2)#M2(R)#Procrustes

Statement

Identify R2\mathbb{R}^2 with C\mathbb{C} and write A∈M2(R)A\in M_2(\mathbb{R}) as Ax=zx+wxˉAx=zx+w\bar x with z=(a+d)+i(c−b)2z=\frac{(a+d)+i(c-b)}2, w=(a−d)+i(b+c)2w=\frac{(a-d)+i(b+c)}2 for A=(abcd)A=\begin{pmatrix}a&b\\c&d\end{pmatrix}. Recall that A↦(z,w)A\mapsto(z,w) is linear, that ∥A∥F2=2(∣z∣2+∣w∣2)\|A\|_F^2=2(|z|^2+|w|^2), and that the rotation RαR_\alpha has coordinates (eiα,0)(e^{i\alpha},0). Show that
min⁡R∈SO(2)∥A−R∥F2=2((∣z∣−1)2+∣w∣2),\min_{R\in SO(2)}\|A-R\|_F^2=2\Bigl((|z|-1)^2+|w|^2\Bigr),
and find the nearest rotation(s).

Hint

By linearity, A−RαA-R_\alpha has coordinates (z−eiα,w)(z-e^{i\alpha},w), so ∥A−Rα∥F2=2(∣z−eiα∣2+∣w∣2)\|A-R_\alpha\|_F^2=2\bigl(|z-e^{i\alpha}|^2+|w|^2\bigr). Minimise ∣z−eiα∣|z-e^{i\alpha}| over α\alpha.

Show solutionHide solution

Solution

Idea. In the coordinates (z,w)(z,w) the Frobenius norm is Euclidean (up to the factor 2\sqrt2), so the nearest rotation to AA is the nearest point of the circle {(eiα,0)}\{(e^{i\alpha},0)\} to the point (z,w)(z,w).

Step 1: the squared distance. A−RαA-R_\alpha has coordinates (z−eiα, w)(z-e^{i\alpha},\,w) since A↦(z,w)A\mapsto(z,w) is linear. Hence
∥A−Rα∥F2=2(∣z−eiα∣2+∣w∣2).\|A-R_\alpha\|_F^2=2\bigl(|z-e^{i\alpha}|^2+|w|^2\bigr).

Step 2: minimise over α\alpha. For any α\alpha, the reverse triangle inequality gives ∣z−eiα∣≥∣∣z∣−∣eiα∣∣=∣∣z∣−1∣|z-e^{i\alpha}|\ge\bigl||z|-|e^{i\alpha}|\bigr|=\bigl||z|-1\bigr|. Equality holds iff eiαe^{i\alpha} and zz are positively proportional, i.e. eiα=z/∣z∣e^{i\alpha}=z/|z| when z≠0z\ne0. When z=0z=0 we have ∣0−eiα∣=1=∣0−1∣|0-e^{i\alpha}|=1=|0-1| for all α\alpha, so the bound is attained for every α\alpha. Therefore
min⁡α∥A−Rα∥F2=2((∣z∣−1)2+∣w∣2).\min_\alpha\|A-R_\alpha\|_F^2=2\Bigl((|z|-1)^2+|w|^2\Bigr).

Nearest rotation. If z≠0z\ne0 the minimiser is unique: R=RαR=R_\alpha with eiα=z/∣z∣e^{i\alpha}=z/|z|, i.e. the rotation by arg⁡z\arg z (in matrices: R=1∣z∣(Re⁡z−Im⁡zIm⁡zRe⁡z)R=\frac1{|z|}\begin{pmatrix}\operatorname{Re}z&-\operatorname{Im}z\\\operatorname{Im}z&\operatorname{Re}z\end{pmatrix}, the normalised "rotation-scaling part" (a+d)2I+(c−b)2(0−110)\frac{(a+d)}{2}I+\frac{(c-b)}2\begin{pmatrix}0&-1\\1&0\end{pmatrix} of AA). If z=0z=0 every rotation is equally near (this happens iff AA is "anti-conformal", of the form x↦wxˉx\mapsto w\bar x).

Check. A=2IA=2I: z=2z=2, w=0w=0; the formula gives 2(2−1)2=22(2-1)^2=2, and indeed ∥2I−I∥F2=2\|2I-I\|_F^2=2. A=diag⁡(1,−1)A=\operatorname{diag}(1,-1): z=0z=0, w=1w=1; the formula gives 2(1+1)=42(1+1)=4, and ∥diag⁡(1,−1)−Rα∥F2=(1−cos⁡α)2+sin⁡2α+sin⁡2α+(−1−cos⁡α)2=4\|\operatorname{diag}(1,-1)-R_\alpha\|_F^2=(1-\cos\alpha)^2+\sin^2\alpha+\sin^2\alpha+(-1-\cos\alpha)^2=4 for every α\alpha. A numerical minimisation over a fine grid of α\alpha on random matrices reproduces the formula.

Remark. For the other component of O(2)O(2), {z=0,∣w∣=1}\{z=0,|w|=1\}, the same argument gives min⁡∥A−F∥F2=2(∣z∣2+(∣w∣−1)2)\min\|A-F\|_F^2=2\bigl(|z|^2+(|w|-1)^2\bigr). Comparing the two minima, [(∣z∣−1)2+∣w∣2]−[∣z∣2+(∣w∣−1)2]=2(∣w∣−∣z∣)\bigl[(|z|-1)^2+|w|^2\bigr]-\bigl[|z|^2+(|w|-1)^2\bigr]=2(|w|-|z|), so a matrix is closer to SO(2)SO(2) than to O(2)∖SO(2)O(2)\setminus SO(2) iff ∣z∣>∣w∣|z|>|w|, i.e. iff det⁡A>0\det A>0. This is the 2×22\times2 case of the orthogonal Procrustes problem: the nearest orthogonal matrix is obtained from the SVD A=UΣVTA=U\Sigma V^T as UVTUV^T.

Lesson. When a distance to a group is wanted, pick coordinates in which the group is a coordinate subset (here the circle in the zz-plane) and the norm is Euclidean.