# === Python v. 3.1 === """ Investigating T,E,K modules with Extended Precision by Kirby Urner 4D Solutions Nov 29, 2009 Blog post about: http://controlroom.blogspot.com/2009/11/back-in-saddle.html """ from decimal import Decimal, getcontext getcontext().prec = 31 # whole numbers d1,d2,d3,d4,d5,d6 = [Decimal(i) for i in range(1,7)] # fractions dthird = d1/d3 dhalf = d1/d2 # surds droot2 = d2.sqrt() droot5 = d5.sqrt() # constants # http://www.rwgrayprojects.com/synergetics/s09/figs/f86210.html syn3 = d3/pow(droot2, d3) # tetravolume:cubevolume phi = (d1 + droot5)/d2 # golden ratio # 7.5 to 5.0 vol change = 3rd root 2/3 linear change scalefactor = pow(d2/d3, d1/d3) def tvolume(h): # http://www.rwgrayprojects.com/synergetics/s09/figs/f86411a.html # http://www.rwgrayprojects.com/synergetics/s09/figs/f86411b.html AC, BC, OC = ((h/d2) * (droot5 - d1), (h/d2) * (d3 - droot5), h) base = dhalf * (AC * OC) return dthird * base * BC # T module (1/120th of volume 5 rhombic triacontahedron) h = (phi/droot2) * scalefactor tvol = tvolume(h) print(h) print("T Module") print("T in tetravolumes: ", tvol * syn3) print("Rh Triacontrahedron: ", 120 * tvol * syn3) # E module (1/120th of rhombic triacontahedron with radius 1) h = d1 evol = tvolume(h) print("E Module") print("E in tetravolumes: ", evol * syn3) print("Rh Triacontrahedron: ", 120 * evol * syn3) # K module (1/120th of volume 7.5 rhombic triacontahedron) h = phi/droot2 kvol = tvolume(h) print("K Module") print("K in tetravolumes: ", kvol * syn3) print("Rh Triacontrahedron: ", 120 * kvol * syn3) from turtle import Screen, Turtle from random import randint from math import sqrt def planeNet(h = 500.0): # http://www.rwgrayprojects.com/synergetics/s09/figs/f86411a.html # http://www.rwgrayprojects.com/synergetics/s09/figs/f86411b.html s = Screen(); s.setup(560,560); s.title("Plane Net for T-module") s.tracer(True) writer = Turtle(visible=True, shape="turtle") writer.penup(); writer.goto(-245, -245); writer.pendown() writer.color("Black","") for i in range(4): # square of edge h writer.forward(h); writer.left(90) writer.left(31.717); writer.forward(sqrt( (5 - sqrt(5))/2) * h) writer.left(2 * 58.283); writer.forward(sqrt(5-2*sqrt(5)) * h) writer.left(31.717 + 69.095) writer.forward(sqrt((9 - 3*sqrt(5))/2) * h) def optional(): # bonus feature planeNet() optional()