Re: polytopes and cross products

*To*: mathgroup at smc.vnet.net*Subject*: [mg19315] Re: polytopes and cross products*From*: Martin Krause <i-martin at wolfram.com>*Date*: Sat, 14 Aug 1999 23:42:48 -0400*Organization*: Wolfram Research, Inc.*References*: <7p00i8$75a@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Russell Towle wrote: > > Hi all, > > In prologue, I am using Mathematica to construct various regular and > semi-regular polytopes in n-dimensional space, especially in four > dimensions. I have spent many hundreds of hours on a notebook which > constructs these 4-polytopes, makes solid shadows of them, and projections > into various sub-spaces, and even hidden-detail-removed projections of > 4-polytopes into 3-spaces. > > In order to bring this notebook to a point where it can be placed on > MathSource, I must solve one last nagging problem. First, a 4-polytope is > bounded by polyhedra. Take the regular 120-cell, {5,3,3}. It is bounded by > 120 Platonic pentagonal dodecahedra. In the 4-space, supposing the > dodecahedra are opaque, an observer would only see half, or somewhat less > than half, of them. In order to find which ones are visible from an > arbitrary viewpoint in the 4-space, I must find the cross product for each > dodecahedron: the vector perpendicular to its own particular 3-space. I guess one way to achieve this is the following: 1) Take all vectors of the polyhedron (or at least enough vectors to be sure that they span a 3-space even when you remove one of them, i.e. 7 in the case of a dodecahedron). 2) Subtract one of them (for example the first) from all vectors. (This is done in order to get directions as four vertices probably will always span a 4-space in your case.) 3) Plug the resulting list (may include a leading {0,0,0,0} vector) into NullSpace. (This returns a list of all vectors whose dot product with all the directions is 0, i.e. which are perpendicular to all vectors.) The result is a list of exactly one vector which is perpendicular to the 3-space spanned by the dodecahedron. In other words, if m is the list of the vertices of the dodecahedron (row vectors), the direction perpendicular to the 3-space spanned by the edges of the dodecahedron is: NullSpace[Map[(# - m[[1]]) &, m]][[1]] (Well, you probably should check that NullSpace[Map[(# - m[[1]]) &, m]] really returns only one vector, otherwise the edges did not span a three-dimensional space.) The problem is: the resulting vector is not oriented (while cross products usually have a known orientation); thus, in order to check for visibility you probably have to apply a dot product of the result with any of the vertices in order to determine whether the result is pointing from the origin in 4-space to the dodecahedron or from the dodecahedron to the origin of 4-space in which case you should multiply it by -1. (I am asuming that the center of this 120-cell-thing is the origin.) > My > cross product function "Cross4" requires four 4-vectors as input. So I will > write, for instance, for a dodecahedron named "dodeca", > > Cross4[ dodeca[[ {1,5,11,17} ]] ]. > > I loop through all 120 dodecahedra in such a way. I find by trial-and-error > that, say, the 1st, 5th, 11th, and 17th vertices of any of the 120 > dodecahedra span their respective 3-spaces. And I find by trial-and-error > that, say, the 1st, 2nd, 3rd, and 4th vertices of the 120 dodecahedra *do > not always* span the 120 3-spaces. > > As it stands now, once I have picked a good set of four indices, I can find > the visible dodecahedra in a second or two. What I need, though, is a fast > and reliable way to pick out subsets of four vertices from *any* polyhedron > in a 4-space, such that the four vertices *span the 3-space of the > polyhedron*. For it may well happen, as in the case of the dodecahedra, > that some four of the 20 vertices of a polyhedron are all in a single plane > (a single polygon) and thus do not span the 3-space of the polyhedron. > > In summary, how can I use Mathematica to select a set of four 4-vectors > which span a 3-space in the 4-space? > > Russell Towle > Box 141 > Dutch Flat, CA 95714 > (530) 389-2872 I think you should not try to pick these vectors. It is probably more efficient to take all you have and let mathematics figure out what you need. With this idea, I reformulate your problem: How do you get a set of linear independent vectors which span the same space as a given set of dependent vectors? Answer: Take the list of vectors (directions!) and plug them into RowReduce, the result will be another list of vectors of the same length. However, at the end of this resulting list, there are some 0-vectors which can be dropped. The remaining set of vectors are all linear independent and span the same space as the original set of vectors. Hope this helps Martin Kraus

**trouble with SurfaceColor**

**Windows 2000 (NT 5.0)**

**polytopes and cross products**

**ungrouping cells**