Hacked fibomod to generate a big example

This commit is contained in:
Mike Lynch 2026-01-04 16:50:33 +11:00
parent 2fe2bacb60
commit 43c7eb4cd3

View File

@ -21,7 +21,7 @@ def svgpoly(points):
return f'<polygon points="{ps}" stroke="black" opacity="50%" fill="none" />' return f'<polygon points="{ps}" stroke="black" opacity="50%" fill="none" />'
def svgline(p1, p2): def svgline(p1, p2):
return f'<line x1="{p1[0]}" y1="{p1[1]}" x2="{p2[0]}" y2="{p2[1]}" stroke="black" opacity="20%"/>\n' return f'<line x1="{p1[0]}" y1="{p1[1]}" x2="{p2[0]}" y2="{p2[1]}" stroke="black" stroke-width="4" opacity="20%"/>\n'
def svglines(points): def svglines(points):
lines = "" lines = ""
@ -32,16 +32,20 @@ def svglines(points):
lines += svgline(points[-1], points[0]) lines += svgline(points[-1], points[0])
return lines return lines
print('<svg width="800" height="1200" xmlns="http://www.w3.org/2000/svg">') print('<svg width="400" height="400" xmlns="http://www.w3.org/2000/svg">')
n = 2 # n = 2
for j in range(11): # for j in range(11):
for i in range(7): # for i in range(7):
cx = 50 + i * 100 # cx = 50 + i * 100
cy = 50 + j * 100 # cy = 50 + j * 100
r = 40 # r = 40
print(svglines(fibopoly(cx, cy, r, n))) # print(svglines(fibopoly(cx, cy, r, n)))
n += 1 # n += 1
print(svglines(fibopoly(200, 200, 160, 50)))
print('</svg>') print('</svg>')