The greatest principal angle is related to the notion of distance between
subspaces of the same dimension [1]}. Thus, if \(p = q\)  then
\(dist(F,G) = \sqrt{ 1 - \cos (\theta _p)^2} \)  \( = \hspace{2.0pt}\mathrm {sen}(\theta _p)\) . In a practical
way, if the columns of \(Q_F \in \mathbb {R}^{m \times p}\)  and those of \(Q_G \in \mathbb {R}^{m \times p}\)  define orthonormal bases for \(F\)  and \(G\) ,
respectively, the cosine of the greatest principal angle is determined by
computing an SVD of the matrix \(Q_F^\top Q_G\)  and taking the smallest of its
singular values. It is important to note that
\(0\le dist(F,G) \le 1.\) 
