Volume 9, Issue 2
Tricks of the Trade
In and Out
Download This Issue
In and Out
Q: Given a set of n-dimensional vectors, is there a simple way to check if they are coplanar in ?
A: Eckhard Hennig (email@example.com) answers: To establish coplanarity in of a set of -dimensional vectors, , you need to check whether the dimension of the null space (or nullity) of the linear mapping defined by has dimension . Here is an example.
Define three linearly independent vectors in .
Generate a set of 10 coplanar vectors in by forming random linear combinations of and . Use SeedRandom to obtain a repeatable sequence of pseudorandom numbers.
The null space of the mapping defined by has dimension 1; hence, the set is coplanar.
In Version 5, you can use MatrixRank instead to calculate the dimension of the subspace spanned by . The vectors are coplanar if the rank of is 2 (or in the general case).
NullSpace may be unreliable for large and ill-conditioned systems. A more reliable, but less efficient, alternative is to determine the number of singular values of the mapping.
Since there are two singular values, the set of vectors spans a two-dimensional space, that is, the vectors are coplanar in .
Now crosscheck for the noncoplanar case: generate 10 vectors in by forming random linear combinations of the three independent basis vectors , , and .
The null space is empty, which implies that , , and span .
Alternatively, the number of singular values equals the dimension of the space.
About Mathematica | Download Mathematica Player
Copyright © Wolfram Media, Inc. All rights reserved.