\name{subspace} \alias{subspace} \title{Finds the angle between two subspaces.} \description{ Finds the angle between two subspaces specified by the columns of A and B. } \usage{ subspace(A,B) } \arguments{ \item{A}{An p by u1 matrix. p must be greater than or equal to u1.} \item{B}{An p by u2 matrix. p must be greater than or equal to u2.} } \details{ The algorithm used here ensures that small angles are computed accurately, and it allows subspaces of different dimensions following the definition in [2]. The first issue is crucial. The second issue is not so important; but since the definition from [2] coinsides with the standard definition when the dimensions are equal, there should be no confusion - and subspaces with different dimensions may arise in problems where the dimension is computed as the numerical rank of some inaccurate matrix. } \value{the angle between two subspaces specified by the columns of A and B } \references{ [1] A. Bjorck & G. Golub, Numerical methods for computing angles between linear subspaces, Math. Comp. 27 (1973), pp. 579-594. [2] P.-A. Wedin, On angles between subspaces of a finite dimensional inner product space, in B. Kagstrom & A. Ruhe (Eds.), Matrix Pencils, Lecture Notes in Mathematics 973, Springer, 1983, pp. 263-285. }