The sides of each tile are in proportion to powers of this constant, as are the different sizes of tile. A tile can be decomposed into smaller tiles of the same shape (or its mirror image).
Code: Select all
10 REM Tessellation based on the Plastic Constant, by Vesa Timonen
20 VDU 23,22,800;512;16,20,16,128
30 INSTALL @lib$ + "aagfxlib"
40
50 sr = SQR(23/27)
60 w1 = (1 + sr) / 2
70 w2 = (1 - sr) / 2
80 Plastic = w1^(1/3) + w2^(1/3)
90 Scale = 90
100
110 x = 50 : y = 20
120 FOR tile% = 1 TO 27
130 READ A%, B%, C%, D%
140 PROCvesa(x, y, A%, B%, C%, D%)
150 NEXT
160
170 DATA 0, 1, 1, 1, 1 , 4, 1, 0, 1, -2, 2, 3, -2, -3, 4, 0, -1, 2, 0, 4, 2, 1, 0, 1
180 DATA 0, -1, 1, 0, 1, -2, 1, 1, -1, 4, 1, 0, 0, 1, 2, 3, -2, -3, 1, 0, -2, 1, 2, 4
190 DATA 3, 2, 0, 1, -1, -2, 1, 1, 1, -4, 1, 0, 3, 4, 1, 0, -2, 1, 2, 0, 0, -1, 2, 3
200 DATA -2, 1, 0, 2, 2, -3, 1, 0, 0, 1, 0, 2, 3, 4, 1, 0, 3, -2, 2, 4, 3, 2, 1, 0
210 DATA 2, 1, 0, 2, -1, 4, 1, 0, -1, -2, 2, 4
220
230 END
240
250 DEF PROCvesa(RETURN x, RETURN y, A%, S%, N%, P%)
260 LOCAL C%, I%, a, r, s, t, c%(), s%(), x(), y()
270 DIM c%(4), s%(4), x(5), y(5)
280
290 c%() = 0, &FF00FFFF, &FF00FF00, &FFFF60FF, &FFFFFF80
300 s%() = 5, 4, 2, 0, 3
310
320 C% = c%(ABS(S%))
330 a = A% * 60
340 s = Scale / Plastic ^ (ABS(S%)-1)
350 t = 120 * SGN(S%)
360
370 FOR I% = 0 TO 5
380 x(I%) = x
390 y(I%) = y
400 r = s * Plastic ^ s%(N%)
410 x += r * COSRAD(a)
420 y += r * SINRAD(a)
430 N% = (N% + 1) MOD 5
440 IF N% = 3 a -= t ELSE a += t
450 NEXT
460
470 PROC_aapolygon(5, x(), y(), C%)
480 PROC_aapolyline(6, x(), y(), 2, &FF000000, 0)
490
500 x = x(P%) : y = y(P%)
510 ENDPROC