Programmatic Construction of Celtic Knots


P = Primary Grid
S = Secondary Grid
V = Vertex


P -- V -- P -- V -- P
|    |    |    |    |
V -- S -- V -- S -- V
|    |    |    |    |
P -- V -- P -- V -- P
|    |    |    |    | 
V -- S -- V -- S -- V
|    |    |    |    |
P -- V -- P -- V -- P

There are 7 basic shapes, each of which
can be rotated. Shapes 1 - 6 have 4 rotations
(+90), shape 7 only 2 (bilaterally symmetrical).
This gives 26 total shapes.

There are four basic positions; moving clockwise
around the secondary grid element, they would be

PVSV  (or PV)
VPVS  (or VP)
SVPV  (or SV)
VSVP  (or VS)

Each has a separate, 9 state, table associated with
it. 

V has the following values:
0 = No limitation
1 = Primary limitation
2 = Secondary limitation


        PV         VP         SV        VS

00      A          B          C          D    
01      E          F          G          H
02      I          J          K          L
10      Q          R          S          T
11      M          N	      O          P
12      Y          Z          Y          Z 
20      U          V          W          X
21      Z          Y          Z          Y
22      O          P          M          N



0000 ABCD
0001 ABGT
0002 ABKX
0010 AFSD
0011 AFOT
0012 AFYX
0020 AJWD
0021 AJZT
0022 AJMX
0100 ERCD
0101 ERGT
0102 ERKX
0110 ENSD
0111 ENOT
0112 ENYX
0120 EZWD
0121 EZZT
0122 EZMX
0200 IVCD
0201 IVGT
0202 IVKX
0210 IYSD
0211 IYOT
0212 IYYX
0220 IPWD
0221 IPZT
0222 IPMX
1000 QBCH
1001 QBGP
1002 QBKY
1010 QFSH
1011 QFOP
1012 QFYY
1020 QJWH
1021 QJZP
1022 QJMY
1100 MRCH
1101 MRGP
1102 MRKY
1110 MNSH
1111 MNOP
1112 MNYY
1120 MZWH
1121 MZZP
1122 MZMY
1200 YVCH
1201 YVGP
1202 YVKY
1210 YYSH
1211 YYOP
1212 YYYY
1220 YPWH
1221 YPZP
1222 YPMY
2000 UBCL
2001 UBGZ
2002 UBKN
2010 UFSL
2011 UFOZ
2012 UFYN
2020 UJWL
2021 UJZZ
2022 UJMN
2100 ZRCL
2101 ZRGZ
2102 ZRKN
2110 ZNSL
2111 ZNOZ
2112 ZNYN
2120 ZZWL
2121 ZZZZ
2122 ZZMN
2200 OVCL
2201 OVGZ
2202 OVKN
2210 OYSL
2211 OYOZ
2212 OYYN
2220 OPWL
2221 OPZZ
2222 OPMN



p -- V2 - P	
|    |    | 
V1 - S -- V3
|    |    |
P -- V4 - P

square = 0

v1 =  -1
v2 =  -x -1 
v3 =   0
v4 =   x

sy = -32
 |
for i = 1 to x

   v1 = v1 + x + 2
   v2 = v2 + x + 2
   v3 = v3 + x + 2
   v4 = v4 + x + 2
  
   sy = sy + 32
   x1 = 0
   y1 = sy
   x2 = 16
   y2 = sy
   x3 = 16
   y3 = sy + 16
   x4 = 0
   y4 = sy + 16

   for j = 1 to x
  
      square = square + 1
      create square square
      square.v1 = v1
      square.v2 = v2
      square.v3 = v3
      square.v4 = v4
      v1 = v1 + 1
      v2 = v2 + 1
      v3 = v3 + 1
      v4 = v4 + 1

   endfor (j)
 
   

endfor (i)

Check For Any Browser Compatibility Valid HTML 3.2!
Celtic Knots / sirkodnap@earthlink.net / revised May 99