Constructs two aperiodic penrose-tilings consisting of kites and darts by the method of inflation in six steps.
Starting points are the patterns “sun“ consisting of five kites and “star“ consisting of five darts.
For more information see: http://en.wikipedia.org/wiki/Penrose_tiling ------------------------------------------- “““ from turtle import * from math import cos pi from time import perf_counter as clock sleep
f = (5**0.5-1)/2.0 # (sqrt(5)-1)/2 -- golden ratio d = 2 * cos(3*pi/10)
def kite(l): fl = f * l lt(36) fd(l) rt(108) fd(fl) rt(36) fd(fl) rt(108) fd(l) rt(144)
def dart(l): fl = f * l lt(36) fd(l) rt(144) fd(fl) lt(36) fd(fl) rt(144) fd(l) rt(144)
def inflatekite(l n): if n == 0: px py = pos() h x y = int(heading())
评论
共有 条评论