{VERSION 2 3 "HP RISC UNIX" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 256 "" 1 24 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -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 0 0 }{CSTYLE "" -1 380 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 381 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT 256 23 "Appendix A: Procedures " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 133 " To begin, we must define the c ommands we wish to use in Maple by having Maple read the libraries the y are in. The library " }{TEXT 344 7 "linalg " }{TEXT -1 91 "is a lis t of operations in linear algebra which allow us to manipulate matrice s in Maple. " }{TEXT 346 5 "Plots" }{TEXT -1 69 " is a library of plo tting tools for displaying images. The function " }{TEXT 345 7 "permu te" }{TEXT -1 38 " is the only function needed from the " }{TEXT 347 8 "combinat" }{TEXT -1 84 " library. It is used to permute coordinate s to determine vertices of the polytopes." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "with(linalg):with(plots):with(combinat,permute):" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 167 " In order to understand the procedures below, one must be fam iliar with the concepts of projection and rotation, to the extent they are discussed in the text." }}{PARA 0 "" 0 "" {TEXT -1 102 " \+ A hyperplane in 4-space passing through the origin is determined by a n equation of the form " }{TEXT 301 18 "aw + bx + cy + dz " }{TEXT -1 206 "= 0. We want a method to project points of an object in 4-space \+ onto this hyperplane and then into 3-space for display. We do this by finding three mutually orthogonal vectors that are also orthogonal to " }{TEXT 300 1 "v" }{TEXT -1 4 " = [" }{TEXT 302 10 "a, b, c, d" } {TEXT -1 171 "]. Then for any point in 4-space, its 3-space projected coordinates are obtained by determining the components of this point \+ with respect to the three orthogonal vectors." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 25 " For the vector \+ " }{TEXT 298 2 "v " }{TEXT -1 3 "= [" }{TEXT 303 10 "a, b, c, d" } {TEXT -1 54 "], consider the following three vectors orthogonal to " } {TEXT 297 1 "v" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "v :=[a,b,c,d];\nv1:=[d,c,-b,-a];\nv2:=[-c,d,a,-b];\nv3:=[b,-a,d,-c];" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 268 " In order to test that these vectors are orthogal to one anot her, we can take the dot-product of any two, and confirm that it is 0. Since the dot-product of two vectors is equal to the product of thei r magnitudes times the cosine of the angle between them ( " }{TEXT 299 3 "p.v" }{TEXT -1 2 " =" }{XPPEDIT 18 0 " abs(p)*abs(v)*cos theta " "**-%$absG6#%\"pG\"\"\"-F$6#%\"vGF'%$cosGF'%&thetaGF'" }{TEXT -1 159 "), and we assume that the vectors have non-zero magnitude, then t he cosine of the angle betweend them is 0, telling us they are at righ t angles to one another." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 93 "v[1]*v1 [1]+v[2]*v1[2]+v[3]*v1[3]+v[4]*v1[4];\nv3[1]*v2[1]+v3[2]*v2[2]+v3[3]*v 2[3]+v3[4]*v2[4];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 314 " A nother way to test for orthogonality is to place these vectors in a 4x 4 matrix, such that each vector is a row with its components as row en tries, and multiply it by its transpose. The transpose of an n-by-m m atrix is an m-by-n matrix with the original row entries appearing as c olumns, and vice versa." }}{PARA 0 "" 0 "" {TEXT -1 220 " If \+ an n-by m matrix is multiplied by an m-by-n matrix, their product is a n n-by-n matrix. If that matrix is the n-by-n identity matrix, or a c onstant multiple of it, then the rows of the matrix are said to be " } {TEXT 257 20 "linearly independent" }{TEXT -1 117 ". This is equivale nt to saying that the vectors are mutually orthogonal (they each point in independent directions)." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "M:= concat(v,v1,v2,v3);transpose(M);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "multiply(M,transpose(M));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 6 " " }}{PARA 0 "" 0 "" {TEXT -1 18 "Thus, the vectors \+ " }{TEXT 289 2 "v1" }{TEXT -1 2 ", " }{TEXT 290 2 "v2" }{TEXT -1 6 ", \+ and " }{TEXT 291 2 "v3" }{TEXT -1 34 " are all orthogonal to the vecto r " }{TEXT 288 1 "v" }{TEXT -1 71 ". It should be clear that they eac h have the same magnitude, that is, " }{XPPEDIT 18 0 "sqrt(a^2+b^2+c^2 +d^2)" "-%%sqrtG6#,**$%\"aG\"\"#\"\"\"*$%\"bG\"\"#F)*$%\"cG\"\"#F)*$% \"dG\"\"#F)" }{TEXT -1 97 ". However, in order to insure that distanc es are not too greatly distorted, it helps to use the " }{TEXT 295 4 " unit" }{TEXT -1 29 " vectors in the direction of " }{TEXT 292 2 "v1" } {TEXT -1 2 ", " }{TEXT 293 2 "v2" }{TEXT -1 6 ", and " }{TEXT 294 2 "v 3" }{TEXT -1 150 ". Dividing each vector by its magnitude yields a v ector of length 1 in the same direction. These are the unit vectors. \+ If we redefine the vectors " }{TEXT 285 2 "v1" }{TEXT -1 2 ", " } {TEXT 286 2 "v2" }{TEXT -1 6 ", and " }{TEXT 287 2 "v3" }{TEXT -1 39 " , as unit vectors, they are said to be " }{TEXT 258 11 "orthonormal" } {TEXT -1 133 " to one another and can be used as basis for the hyperpl ane. That is, they become the coordinate axes for the 3-space orthogo nal to " }{TEXT 296 1 "v" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "n:=sqrt(a^2+b^2+c^2+d^2);\nv1:=v1/n; v2:=v2/n; v3:=v3 /n;\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 31 " Now, given any point " }{TEXT 284 1 "p" }{TEXT -1 87 " in 4-space, we can redefine it in 4-space with respect to the \+ four orthogonal vectors " }{TEXT 263 1 "v" }{TEXT -1 2 ", " }{TEXT 264 2 "v1" }{TEXT -1 2 ", " }{TEXT 265 2 "v2" }{TEXT -1 6 ", and " } {TEXT 266 2 "v3" }{TEXT -1 65 ". This is essentially like rotating th e coordinate system from (" }{TEXT 304 10 "w, x, y, z" }{TEXT -1 6 ") \+ to (" }{TEXT 305 10 "v,v1,v2,v3" }{TEXT -1 68 ") and determining the n ew coordinates. A vector from the origin to " }{TEXT 283 1 "p" } {TEXT -1 233 " will have components in each of these independent direc tions. (Picturing this may be difficult, as we can only find three in dependent directions in any 3-space. Simply imagine the case in three space without counting the vectors.)" }}{PARA 0 "" 0 "" {TEXT -1 53 " In order to find the component of a vector " }{TEXT 259 1 "p " }{TEXT -1 35 " in the direction of a unit vector " }{TEXT 260 1 "v" }{TEXT -1 33 ", we take their dot-product. If " }{TEXT 261 1 "v" } {TEXT -1 95 " is not a unit vector, the component is given by their do t-product divided by the magnitude of " }{TEXT 262 1 "v" }{TEXT -1 1 " ." }}{PARA 0 "" 0 "" {TEXT -1 68 " In order to project points onto the hyperplane defined by " }{TEXT 267 2 "v1" }{TEXT -1 2 ", " } {TEXT 268 2 "v2" }{TEXT -1 6 ", and " }{TEXT 269 2 "v3" }{TEXT -1 51 " , we redefine all the points in terms of the bases " }{TEXT 270 1 "v" }{TEXT -1 2 ", " }{TEXT 271 2 "v1" }{TEXT -1 2 ", " }{TEXT 272 2 "v2" }{TEXT -1 6 ", and " }{TEXT 273 2 "v3" }{TEXT -1 21 ", and then, drop \+ the " }{TEXT 274 1 "v" }{TEXT -1 39 " component. This is like droppin g the " }{TEXT 275 1 "z" }{TEXT -1 48 " comonent of a point and projec ting it into the " }{TEXT 276 2 "xy" }{TEXT -1 40 "-plane. It simply \+ drops to zero in the " }{TEXT 277 2 "z " }{TEXT -1 57 "direction. Thu s, we only need to find the components of " }{TEXT 278 1 "p" }{TEXT -1 16 " with respect to" }{TEXT 279 3 " v1" }{TEXT -1 2 ", " }{TEXT 280 2 "v2" }{TEXT -1 6 ", and " }{TEXT 281 2 "v3" }{TEXT -1 31 ", whic h can be determined from " }{TEXT 282 1 "v" }{TEXT -1 51 ", and this p rojects the points into the hyperplane." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 204 "To do this, we first define a function which takes the dot-product of two vectors and divides by \+ the magnitude of the second vector. This yields the component of the \+ first in the direction of the second." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 113 "comp:=(p,v)->(p[1]*v[1] + p[2]*v[2] + p[3]*v[3] + p[4]*v[4])/ s qrt(((v[1])^2 + (v[2])^2 + (v[3])^2 + (v[4])^2));\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 51 "So we can get t he coordinates of the projection of " }{TEXT 306 1 "p" }{TEXT -1 21 " \+ in the direction of " }{TEXT 307 1 "v" }{TEXT -1 152 ". This is done \+ by using the function above to find components in three directions ort hogonal to the one given. (These are the same vectors defined as " } {TEXT 308 2 "v1" }{TEXT -1 2 ", " }{TEXT 309 2 "v2" }{TEXT -1 6 ", and " }{TEXT 310 2 "v3" }{TEXT -1 8 " above.)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 114 "proj:=(p,v)->[comp(p,[v[4],v[3],-v[2],-v[1]]),\ncomp (p,[-v[3],v[4],v[1],-v[2]]),\ncomp(p,[v[2],-v[1],v[4],-v[3]])];\n" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 57 "As an example, we can find the coordinates of the point [" }{TEXT 311 10 "w, x, y, z" }{TEXT -1 31 "] projected in the direction of" }} {PARA 0 "" 0 "" {TEXT -1 1 "[" }{TEXT 312 10 "a, b, c, d" }{TEXT -1 2 "]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "proj([w,x,y,z],[a,b,c,d]);\n " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 111 "Another way to express this operations is through a matrix multip lication. That is, we can multiply the point " }{TEXT 343 1 "p" } {TEXT -1 48 " (as a column matrix) by the matrix given below." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 99 "n:=sqrt(a^2+b^2+c^2+d^2);\nM:=array ([[d/n,c/n,-b/n,-a/n],[-c/n,d/n,a/n,-b/n],[b/n,-a/n,d/n,-c/n]]);\n" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 52 "T he result is exactly the same as for the procedure " }{TEXT 342 4 "pro j" }{TEXT -1 15 " defined above." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "multiply(M,[w,x,y,z]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 409 " In each of the polytope worksh eets, the polytope P is defined as a list of lists. The first list in P is the list of the vertices of the polytope. Each of these vertice s is given by four coordinates in 4-space. The second list is the lis t of faces of the polytope. These faces are given by the index of the vertices they contain. In other words, the triangular face which con tains the vertices " }{XPPEDIT 18 0 "p[1]" "&%\"pG6#\"\"\"" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "p[5]" "&%\"pG6#\"\"&" }{TEXT -1 6 ", and " } {XPPEDIT 18 0 "p[172]" "&%\"pG6#\"$s\"" }{TEXT -1 160 " is given as [1 , 5, 172]. The third list is the list of cells. They are given by th e index of the faces which bound them, in the same way the faces are g iven." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 " The procedure " }{TEXT 341 7 "project" }{TEXT -1 46 " takes as input a 4-D polytope P and a vector " }{TEXT 313 1 "v " }{TEXT -1 86 " in 4-space, and projects each of the vertices of P on to the hyperplane orthogonal to " }{TEXT 314 1 "v" }{TEXT -1 118 ". I t does this by taking each of the vertices listed in of P, and \"dotti ng\" it with three unit vectors orthogonal to " }{TEXT 315 1 "v" } {TEXT -1 227 ". It continues to do this until it has projected every \+ vertex of P. The result is in the same format as a polytope, with fac es and cells unchanged. The list of vertices now has points with thre e coordinates, instead of four." }}{PARA 0 "" 0 "" {TEXT -1 39 "(The n otation P[1][i][n] refers to the " }{TEXT 356 1 "n" }{TEXT -1 18 "th e lement of the " }{TEXT 357 1 "i" }{TEXT -1 56 "th element of the 1st e lement of P. That is, it is the " }{TEXT 358 1 "n" }{TEXT -1 21 "th c oordinate of the " }{TEXT 355 1 "i" }{TEXT -1 52 "th point in the list of vertices in the polytope P.)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 312 "project:=proc(P,v) local a,b,c,d,n,i;\na:=v[1];b:=v[2];c:=v[3];d: =v[4];\nn:=sqrt(a^2+b^2+c^2+d^2);\n[[seq([(P[1][i][1]*d+P[1][i][2]*c-P [1][i][3]*b-P[1][i][4]*a)/n,\n(-P[1][i][1]*c+P[1][i][2]*d+P[1][i][3]*a -P[1][i][4]*b)/n,\n(P[1][i][1]*b-P[1][i][2]*a+P[1][i][3]*d-P[1][i][4]* c)/n],\ni=1..nops(P[1]))],P[2],P[3]];\nend:\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 103 "To demonstrate, let's define a simple triangle in 4-s pace as our polytope, and project it into 3-space:" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 42 "p1:=[1,5,4,6];p2:=[2,5,1,1];p3:=[1,0,2,1];" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "f1:=[1,2,3]; c1:=[1];" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "P:=[[p1,p2,p3],[f1],[c1]];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "project(P,[1,0,2,1]);" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 858 " Now we are able to display any 4-D object in three dimension s by projecting its vertices onto a hyperplane. The projection of eac h point is in the same direction. This is like shining a light on the object with all of the rays of light parallel to one another. The su n's rays can be approximated as parallel due to the incredible distanc e between it and us. Yet most of our experience is with small lights \+ that emit light in every direction from (more or less) a single point \+ not so far away. Thus, the rays of light move away from one another, \+ and the shadow projected by an object close to that light will be magn ified and distorted in some way. This is called perspective, and is e xactly the same effect artists attempt to reproduce by working with a \+ vanishing point. The vanishing point for a perspective shadow is simp ly the light bulb." }}{PARA 0 "" 0 "" {TEXT -1 1016 " Let's t hink of this another way. If you were to look at an object in 3-space like a cube, or better a large room, the various parts of the image w ould come to your eye from different angles and the lines of light wou ld converge to your pupil. If you take a picture of the large room an d develop it, you would see the edges of the room where the walls meet the ceiling sloping down at an angle, appearing to meet at a point in the distance (the vanishing point). Mathematically, the camera is pr ojecting the 3-D object into 2-space (the plane of the film). If the \+ camera were as large as the room, or the room as small as the camera, \+ this could be done in a way that the projections from each part of the image would be parallel to each other. However, the projection is br inging all the parts of the image to a single point (your pupil), and \+ finding all of the points where those projections intersect a plan (th e plane of the film). Of course, all this is aided by lenses to keep \+ everthing in focus." }}{PARA 0 "" 0 "" {TEXT -1 372 " Now whe n you think about it, we don't actually see anything in 3-D. Our brai n maps out everything we see based on our eyes being perspective point s. Every image is a 2-D projection, a flat slice of the world, onto o ur retina. Because of the slight displacement from one eye to another , we are able to determine the distance to objects by how we focus on \+ them." }}{PARA 0 "" 0 "" {TEXT -1 223 " So how do we perform \+ a perspective projection from 4-space into 3-space? The process is ex actly the same as it would be for projecting 3-space into 2-space with a perspective point. First, we pick a point vector " }{TEXT 316 1 "v " }{TEXT -1 168 ", as above, which we will consider an \"eye\". Then \+ we project each point of the object towards that point and determine w here they intersect a hyperplane orthogonal to " }{TEXT 317 1 "v" } {TEXT -1 1 "," }{TEXT 349 1 " " }{TEXT -1 29 "directly in front of our eye." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 23 " The procedure " }{TEXT 340 9 "perspproj" }{TEXT -1 149 " performs a projection into 3-space with perspective. The dis tance factor that determines the intensity of the perspective is given by the number f." }}{PARA 0 "" 0 "" {TEXT -1 70 " The project ion is accomplished by first adjusting the vector " }{TEXT 328 1 "v" } {TEXT -1 46 " to the proper perspective point. The vector " }{TEXT 319 1 "v" }{TEXT -1 107 " determines a direction when divided by its m agnitude. This direction can be multiplied a distance factor " } {TEXT 318 1 "f" }{TEXT -1 114 ", which allows us to vary the distance \+ of perspective independent of the direction. Next, we subtract the ve ctor " }{TEXT 327 1 "f" }{TEXT 320 1 "v" }{TEXT -1 2 "/|" }{TEXT 335 1 "v" }{TEXT -1 17 "| from the point " }{TEXT 321 2 "p " }{TEXT -1 102 "by subtracting each of the coordinates of the former from the coo rdinates of the latter. We redefine " }{TEXT 322 1 "p" }{TEXT -1 93 " with the resulting coordinates. Then, we multiply each result by the negative magnitude of " }{TEXT 325 1 "v" }{TEXT -1 7 " times " } {TEXT 326 1 "f" }{TEXT -1 31 " divided by the dot product of " }{TEXT 323 1 "p" }{TEXT -1 5 " and " }{TEXT 324 1 "v" }{TEXT -1 118 ". This \+ sends the points back in the direction they came, accept an angle. Th is angle is precisely the angle between " }{TEXT 348 1 "v" }{TEXT -1 5 " and " }{TEXT 350 1 "p" }{TEXT -1 167 ". Thus, the images are brou ght towards the perspective point and sent back in the opposite direct ion of the perspective point. The expression for this calcuation is: " }}{PARA 257 "" 0 "" {TEXT -1 1 "(" }{TEXT 330 2 "p " }{TEXT -1 1 "- " }{TEXT 331 2 " f" }{TEXT 332 1 "v" }{TEXT -1 2 "/|" }{TEXT 334 1 "v " }{TEXT -1 4 "|)(-" }{TEXT 333 1 "f" }{TEXT -1 1 "|" }{TEXT 336 1 "v " }{TEXT -1 3 "|/(" }{TEXT 337 3 "p.v" }{TEXT -1 2 "))" }}{PARA 0 "" 0 "" {TEXT -1 58 " The resulting coordinates are the coordinat es of " }{TEXT 338 1 "p" }{TEXT -1 107 " adjusted for the perspective \+ view. These points can then be projected onto they hyperplane determi ned by " }{TEXT 329 1 "v" }{TEXT -1 10 " using the" }{TEXT 339 9 " pro ject " }{TEXT -1 16 "procedure above." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 512 "perspproj:=proc(P,v,f)\nlocal a,b,c,d,n,i,p1,p2,p3,p4,g,q1,q2,q 3,q4;\na:=v[1];b:=v[2];c:=v[3];d:=v[4];\nn:=sqrt(a^2+b^2+c^2+d^2);\nfo r i from 1 to nops(P[1]) do;\np1:=P[1][i][1];p2:=P[1][i][2];\np3:=P[1] [i][3];p4:P[1][i][4];\np1:=p1-f*a/n;p2:=p2-f*b/n;\np3:=p3-f*c/n;p4:=p4 -f*d/n;\ng:=-n*f/(a*p1+b*p2+c*p3+d*p4);\nq1[i]:=g*p1;q2[i]:=g*p2;q3[i] :=g*p3;q4[i]:=g*p4;\nod;\n[[seq([(q1[i]*d+q2[i]*c-q3[i]*b-q4[i]*a)/n, \n(-q1[i]*c+q2[i]*d+q3[i]*a-q4[i]*b)/n,\n(q1[i]*b-q2[i]*a+q3[i]*d-q4[i ]*c)/n],\ni=1..nops(P[1]))],P[2],P[3]];\nend:\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 146 "As an example, we will use the same triangle define d as P above and project it into the same hyperplane with a perspectiv e view from a distance 3." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "perspp roj(P,[1,0,2,1],3);" }{TEXT -1 1 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 234 " So far, all we have d one is manipulate the coordinates of vertices in 4-space so that we ca n map them into 3-space. We do not yet have a method for displaying t he results in Maple. One of the Maple plotting tools is called " } {TEXT 351 13 "polygonplot3D" }{TEXT -1 137 ", which takes polyogons de fined by their vertices and displays them in a way that they can be ro tated to get views from different angles." }}{PARA 0 "" 0 "" {TEXT -1 24 " The procedure " }{TEXT 352 10 "polydecode" }{TEXT -1 384 " takes a projected polytope in 3-space and creates from it a list of its polygonal faces. The vertices of these polygons are taken fro m the second list in the polytope P, the list of faces. This generate s a list of vertices, grouped in faces, which Maple can plot as polygo ns in 3-space. Thus, we will have a shadow of the polytope we want to see, which we can view from all sides." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 104 "polydecode:=proc(P) local i,j;\n[seq([seq(P[1][P[2][i][j]],j= 1..nops(P[2][i]))],\ni=1..nops(P[2]))];\nend:\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 118 " Applying this procedure to our triangle p olytope P should give us a list of one face, a triangle in 3-space:" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "polydecode(project(P,[1,0,2,1])); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 " The procedure " } {TEXT 353 8 "multpoly" }{TEXT -1 211 " takes a polytope P and a 4-by-4 rotation matrix M and multiplies each of the vertices of the polytope by M. The matrix M is a rotation matrix, the product of matrices whi ch perform simple rotations on a point " }{TEXT 354 1 "p" }{TEXT -1 130 " in 4-space. Thus, multiplying P by M rotates it about a plane i n 4-space The general idea behind this is discussed in the text." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 364 "multpoly:=proc(P,M) local i;\n[[se q([M[1,1]*P[1][i][1]+M[1,2]*P[1][i][2]+M[1,3]*P[1][i][3]+M[1,4]*P[1][i ][4],\nM[2,1]*P[1][i][1]+M[2,2]*P[1][i][2]+M[2,3]*P[1][i][3]+M[2,4]*P[ 1][i][4],\nM[3,1]*P[1][i][1]+M[3,2]*P[1][i][2]+M[3,3]*P[1][i][3]+M[3,4 ]*P[1][i][4],\nM[4,1]*P[1][i][1]+M[4,2]*P[1][i][2]+M[4,3]*P[1][i][3]+M [4,4]*P[1][i][4]],\ni=1..nops(P[1]))],P[2],P[3]];\nend:\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 88 "In order to use this procedure, we must d efine the rotation matrix M. After performing " }{TEXT 359 8 "multpol y" }{TEXT -1 165 " on a polytope P, a polytope structure is left, whic h can be projected and displayed using the procedures above. Let's ro tate our triangle in 4-space by 45 degrees." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "t:=evalf(Pi/4):\nM:=array([[cos(t),-sin(t),0,0],[sin( t),cos(t),0,0],[0,0,1,0],[0,0,0,1]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "multpoly(P,M);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 849 " For the larger polytopes, there are too may points to key them each into Maple by their coordin ates. However, due to the regularity of these objects, their vertices are generally permutations of a handful of coordinates. For example, if we wished to define a cube centered at the origin, we could place \+ a point in each of the octants of 3-space. That is, the first point w ould be at (-1,-1,-1), the second at (-1,-1,1), and the last at (1,1,1 ). (Think of the coordinates for a square with corners in the four qu adrants of the plane, and place these squares at z = 1, and z = -1.) \+ These eight points are generated by all the combinations of three posi tive or negative ones. In a similar manner, explained in the text, th e coordinates of the 16 vertices of a hypercube are generated from com binations of four positive or negative ones." }}{PARA 0 "" 0 "" {TEXT -1 138 " The following two procedures are written to generat e the coordinates of the vertices of a polytope and assign them to the list " }{TEXT 360 1 "p" }{TEXT -1 72 ". This list can then be entere d as the first element of the polytope P." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 " The procedure " }{TEXT 361 8 "getpoint" }{TEXT -1 16 " takes a vector " }{TEXT 362 1 "v" }{TEXT -1 13 " and a number " }{TEXT 365 2 " n" }{TEXT -1 63 ", which is the number of points alre ady generated. The vector " }{TEXT 363 1 "v" }{TEXT -1 114 " is the l ist of coordinates which is to be permuted. These coordinates are ass igned to entries of the point list " }{TEXT 364 1 "p" }{TEXT -1 16 ", \+ beginning at " }{XPPEDIT 18 0 "p[n+1]" "&%\"pG6#,&%\"nG\"\"\"\"\"\"F' " }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 109 "getpoint:=proc (v,n) local P,i; global p;\nP:=permute(v): for i from 1 to nops(P) do \n p[i+n]:=P[i]; od;\nend:\n" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 129 " For some coordinates of a polytope, only the even permutations are actually vertices. An eve n permutation for a list [" }{TEXT 371 10 "a, b, c, d" }{TEXT -1 20 "] is an ordering of " }{TEXT 372 1 "a" }{TEXT -1 2 ", " }{TEXT 373 1 "b " }{TEXT -1 2 ", " }{TEXT 374 1 "c" }{TEXT -1 6 ", and " }{TEXT 375 1 "d" }{TEXT -1 88 " which can be generated by switching adjacent elemen ts an even number of times. Thus, [" }{TEXT 376 10 "b, a, c, d" } {TEXT -1 33 "] is not an even permutation of [" }{TEXT 377 10 "a, b, c , d" }{TEXT -1 8 "], but [" }{TEXT 378 10 "b, c, a, d" }{TEXT -1 184 " ] is. It is obtained by first switching elements one and two, and the n the switching two and three. There are 24 permutations of a four-el ement list. There are 12 even permutations." }}{PARA 0 "" 0 "" {TEXT 366 18 " Evenperm" }{TEXT -1 37 " is a procedure which takes \+ a vector " }{TEXT 367 1 "v" }{TEXT -1 14 " and a number " }{TEXT 368 1 "n" }{TEXT -1 63 ", which is the number of points already generated. The vector " }{TEXT 369 1 "v" }{TEXT -1 206 " is the list of coordin ates which is to be evenly permuted. These coordinates are permuted i n 12 different ways. The results are not unique, however, if one of t he coordinates is repeated. That is, when " }{TEXT 379 5 "a = b" } {TEXT -1 3 ", [" }{TEXT 380 10 "a, b, c, d" }{TEXT -1 18 "] is the sam e as [" }{TEXT 381 10 "b, a, c, d" }{TEXT -1 235 "]. In order to elim inate the possibility of repeated vertices, the list is converted to a set. When this happens, Maple preserves the order and drops repeated elements. The vertices can then be assigned to entries of the point \+ list " }{TEXT 370 1 "p" }{TEXT -1 15 ", beginning at " }{XPPEDIT 18 0 "p[n+1]" "&%\"pG6#,&%\"nG\"\"\"\"\"\"F'" }{TEXT -1 1 "." }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 495 "evenperm:=proc(v,n) local P,Q,i; global p;\nf or i from 1 to 12 do P[i]:=0 od:\nP[1]:=[v[1],v[2],v[3],v[4]]:\nP[2]:= [v[1],v[3],v[4],v[2]]:\nP[3]:=[v[1],v[4],v[2],v[3]]:\nP[4]:=[v[2],v[1] ,v[4],v[3]]:\nP[5]:=[v[2],v[3],v[1],v[4]]:\nP[6]:=[v[2],v[4],v[3],v[1] ]:\nP[7]:=[v[3],v[1],v[2],v[4]]:\nP[8]:=[v[3],v[2],v[4],v[1]]:\nP[9]:= [v[3],v[4],v[1],v[2]]:\nP[10]:=[v[4],v[1],v[3],v[2]]:\nP[11]:=[v[4],v[ 2],v[1],v[3]]:\nP[12]:=[v[4],v[3],v[2],v[1]]:\nQ:=convert(P,set):\nfor i from 1 to nops(Q) do p[i+n]:=Q[i] od;\nend:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 180 " These \+ are all of the procedures used in the polytope worksheets. They are a ll defined in one execution group at the beginning of each worksheet, \+ along with the polytope." }}}}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }