Environment for creative processing of text and numerical data

SURVO MM

2-dimensional projections of a 4-dimensional cube

S.Mustonen (1993)
2-dimensional projections of a 4-dimensional cube

Edit field:

   1 *SAVE CUBE4 / Projection of a 4-dimensional cube to 2 dimensions
   2 *Hamilton's route in a 4-dimensional cube:
   3 *MATRIX H ///
   4 *0 0 0 0
   5 *0 0 0 1
   6 *0 0 1 1
   7 *0 0 1 0
   8 *0 0 0 0
   9 *0 1 0 0
  10 *0 1 0 1
  11 *0 1 1 1
  12 *0 1 1 0
  13 *0 1 0 0
  14 *1 1 0 0
  15 *1 1 0 1
  16 *0 1 0 1
  17 *0 0 0 1
  18 *1 0 0 1
  19 *1 1 0 1
  20 *1 1 1 1
  21 *0 1 1 1
  22 *0 0 1 1
  23 *1 0 1 1
  24 *1 0 0 1
  25 *1 0 0 0
  26 *1 1 0 0
  27 *1 1 1 0
  28 *0 1 1 0
  29 *0 0 1 0
  30 *1 0 1 0
  31 *1 0 1 1
  32 *1 1 1 1
  33 *1 1 1 0
  34 *1 0 1 0
  35 *1 0 0 0
  36 *0 0 0 0
  37 *
  38 *MAT SAVE H 
  39 *MAT TRANSFORM H BY X#-0.5   / Centering (0,1) -> (-0.5,0.5)
  40 *MAT CLABELS "X" TO H        / Column labels X1,X2,X3,X4
  41 *
  42 *MAT T=ZER(4,4) 
  43 *MAT TRANSFORM T BY sin(31*I#*J#)  / "Arbitrary" T
  44 *
  45 *MAT GRAM-SCHMIDT DECOMPOSITION OF T TO Q,R  / Orthogonalization of T
  46 *MAT K=H*Q                  / Rotation of the 4-dimensional cube
  47 *MAT CLABELS "dim" TO K     / Column labels dim1,dim2,dim3,dim4
  48 *
  49 *MAT KB=ZER(33,8) 
  50 *MAT KB(1,1)=K 
  51 *MAT KB(1,5)=H 
  52 *
  53 *.......................................................................
  54 *Plotting: (white on black)
  55 *SIZE=1000,1000 SCALE=-1,1 HEADER= XDIV=0,1,0 YDIV=0,1,0 FRAME=3
  56 *FRAMES=F F=0,0,1000,1000,9 LINETYPE=[WHITE] PEN=[WHITE][SwissB(16)]
  57 *XLABEL= YLABEL= LINE=[line_type(6)][line_width(0.5)],1 TEXTS=T
  58 *
  59 *PLOT KB.MAT,dim1,dim2 / DEVICE=PS,A12.PS T=1_-_2,800,50
  60 *PLOT KB.MAT,dim1,dim3 / DEVICE=PS,A13.PS T=1_-_3,800,50
  61 *PLOT KB.MAT,dim1,dim4 / DEVICE=PS,A14.PS T=1_-_4,800,50
  62 *PLOT KB.MAT,dim2,dim3 / DEVICE=PS,A23.PS T=2_-_3,800,50
  63 *PLOT KB.MAT,dim2,dim4 / DEVICE=PS,A24.PS T=2_-_4,800,50
  64 *PLOT KB.MAT,dim3,dim4 / DEVICE=PS,A34.PS T=3_-_4,800,50
  65 *.......................................................................
  66 *SIZE=1000,1000 SCALE=-1,1 HEADER= XDIV=0,1,0 YDIV=0,1,0 FRAME=0
  67 *XLABEL= YLABEL=
  68 *LINETYPE=[WHITE]  *thin=[line_width(1)],1 *thick=[line_width(2)],1
  69 *PLOT KB.MAT,dim1,dim2 / DEVICE=PS,B12.PS IND=X1,-0.5 LINE=*thin
  70 *PLOT KB.MAT,dim1,dim2 / DEVICE=PS,C12.PS IND=X1,0.5  LINE=*thick
  71 *PLOT KB.MAT,dim1,dim3 / DEVICE=PS,B13.PS IND=X1,-0.5 LINE=*thin
  72 *PLOT KB.MAT,dim1,dim3 / DEVICE=PS,C13.PS IND=X1,0.5  LINE=*thick
  73 *PLOT KB.MAT,dim1,dim4 / DEVICE=PS,B14.PS IND=X1,-0.5 LINE=*thin
  74 *PLOT KB.MAT,dim1,dim4 / DEVICE=PS,C14.PS IND=X1,0.5  LINE=*thick
  75 *PLOT KB.MAT,dim2,dim3 / DEVICE=PS,B23.PS IND=X1,-0.5 LINE=*thin
  76 *PLOT KB.MAT,dim2,dim3 / DEVICE=PS,C23.PS IND=X1,0.5  LINE=*thick
  77 *PLOT KB.MAT,dim2,dim4 / DEVICE=PS,B24.PS IND=X1,-0.5 LINE=*thin
  78 *PLOT KB.MAT,dim2,dim4 / DEVICE=PS,C24.PS IND=X1,0.5  LINE=*thick
  79 *PLOT KB.MAT,dim3,dim4 / DEVICE=PS,B34.PS IND=X1,-0.5 LINE=*thin
  80 *PLOT KB.MAT,dim3,dim4 / DEVICE=PS,C34.PS IND=X1,0.5  LINE=*thick
  81 *
  82 *EPS JOIN K12,A12,B12,C12 
  83 *EPS JOIN K13,A13,B13,C13 
  84 *EPS JOIN K14,A14,B14,C14 
  85 *EPS JOIN K23,A23,B23,C23 
  86 *EPS JOIN K24,A24,B24,C24 
  87 *EPS JOIN K34,A34,B34,C34 
  88 *
  89 *K12=K12,0,2000
  90 *K13=K13,0,1000   K23=K23,1000,1000
  91 *K14=K14          K24=K24,1000,0      K34=K34,2000,0
  92 *
  93 *EPS JOIN CUBE4,K12,K13,K14,K23,K24,K34 
  94 *
  95 *
  96 *PRINT CUR+1,E 
  97 - picture CUBE4.PS,200,200,0.5,0.5
  98 E
  99 *
 100 *



Home  |  News  |  Publications  |  Download  |  Flash
Copyright © Survo Systems 2001-2008. All rights reserved.
Updated 2008-10-20 by webmaster'at'survo.fi.
Best viewed with any browser.