# C6: paint off, one pixel: flip every frame through each decay (exact residue method, N=2, C=1), the box-k
# floor 1/(sqrt(12) k) attained by a period-k lattice (exact), and best one-pixel lattice C/N.  run: python3 c6_flip.py
import math, numpy as np
from c1_exact import exact_J
ident = {(0, 0): 1.0}
for ms in (20, 40, 80):
    a = math.exp(-1000/60/ms)
    print(f'decay {ms}: flip every frame {math.sqrt(exact_J(0, 0, 1, 2, ident, ("decay", a))):.4f}')
for k in (2, 3, 4, 6):
    print(f'box {k}: lattice (0,0,1)/{k} {math.sqrt(exact_J(0, 0, 1, k, ident, ("box", k))):.5f}  1/(sqrt12 k) {1/math.sqrt(12)/k:.5f}')
