TITLE: angle between subspaces
QUESTION [11 upvotes]: Let $E$ be a finite dimensional real inner product space.  I want to define the angle between two subspaces $E_1$ and $E_2$.  This has a fairly obvious meaning if $E_1$ is 1-diemsnional: Take the angle between any non-zero vector in $E_1$ and its orthogonal projection onto $E_2$.
There are a number of other cases that can be treated ad-hoc, if one is a hyperplane, or the dihedral angle between planes in $R^3$.
In general, it isn't quite clear what the right definition is.  I see two possibilities:

If $p=\dim E_1\le \dim E_2$, consider the two subspace $\lambda^p(E_1)$ and $\Lambda^p(E_2$   of $\Lambda^p(E)$ (which is also an inner product space, and proceed as above, since $\Lambda^p(E_1)$ is a line.
$Hom(E,E)$ is itself an inner product space with the inner product 
$$
\langle A,B\rangle=trace  A^\top B.
$$
Let $A_i$ be the orthogonal projection onto $E_i$ and take the angle between $A_1$ and $A_2$.

Are either of these definitions standard?  Are they equivalent (I think so)?  Is there another definition, perhaps more immediate?

REPLY [3 votes]: I know this is a few years late, but still it might be useful ...
A nice way to express Dan's answer is to let $A$ and $B$ be matrices whose columns form orthonormal bases for $E_1$ and $E_2$ respectively. Then the cosines of the principal angles are the singular values of the matrix $A^TB$ (or of $B^TA$ of course).