After running 2to3

This commit is contained in:
Grant Sanderson
2018-08-09 17:56:05 -07:00
parent 06a65190e7
commit 858051a806
172 changed files with 2117 additions and 2221 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
from __future__ import absolute_import
import numpy as np
import itertools as it
import operator as op
@ -37,7 +37,7 @@ def count_sections(*radians):
]
dots = [Dot(point) for point in points]
interior = Region(lambda x, y : x**2 + y**2 < RADIUS**2)
for x in xrange(1, len(points)):
for x in range(1, len(points)):
if x == 1:
sc.animate(ShowCreation(dots[0]), ShowCreation(dots[1]))
sc.add(dots[0], dots[1])
@ -45,7 +45,7 @@ def count_sections(*radians):
sc.animate(ShowCreation(dots[x]))
sc.add(dots[x])
new_lines = Mobject(*[
Line(points[x], points[y]) for y in xrange(x)
Line(points[x], points[y]) for y in range(x)
])
sc.animate(Transform(deepcopy(dots[x]), new_lines, run_time = 2.0))
sc.add(new_lines)
@ -53,7 +53,7 @@ def count_sections(*radians):
regions = plane_partition_from_points(*points[:x+1])
for reg in regions:
reg.intersect(interior)
regions = filter(lambda reg : reg.bool_grid.any(), regions)
regions = [reg for reg in regions if reg.bool_grid.any()]
last_num = None
for reg, count in zip(regions, it.count(1)):
@ -81,9 +81,9 @@ def summarize_pattern(*radians):
]
dots = [Dot(point) for point in points]
last_num = None
for x in xrange(len(points)):
for x in range(len(points)):
new_lines = Mobject(*[
Line(points[x], points[y]) for y in xrange(x)
Line(points[x], points[y]) for y in range(x)
])
num = TexMobject(str(moser_function(x + 1))).center()
sc.animate(
@ -110,7 +110,7 @@ def connect_points(*radians):
sc.add(*dots)
anims = []
all_lines = []
for x in xrange(len(points)):
for x in range(len(points)):
lines = [Line(points[x], points[y]) for y in range(len(points))]
lines = Mobject(*lines)
anims.append(Transform(deepcopy(dots[x]), lines, run_time = 3.0))