diff --git a/animation/transform.py b/animation/transform.py index 78ed2b4d..311db06c 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.py index 3fda24c5..3e82f89b 100644 --- a/constants.py +++ b/constants.py @@ -1,8 +1,10 @@ import os import numpy as np -DEFAULT_HEIGHT = 1080 -DEFAULT_WIDTH = 1920 +# DEFAULT_HEIGHT = 1080 +# DEFAULT_WIDTH = 1920 +DEFAULT_HEIGHT = 4*1920 +DEFAULT_WIDTH = 4*1080 LOW_QUALITY_FRAME_DURATION = 1./20 MEDIUM_QUALITY_FRAME_DURATION = 1./30 diff --git a/helpers.py b/helpers.py index 6b358da3..6832fbde 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) - arr return 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.py index ff94e82e..22b0eda7 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.py index f73a6450..4f7dbb73 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.py index 019e2c6f..d5ba70ff 100644 --- a/mobject/region.py +++ b/mobject/region.py @@ -65,7 +65,7 @@ def region_from_line_boundary(*lines, **kwargs): return reg def 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.py index 4d1dc65f..6f257e16 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.py index 0b9f9fad..6fa8d006 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.py index 57466cb6..6a76d93c 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.py index 42b14c25..f0a40653 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.py index 49cd18d0..677c76ea 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))/2 pairs = zip(self.dots[:n_pairs], self.dots[n_pairs:])