The following geometric problems, of high school and undergraduate level, are
solved in the existing curriculum with the cross product and matrices. Here,
solutions are presented in the language of Clifford's geometric algebra. The
expressions can be evaluated with a computer program designed for Clifford
calculations, downloadable from http://www.helsinki.fi/~lounesto/CLICAL.htm.
==================================================================
Problem 1: Determine the distance d of the point P from the line AB.
Solution: d = abs(((P-A)^(B-A))/(B-A)).
Explanation: The area of a parallelogram, which is twice as big as the
triangle ABP, is divided by the line segment AB.
Comment: This formula is applicable in any dimension.
==================================================================
Problem 2: Find the distance d between two lines, say AB and CD.
Solution: d = abs(((A-C)^E)/E), where E = (A-B)^(C-D).
Explanation: Determine the length of the orthogonal rejection of A-C
outside of the plane E = (A-B)^(C-D).
Comment: This formula is independent of the surrounding dimension.
==================================================================
Problem 3: Find the line of intersection, say l(t), of two planes,
v1.r+d1 = 0 and v2.r+d2 = 0.
Solution: l(t) = t*(v1^v2)/e123 + (d2*v1-d1*v2)/(v1^v2).
Comment: A solution, using the cross product, can be written as
l(t) = t*(v1xv2) + (d2*v1-d1*v2)x(v1xv2)/|v1xv2|**2.
For an arbitrary vector c, c/(v1^v2) is a sum of a 3-vector and a 1-vector,
which equals cx(v1xv2)/|v1xv2|**2.
Explanation: The quotient A/B is the orthogonal complement of A within B,
with magnitude |A|/|B|. Thus, (v1^v2)/e123 is a vector orthogonal to the
plane v1^v2 within the e123-space R^3, and (d2*v1-d1*v2)/(v1^v2) is the
orthogonal complement of the vector d2*v1-d1*v2 within the plane v1^v2.
Comment: The intersection of two 3-planes in R^4 is a 2-plane, determined
by its bivector (v1^v2)/e1234 and a position vector (d2*v1-d1*v2)/(v1^v2).
==================================================================
Problem 4: Find out, if a line segment intersects a plane in 3D space;
if so, at what point does the intersection occur; what is the distance
between each endpoint and the intersection. Assume that the plane contains
the points S = (7,-7,6), T = (1,3,2), O = (0,0,0) and assume that the line
segment has endpoints A = (3,-4,7) and B = (2,4,1).
Solution: While in CLICAL, http://www.teli.stadia.fi/~lounesto/CLICAL.htm,
type
> dim 3
> S = 7e1-7e2+6e3
> T = e1+3e2+2e3
> P = S^T
P = 28e12+8e13-32e23 [this represents the plane]
> A = 3e1-4e2+7e3
> B = 2e1+4e2+e3
> (A^P)/((A-B)^P)
ans = 0.660 [intersection occurs, since this is between 0..1]
> C = A+(B-A)*ans
C = 2.340e1+1.280e2+3.040e3 [the point of intersection]
> abs(A-C)
ans = 6.633 [distance of an endpoint from the intersection]
> abs(B-C)
ans = 3.417 [distance of an endpoint from the intersection]
Explanation: A^P = A^S^T is the oriented volume of the parallelepiped
with A,S,T as edges.
==================================================================
Problem 5: A person looks at a tetrahedron with corners A,B,C,D
from the position P. Is the face ABC with vertices A,B,C visible
to the person at P? A = (1,2,3), B = (3,7,1), C = (2,0,0), D = (2,3,6),
P = (6,6,6),
Solution: No, for opaque faces or interior. In CLICAL, treat
A,B,C,D and P as vectors:
> dim 3
> A = e1+2e2+3e3
> B = 3e1+7e2+e3
> C = 2e1
> D = 2e1+3e2+6e3
> P = 6e1+6e2+6e3
> ((D-A)^(C-A)^(B-A))/((C-A)^(B-A))
ans = 1.742e1-0.367e2+0.825e3
> ((P-A)^(C-A)^(B-A))/((C-A)^(B-A))
ans = 4.397e1-0.925e2+2.083e3
Since the two vectors, the first ans and the second ans, point to the
same direction, P and D are on the same side of the plane ABC. Thus,
the person at P cannot see the face ABC.
Comment: The two answers compute the orthogonal rejections
(outside of ABC) of the vectors D-A and P-A. The plane ABC is
represented by the bivector (C-A)^(B-A) = 9e12+4e13+19e23.
==================================================================
Problem 6: Determine the angle ABC for A = (5,9), B = (2,3), C = (8,3).
Solution: For complex numbers A,B,C: angle = |Im(log((A-B)/(C-B)))|.
In CLICAL, you can treat A,B,C also as vectors:
> A = 5e1+9e2
> B = 2e1+3e2
> C = 8e1+3e2
> log((A-B)/(C-B))
ans = 0.122-1.107i
Thus, the angle is 1.107.
Comment: This method is generalizable to higher dimensions in the form
angle = |_2|, where _2 gives the bivector part of W
(computable in CLICAL as Pu(2,W)).
==================================================================
Problem 7: Find a rotation sending a unit vector x to the unit vector y.
Solution: y = u*x/u, where u = sqrt(y/x).
Explanation: In 2D, x*r/x is the vector r reflected across the line x;
and (xy)*r/(xy) is r reflected first across y and then across x; this
means rotation by twice the angle between x and y; thus the desired
rotation is completed by u = sqrt(y/x). Recall that 1/x = x and x*r*x =
x*(r.x+r^x) = x*(x.r-x^r) = x*(2x.r-x*r) = 2(x.r)*x-(x*x)*r, which
means reflection of r across x.
Comment: The formula is valid in any dimension.
==================================================================
Problem 8: What is the distance of two 2-planes in 5D, with no common
points? Say, for instance of the planes
A: spanned by a1 = e2+5e5 and a2 = e1+e2+e4
B: spanned by b1 = 2e1-2e2-4e3-3e4 and b2 = 2e2+3e3+4e4+e5
where A passes through the origin 0 and B through c = e1+3e3-e4+7e5.
Solution: While in CLICAL, type
> dim 4
input the data, and type
> A = a1^a2
A = -e12-5e15+e24-5e25-5e45
> B = b1^b2
B = 4e12+6e13+8e14+2e15+2e23-2e24-2e25-7e34-4e35-3e45
compute the component of c perpendicular to both A and B
> u = (c^A^B)/(A^B)
u = 1.793e1-0.309e2+2.165e3-1.484e4
where u is the projection of c in that perpendicular direction.
The required distance is the length of u,
> d = abs(u)
ans = 3.194413
Comment: The above construction works in any dimension n for computing
the distance of two planes. If you want to benefit n = 5, you could also
compute v = (A^B)e12345 = 29e1-5e2+35e3-24e4+e5, project c on v to get
u = (c.v)/v; and d = abs(u) = 3.194.
==================================================================
Problem 9: Determine the principal angles between two 2-planes in R^4, the
planes being the xy-plane and the plane spanned by (1,0,1,0) and (0,1,0,7).
Comment: The principal angles between these two planes are 45 degs and
81.9 degs = arctan(7). This means that two lines in the two planes are
separated by at least 45 degs, and at this minimum, the orthogonal complements
of the two lines are separated by 81.9 degs.
Denote the xy-plane e12 by A and the other plane by
B = (e1+e3)^(e2+7e4) = e12+7e14-e23+7e34.
Then B/A = 1-e13-7e24-7e1234, computed by observing that AA = -1. Then
log(B/A) = log(10)-(pi/4)e13-arctan(7)e24, as can be verified by
exponentiation (and observing that e13e24 = e24e13). Thus, the two principal
angles, pi/4 and arctan(7), occur in the pure bivector part of log(B/A),
F = Pu(2,log(B/A)) = -(pi/4)e13 - arctan(7)e24.
The bivector F decomposes into a sum of two simple bivectors,
F = F1 + F2, F1 = -arctan(7)e24, F2 = -(pi/4)e13.
The principal angles f1 and f2 are the magnitudes of F1 and F2,
f1 = abs(F1), f2 = abs(F2).
The problem is to find a formula to for the decomposition F = F1 + F2.
Solution: F1 = F*_0/sqrt(-F**2),
F2 = F*_4/sqrt(-F**2),
computable with CLICAL as follows:
> dim 4
> A = e12
> B = (e1+e3)^(e2+7e4)
B = e12+7e14-e23+7e34
> B/A
ans = 1-e13+7e24-7e1234
> F = Pu(2,log(ans))
F = -0.785e13-1.429e24
> F1 = F*Pu(0,sqrt(-F**2))/sqrt(-F**2)
F1 = -1.429e24
> F2 = F*Pu(4,sqrt(-F**2))/sqrt(-F**2)
F2 = -0.785e13
Thus, the principal angles are f1 = 1.429 and f2 = 0.785.
Comment: The mutual attitude of two lines is determined by the angle
between them. The mutual attitude of two k-dimensional subspaces, in
n dimensions, is given by k angles, one being the smallest angle between
any directions in the two subspaces (another being the smallest angle
between the remaining (k-1)-dimensional subspaces, where the first
directions have been rejected).
==================================================================