Function Repository Resource:

# SubspaceAngle

Compute the angle between two subspaces

Contributed by: Jan Mangaldan
 ResourceFunction["SubspaceAngle"][u,v] gives the angle between two subspaces specified by the columns of the matrices u and v.

## Details and Options

The matrices u and v must be numerical matrices with the same number of rows.
Vectors are treated as column matrices.
If the elements of u or v are exact numbers, ResourceFunction["SubspaceAngle"] begins by applying N to them.
ResourceFunction["SubspaceAngle"] gives an angle in radians.

## Examples

### Basic Examples (1)

Compute the angle between two subspaces:

 In[1]:=
 Out[3]=

### Scope (2)

Find the subspace angle between a vector and a matrix:

 In[4]:=
 Out[4]=

Find the subspace angle between different sets of columns of a complex matrix:

 In[5]:=
 In[6]:=
 Out[6]=

### Properties and Relations (2)

For two vectors, SubspaceAngle gives the same result as VectorAngle:

 In[7]:=
 Out[7]=
 In[8]:=
 Out[8]=

Use SubspaceAngle to compute the angle between two planes by specifying the vectors spanning each plane as matrix columns:

 In[9]:=
 Out[9]=

Use DihedralAngle to compute the same result:

 In[10]:=
 Out[10]=

## Version History

• 1.0.0 – 08 February 2023