by mr_e_man » Mon Jul 11, 2022 4:52 am
For general dimensions of A and B, consider the unit sphere in B. Its projection onto A is an ellipsoid. The cosines of the angles between A and B are just the radii of the ellipsoid.
Suppose A is a 5-dimensional subspace and B is a 3-dimensional subspace. There exists a pair of orthonormal bases for A and B, call them {a₁,a₂,a₃,a₄,a₅} and {b₁,b₂,b₃}, with these special properties: a₁•b₁ = cos α₁, a₂•b₂ = cos α₂, a₃•b₃ = cos α₃, and a•b = 0 otherwise (i.e. for non-matching indices).
Indeed, b₁ can be defined as the (or any) unit vector in B whose projection onto A has the maximum magnitude (this will be cos α₁). Then b₂ can be defined as the unit vector in the subspace of B orthogonal to b₁ whose projection onto A has the maximum magnitude (this will be cos α₂). Lastly, b₃ is either one of the two unit vectors in B orthogonal to both b₁ and b₂. It can be shown that the projections of b₁,b₂,b₃ onto A are still orthogonal to each other. Define a₁,a₂,a₃ as these projections, normalized to unit magnitude, assuming the projections are non-zero. The remaining vectors a₄,a₅, and any corresponding to projections being zero, can be chosen arbitrarily to complete the orthonormal basis for A.
This shows (in outline) that such a pair of bases exists, though it may not be easy to find, as several maximization problems must be solved.
Furthermore, if we write e₁=a₁, ... , e₅=a₅, and define e₆,e₇,e₈ as the (normalized) rejections of b₁,b₂,b₃ away from A, then we have an orthonormal basis {e₁, ... , e₈}, and the coordinates of our other vectors with respect to this basis are
a₁ = (1,0,0,0,0, 0,0,0),
a₂ = (0,1,0,0,0, 0,0,0),
a₃ = (0,0,1,0,0, 0,0,0),
a₄ = (0,0,0,1,0, 0,0,0),
a₅ = (0,0,0,0,1, 0,0,0),
b₁ = (cos α₁,0,0,0,0, sin α₁,0,0),
b₂ = (0,cos α₂,0,0,0, 0,sin α₂,0),
b₃ = (0,0,cos α₃,0,0, 0,0,sin α₃).
Now consider the grade 5 multivector A=a₁a₂a₃a₄a₅, and the grade 3 multivector B=b₁b₂b₃.
A = e₁e₂e₃e₄e₅
B = (e₁cos α₁ + e₆sin α₁) (e₂cos α₂ + e₇sin α₂) (e₃cos α₃ + e₈sin α₃)
= (e₁e₂e₃)(cos α₁ cos α₂ cos α₃) + (e₁e₂e₈)(cos α₁ cos α₂ sin α₃) + (e₁e₇e₃)(cos α₁ sin α₂ cos α₃) + (e₁e₇e₈)(cos α₁ sin α₂ sin α₃)
+ (e₆e₂e₃)(sin α₁ cos α₂ cos α₃) + (e₆e₂e₈)(sin α₁ cos α₂ sin α₃) + (e₆e₇e₃)(sin α₁ sin α₂ cos α₃) + (e₆e₇e₈)(sin α₁ sin α₂ sin α₃)
AB = (-e₄e₅)(cos α₁ cos α₂ cos α₃) + (-e₃e₄e₅e₈)(cos α₁ cos α₂ sin α₃) + (-e₂e₄e₅e₇)(cos α₁ sin α₂ cos α₃) + (e₂e₃e₄e₅e₇e₈)(cos α₁ sin α₂ sin α₃)
+ (-e₁e₄e₅e₆)(sin α₁ cos α₂ cos α₃) + (e₁e₃e₄e₅e₆e₈)(sin α₁ cos α₂ sin α₃) + (e₁e₂e₄e₅e₆e₇)(sin α₁ sin α₂ cos α₃) + (e₁e₂e₃e₄e₅e₆e₇e₈)(sin α₁ sin α₂ sin α₃)
⟨AB⟩₂ = (-e₄e₅)(cos α₁ cos α₂ cos α₃)
⟨AB⟩₄ = (-e₃e₄e₅e₈)(cos α₁ cos α₂ sin α₃) + (-e₂e₄e₅e₇)(cos α₁ sin α₂ cos α₃) + (-e₁e₄e₅e₆)(sin α₁ cos α₂ cos α₃)
⟨AB⟩₆ = (e₂e₃e₄e₅e₇e₈)(cos α₁ sin α₂ sin α₃) + (e₁e₃e₄e₅e₆e₈)(sin α₁ cos α₂ sin α₃) + (e₁e₂e₄e₅e₆e₇)(sin α₁ sin α₂ cos α₃)
⟨AB⟩₈ = (e₁e₂e₃e₄e₅e₆e₇e₈)(sin α₁ sin α₂ sin α₃)
||⟨AB⟩₂||² = cos²α₁ cos²α₂ cos²α₃
||⟨AB⟩₄||² = cos²α₁ cos²α₂ sin²α₃ + cos²α₁ sin²α₂ cos²α₃ + sin²α₁ cos²α₂ cos²α₃
||⟨AB⟩₆||² = cos²α₁ sin²α₂ sin²α₃ + sin²α₁ cos²α₂ sin²α₃ + sin²α₁ sin²α₂ cos²α₃
||⟨AB⟩₈||² = sin²α₁ sin²α₂ sin²α₃
(The point of using these multivector magnitudes is that they can be calculated in any basis, without needing to know those special a and b vectors.)
This system doesn't look easy to solve for α₁,α₂,α₃. However, there are some simplifications to be made.
The intersection of A and B, and the subspace of B which is orthogonal to all of A, and the subspace of A which is orthogonal to all of B, can be calculated using basic linear algebra. The intersection has all the 0° angles, and the other two have all the 90° angles. Orthogonal to those three subspaces, the remaining subspaces of A and B have all the angles strictly between 0° and 90°. If the remaining subspaces are 0D or 1D or 2D, we already know how to find the angles between them. So assume they're 3D. This implies that α₁,α₂,α₃ are strictly between 0° and 90°, so the sines and cosines are all non-zero, and we can divide:
||⟨AB⟩₄||²/||⟨AB⟩₂||² = tan²α₃ + tan²α₂ + tan²α₁
||⟨AB⟩₆||²/||⟨AB⟩₂||² = tan²α₂ tan²α₃ + tan²α₁ tan²α₃ + tan²α₁ tan²α₂
||⟨AB⟩₈||²/||⟨AB⟩₂||² = tan²α₁ tan²α₂ tan²α₃
I recognize these as symmetric polynomials. By Vieta's formulas, if t is any of these squared tangents then
t³ - t² ||⟨AB⟩₄||²/||⟨AB⟩₂||² + t ||⟨AB⟩₆||²/||⟨AB⟩₂||² - ||⟨AB⟩₈||²/||⟨AB⟩₂||² = 0.
This is a nice single-variable algebraic equation that we can try to solve for t. Then the angles are α=arctan√t.
Of course all of this generalizes. The dimensions 5 and 3 were chosen to show the general pattern without being too abstract or unwieldy.
ΓΔΘΛΞΠΣΦΨΩ αβγδεζηθϑικλμνξοπρϱσςτυϕφχψωϖ °±∓½⅓⅔¼¾×÷†‡• ⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎
ℕℤℚℝℂ∂¬∀∃∅∆∇∈∉∋∌∏∑ ∗∘∙√∛∜∝∞∧∨∩∪∫≅≈≟≠≡≤≥⊂⊃⊆⊇ ⊕⊖⊗⊘⊙⌈⌉⌊⌋⌜⌝⌞⌟〈〉⟨⟩