Finding angles between planes in 4D space. Suppose I have two intersecting planes in a four dimensional Euclidean space. It seems to me that there are two angles between these planes. If the two planes intersect in a line then one of those angles is zero. If the two angles are non-zero then the planes intersect in a point. If one plane is the WX plane and the other the YZ plane then the two angles are both 90 degrees.
The best I can do is this. Each plane is defined by two orthonormal basis vectors. Project a basis vector onto the other plane. Then the angle is the arccos of the length of the projection. Do this with each basis vector to get the two angles. However I believe that the result depends on the choice of basis vectors.
What I need could be to find a unit vector in a plane so that it's projection onto the other plane is of maximum length.  I don't know how to do that.  I suppose find an expression for the length of the projection, take the derivative, and find where it is zero.  Is there an easier way?
 A: Suppose $\Pi_1$ and $\Pi_2$ are two oriented subspaces of a Euclidean inner product space $U$ of the same dimension which intersect in a codimension $1$ subspace. This subspace can be afforded an orthonormal basis, which we can extend to ordered orthonormal bases of $\Pi_1$ and $\Pi_2$ by adding unit vectors $v_1$ and $v_2$. (Keep in mind the order and direction of basis vectors must agree with the orientations.) The angle $\phi=\angle v_1v_2$, defined by $\cos\phi=v_1\cdot v_2$, is the dihedral angle between the two subspaces. You can start with an arbitrary pair of ordered orthonormal bases for $\Pi_1$ and $\Pi_2$ and construct the bases we need using Gram-Schmidt. If you don't care about orientation, you can solve $\cos\phi=\pm v_1\cdot v_2$ for the acute or convex angle $\phi$ you want.

It is possible to go another route and generalize. The orthogonal projection $\pi_2:U\to\Pi_2$ may be restricted to $\Pi_1$, and it has a "hypervolume distortion factor" $\lambda$. That is, the effect of $\pi_2$ on any region $D\subset\Pi_1$ with finite volume $\mathrm{vol}(D)$ is to first shrink it along the $v_1$-axis by a factor of $\lambda$ (and flip it if $\lambda<0$), then rotate $\Pi_1$'s $v_1$-axis through $U$ to $\Pi_2$'s $v_2$-axis, to get a region with hypervolume $\mathrm{vol}(\pi_2(D))=\lambda\,\mathrm{vol}(D)$. This is just like how determinants work on a fixed space. This definition of $\lambda=\cos\phi$ applies to any two equal-dimension subspaces $\Pi_1$ and $\Pi_2$, regardless of their intersection's (co)dimension.
If $\{v_1,\cdots,v_d\}$ is an oriented orthonormal basis for $\Pi_1$, then we can form the matrix $V_1=(v_1~\cdots~v_d)$ and similarly $V_2$ for $\Pi_2$. The Grammian matrix is $G=V_2^T V_1$ and the Grammian determinant $\det G=\det(V_2^T V_1)$ is the volume distortion factor $\lambda$ and then we can define $\phi$ by $\lambda=\cos\phi$.
I think one way to see this works is to verify both $\det G$ and $\lambda$ "transform" the same way (with some kind of column operations involving both $V_1$ and $V_2$, which represent geometric shearing aka transvection) and are equal in a nice set of "base cases." Or, perhaps we can extend $\pi_2$ to a linear operator on $\Pi_1+\Pi_2$ which has the same determinant as $\lambda$. Or, you can view $V_2^TV_1$ as a matrix whose columns represent the parallelotope you get by projecting the unit cube of $\Pi_1$ (the parallelotope generated by $V_1$) to $\Pi_2$ and using $V_2$ as an ordered basis; then the determinant is well-known to measure the hypervolume.
Also note if we represent $V_1$ by $\omega_1=v_1\wedge\cdots\wedge v_d$ and $V_2$ by $\omega_2$ in the exterior power $\Lambda^dU$, then this is the inherited inner product $\cos\phi=\langle\omega_1,\omega_2\rangle$.
We can generalize even further to cases where $\dim\Pi_1\ne\dim\Pi_2$. In these cases, the Grammian matrix $G=V_2^TV_1$ is rectangular but not square, so we can't take its determinant. Plus, $\cos\phi$ being signed ($\pm$) doesn't really make sense because all embeddings of one space into another are related by ambient isometries (as opposted to when $\dim\Pi_1=\dim\Pi_2$, there are two classes corresponding to preserving or reversing orientations). However, $\lambda^2=\cos^2\phi$ makes sense, and this equals $\det(G^TG)$ where $G=V_2^TV_1$. This way we can measure angles between subspaces of different dimension. Note, though, linear dependence implies when projecting a larger dimensions subspace to a smaller dimension one, this determinant will be $0$, because smaller-dimensional volume is considered zero as a higher-dimensional volume.
