Skip to content

Commit

Permalink
moved experiments to own functions, created main,
Browse files Browse the repository at this point in the history
added experiment with some cool parameters found on wikipedia
  • Loading branch information
paigeweber13 committed Nov 18, 2019
1 parent b25ea78 commit 225c831
Showing 1 changed file with 40 additions and 10 deletions.
50 changes: 40 additions & 10 deletions fraktell-generations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,49 @@

golden_ratio=1.618

def run_julia_hs(size, ca, cb):
def main():
# experiment_around_065i()
# experiment_between_04_and_151()
# some_pretty_ones()
high_resolution_ones()

def run_julia_hs(size, ca, cb, output_dir='images'):
c_str = "{:.3f}+{:.3f}i".format(ca, cb)
subprocess.run(['stack', 'run', '1.5', str(size), str(size), '50',
'images/output' + c_str + '.png', 'RPU', '1',
output_dir + '/julia' + c_str + '.png', 'RPU', '1',
'(' + str(ca) + ' :+ ' + str(cb) +')'])
print('image', c_str, 'created with c =', c_str)

a = 0.4
while a < 0.88:
run_julia_hs(100, 0, a)
a += 0.01
def experiment_around_065i():
# a = 0.64
a = 0.646
# while a < 0.68:
while a < 0.66:
run_julia_hs(1000, 0, a)
a += 0.001

def experiment_between_04_and_151():
a = 0.4
while a < 1.51:
run_julia_hs(100, 0, a)
a += 0.01

def some_pretty_ones():
size = 1000
run_julia_hs(size, 1-golden_ratio, 0)
run_julia_hs(size, golden_ratio-2, golden_ratio-1)
run_julia_hs(size, golden_ratio-2, golden_ratio-1)
run_julia_hs(size, -0.70176, -0.3842)
run_julia_hs(size, -0.835, -0.2321)
run_julia_hs(size, -0.8, -0.156)
run_julia_hs(size, -0.7269, -0.1889)

def high_resolution_ones():
size = 10000
run_julia_hs(size, 0, 0.7885 * exp(-pi/16), output_dir='images/high-res')
run_julia_hs(size, 0.8, -0.156, output_dir='images/high-res')
run_julia_hs(size, 0.835, -0.232, output_dir='images/high-res')
run_julia_hs(size, 0.285, 0, output_dir='images/high-res')

# a = 0.64
# while a < 0.68:
# run_julia_hs(100, 0, a)
# a += 0.001
if __name__ == '__main__':
main()

0 comments on commit 225c831

Please sign in to comment.