Skip to content

Instantly share code, notes, and snippets.

@telliott99
Created October 12, 2018 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save telliott99/433a73eb708e25a1d6f6ba5291f48ebf to your computer and use it in GitHub Desktop.
Save telliott99/433a73eb708e25a1d6f6ba5291f48ebf to your computer and use it in GitHub Desktop.
def next(S,C,T):
C2 = (0.5 * (1 + C))**0.5
S2 = 0.5 * S / C2
T2 = S/(1+C)
return S2,C2,T2
S = 1/2**0.5
C = S
T = S/C
n = 4
for i in range(15):
print "round " + str(i+1)
print n
print n * S
print n * T
print
n *= 2
S,C,T = next(S,C,T)
import math
print math.pi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment