A community-maintained Python framework for creating mathematical animations.
Some simple typo fixes
Grant Sanderson37a47b5d3dd6
diff --git a/animation/transform.py b/animation/transform.pyindex 78ed2b4d7..311db06c4 100644--- a/animation/transform.py+++ b/animation/transform.py@@ -91,7 +91,7 @@ class CyclicReplace(Transform):start = Group(*mobjects)target = Group(*[m1.copy().move_to(m2)- for m1, m2 in adjascent_pairs(start)+ for m1, m2 in adjacent_pairs(start)])Transform.__init__(self, start, target, **kwargs)diff --git a/constants.py b/constants.pyindex 3fda24c5c..3e82f89bf 100644--- a/constants.py+++ b/constants.py@@ -1,8 +1,10 @@import osimport numpy as np-DEFAULT_HEIGHT = 1080-DEFAULT_WIDTH = 1920+# DEFAULT_HEIGHT = 1080+# DEFAULT_WIDTH = 1920+DEFAULT_HEIGHT = 4*1920+DEFAULT_WIDTH = 4*1080LOW_QUALITY_FRAME_DURATION = 1./20MEDIUM_QUALITY_FRAME_DURATION = 1./30diff --git a/helpers.py b/helpers.pyindex 6b358da3d..6832fbdef 100644--- a/helpers.py+++ b/helpers.py@@ -202,7 +202,7 @@ def list_difference_update(l1, l2):def all_elements_are_instances(iterable, Class):return all(map(lambda e : isinstance(e, Class), iterable))-def adjascent_pairs(objects):+def adjacent_pairs(objects):return zip(objects, list(objects[1:])+[objects[0]])def complex_to_R3(complex_num):@@ -375,7 +375,7 @@ def counterclockwise_path():################################################-def to_cammel_case(name):+def to_camel_case(name):return "".join([filter(lambda c : c not in string.punctuation + string.whitespace, part@@ -407,7 +407,7 @@ def invert_image(image):arr = (255 * np.ones(arr.shape)).astype(arr.dtype) - arrreturn Image.fromarray(arr)-def streth_array_to_length(nparray, length):+def stretch_array_to_length(nparray, length):curr_len = len(nparray)if curr_len > length:raise Warning("Trying to stretch array to a length shorter than its own")diff --git a/mobject/image_mobject.py b/mobject/image_mobject.pyindex ff94e82e3..22b0eda78 100644--- a/mobject/image_mobject.py+++ b/mobject/image_mobject.py@@ -23,7 +23,7 @@ class ImageMobject(PMobject):def __init__(self, image_file, **kwargs):digest_locals(self)Mobject.__init__(self, **kwargs)- self.name = to_cammel_case(+ self.name = to_camel_case(os.path.split(image_file)[-1].split(".")[0])possible_paths = [diff --git a/mobject/point_cloud_mobject.py b/mobject/point_cloud_mobject.pyindex f73a64503..4f7dbb730 100644--- a/mobject/point_cloud_mobject.py+++ b/mobject/point_cloud_mobject.py@@ -115,7 +115,7 @@ class PMobject(Mobject):def align_points_with_larger(self, larger_mobject):assert(isinstance(larger_mobject, PMobject))self.apply_over_attr_arrays(- lambda a : streth_array_to_length(+ lambda a : stretch_array_to_length(a, larger_mobject.get_num_points()))diff --git a/mobject/region.py b/mobject/region.pyindex 019e2c6f5..d5ba70ff0 100644--- a/mobject/region.py+++ b/mobject/region.py@@ -65,7 +65,7 @@ def region_from_line_boundary(*lines, **kwargs):return regdef region_from_polygon_vertices(*vertices, **kwargs):- return region_from_line_boundary(*adjascent_pairs(vertices), **kwargs)+ return region_from_line_boundary(*adjacent_pairs(vertices), **kwargs)def plane_partition(*lines, **kwargs):diff --git a/old_projects/borsuk.py b/old_projects/borsuk.pyindex 4d1dc65fa..6f257e162 100644--- a/old_projects/borsuk.py+++ b/old_projects/borsuk.py@@ -41,7 +41,7 @@ class Jewel(VMobject):compass_vects = list(compass_directions(self.num_equator_points))if vect is IN:compass_vects.reverse()- for vect_pair in adjascent_pairs(compass_vects):+ for vect_pair in adjacent_pairs(compass_vects):self.add(Polygon(vect, *vect_pair))self.scale_to_fit_height(self.height)self.rotate(-np.pi/2-np.pi/24, RIGHT)diff --git a/old_projects/complex_multiplication_article.py b/old_projects/complex_multiplication_article.pyindex 0b9f9fadb..6fa8d0062 100644--- a/old_projects/complex_multiplication_article.py+++ b/old_projects/complex_multiplication_article.py@@ -155,7 +155,7 @@ class DrawSolutionsToZToTheNEqualsW(Scene):Dot(point, color = BLUE_B, radius = 0.1)for point in points]- lines = [Line(*pair) for pair in adjascent_pairs(points)]+ lines = [Line(*pair) for pair in adjacent_pairs(points)]self.add(plane, circle, *dots+lines)self.add(*plane.get_coordinate_labels())diff --git a/old_projects/eola/chapter10.py b/old_projects/eola/chapter10.pyindex 57466cb65..6a76d93cc 100644--- a/old_projects/eola/chapter10.py+++ b/old_projects/eola/chapter10.py@@ -293,7 +293,7 @@ class IHatAsEigenVector(ExampleTranformationScene):]lines = [Line(v1.get_end(), v2.get_end(), color = YELLOW)- for v1, v2 in adjascent_pairs([self.i_hat]+targets)+ for v1, v2 in adjacent_pairs([self.i_hat]+targets)]for target, line in zip(targets, lines):self.play(diff --git a/old_projects/triples.py b/old_projects/triples.pyindex 42b14c25a..f0a406536 100644--- a/old_projects/triples.py+++ b/old_projects/triples.py@@ -3070,6 +3070,45 @@ class Thumbnail(DrawRadialLines):triples.next_to(rect.get_top(), DOWN)self.add(rect, triples)+class Poster(DrawRadialLines):+ CONFIG = {+ "final_unit_size" : 0.1,+ "plane_center" : ORIGIN,+ }+ def construct(self):+ self.force_skipping()+ self.add_plane()+ self.add_transformed_color_grid()+ self.color_grid.set_stroke(width = 5)+ self.resize_plane()+ self.add_dots()+ self.create_lines()+ self.show_single_line()+ self.show_all_lines()++ for dot_group in self.dots, self.new_dots:+ for dot in dot_group.family_members_with_points():+ dot.scale_in_place(0.5)+ self.remove(self.coordinate_labels)++ # rect = Rectangle(+ # height = 4.3, width = 4.2,+ # stroke_width = 3,+ # stroke_color = WHITE,+ # fill_color = BLACK,+ # fill_opacity = 1,+ # )+ # rect.to_corner(UP+RIGHT, buff = 0.01)+ # triples = VGroup(*map(TexMobject, [+ # "3^2 + 4^2 = 5^2",+ # "5^2 + 12^2 = 13^2",+ # "8^2 + 15^2 = 17^2",+ # "\\vdots"+ # ]))+ # triples.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF)+ # triples.next_to(rect.get_top(), DOWN)+ # self.add(rect, triples)+diff --git a/old_projects/wcat.py b/old_projects/wcat.pyindex 49cd18d04..677c76ead 100644--- a/old_projects/wcat.py+++ b/old_projects/wcat.py@@ -109,7 +109,7 @@ class ClosedLoopScene(Scene):def add_connecting_lines(self, cyclic = False):if cyclic:- pairs = adjascent_pairs(self.dots)+ pairs = adjacent_pairs(self.dots)else:n_pairs = len(list(self.dots))/2pairs = zip(self.dots[:n_pairs], self.dots[n_pairs:])