From d5cb0b22947c7e9907a949835b879029c9e28675 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Mon, 15 Jan 2018 19:15:05 -0800 Subject: [PATCH] Finally changed dither to wait --- active_projects/WindingNumber.py | 12 +- active_projects/fourier.py | 24 +- constants.py | 2 +- eop/bayes.py | 206 +++++----- eop/bayes_footnote.py | 146 +++---- eop/combinations.py | 278 ++++++------- eop/independence.py | 286 ++++++------- example_scenes.py | 13 +- nn/part1.py | 310 +++++++------- nn/part2.py | 226 +++++------ nn/part3.py | 314 +++++++------- old_projects/256.py | 74 ++-- old_projects/bell.py | 130 +++--- old_projects/borsuk.py | 200 ++++----- old_projects/brachistochrone/curves.py | 46 +-- old_projects/brachistochrone/cycloid.py | 50 +-- .../brachistochrone/drawing_images.py | 22 +- old_projects/brachistochrone/graveyard.py | 18 +- old_projects/brachistochrone/light.py | 80 ++-- old_projects/brachistochrone/misc.py | 48 +-- old_projects/brachistochrone/multilayered.py | 36 +- old_projects/brachistochrone/wordplay.py | 72 ++-- .../complex_multiplication_article.py | 2 +- old_projects/counting_in_binary.py | 34 +- old_projects/crypto.py | 366 ++++++++--------- old_projects/domino_play.py | 22 +- old_projects/efvgt.py | 362 ++++++++--------- old_projects/eoc/chapter1.py | 276 ++++++------- old_projects/eoc/chapter10.py | 326 +++++++-------- old_projects/eoc/chapter2.py | 238 +++++------ old_projects/eoc/chapter3.py | 246 +++++------ old_projects/eoc/chapter4.py | 270 ++++++------ old_projects/eoc/chapter5.py | 202 ++++----- old_projects/eoc/chapter6.py | 294 +++++++------- old_projects/eoc/chapter7.py | 344 ++++++++-------- old_projects/eoc/chapter8.py | 278 ++++++------- old_projects/eoc/chapter9.py | 158 +++---- old_projects/eoc/footnote.py | 74 ++-- old_projects/eoc/old_chapter1.py | 220 +++++----- old_projects/eola/chapter0.py | 92 ++--- old_projects/eola/chapter1.py | 164 ++++---- old_projects/eola/chapter10.py | 264 ++++++------ old_projects/eola/chapter11.py | 180 ++++---- old_projects/eola/chapter2.py | 106 ++--- old_projects/eola/chapter3.py | 216 +++++----- old_projects/eola/chapter4.py | 132 +++--- old_projects/eola/chapter5.py | 130 +++--- old_projects/eola/chapter6.py | 240 +++++------ old_projects/eola/chapter7.py | 182 ++++----- old_projects/eola/chapter8.py | 150 +++---- old_projects/eola/chapter8p2.py | 76 ++-- old_projects/eola/chapter9.py | 152 +++---- old_projects/eola/footnote.py | 36 +- old_projects/eola/footnote2.py | 68 ++-- old_projects/eulers_characteristic_formula.py | 158 +++---- old_projects/fractal_charm.py | 6 +- old_projects/fractal_dimension.py | 324 +++++++-------- old_projects/generate_logo.py | 2 +- old_projects/hanoi.py | 334 +++++++-------- old_projects/highD.py | 384 +++++++++--------- old_projects/hilbert/fractal_porn.py | 20 +- old_projects/hilbert/section1.py | 146 +++---- old_projects/hilbert/section2.py | 128 +++--- old_projects/hilbert/section3.py | 24 +- old_projects/inventing_math.py | 204 +++++----- old_projects/leibniz.py | 370 ++++++++--------- old_projects/matrix_as_transform_2d.py | 34 +- old_projects/moser_intro.py | 26 +- old_projects/moser_main.py | 110 ++--- old_projects/mug.py | 144 +++---- old_projects/music_and_measure.py | 158 +++---- old_projects/patreon.py | 56 +-- old_projects/putnam.py | 144 +++---- old_projects/qa_round_two.py | 10 +- old_projects/tattoo.py | 102 ++--- old_projects/tau_poem.py | 38 +- old_projects/triangle_of_power/end.py | 48 +-- old_projects/triangle_of_power/intro.py | 44 +- old_projects/triangle_of_power/triangle.py | 82 ++-- old_projects/triples.py | 258 ++++++------ old_projects/waves.py | 230 +++++------ old_projects/wcat.py | 196 ++++----- old_projects/zeta.py | 300 +++++++------- scene/reconfigurable_scene.py | 2 +- scene/scene.py | 4 +- topics/arithmetic.py | 4 +- topics/characters.py | 16 +- topics/combinatorics.py | 6 +- topics/common_scenes.py | 6 +- topics/matrix.py | 4 +- topics/vector_space_scene.py | 8 +- 91 files changed, 6314 insertions(+), 6309 deletions(-) diff --git a/active_projects/WindingNumber.py b/active_projects/WindingNumber.py index fca62674..ca925600 100644 --- a/active_projects/WindingNumber.py +++ b/active_projects/WindingNumber.py @@ -246,7 +246,7 @@ class EquationSolver1d(GraphScene, ZoomedScene, ReconfigurableScene): upperY = midY self.remove(midXLine, midDot, midYLine) - self.dither() + self.wait() def construct(self): self.drawGraph() @@ -354,7 +354,7 @@ class LoopSplitScene(Scene): loop = SGroup(*line_list) for line in line_list: self.add(*line) - self.dither() + self.wait() # TODO: Make the following a continual animation, and on all split loops do the same # bullet = TexMobject("*", fill_color = RED) @@ -402,14 +402,14 @@ class LoopSplitScene(Scene): ApplyMethod(right_closed_loop.shift, RIGHT) ) - self.dither() + self.wait() self.play( ApplyMethod(left_open_loop.shift, LEFT), ApplyMethod(right_open_loop.shift, RIGHT) ) - self.dither() + self.wait() mid_lines = SGroup(mid_line_left, mid_line_right) @@ -417,11 +417,11 @@ class LoopSplitScene(Scene): highlight_circle.surround(mid_lines) self.play(Indicate(mid_lines), ShowCreation(highlight_circle, run_time = 0.5)) - self.dither() + self.wait() self.play(FadeOut(highlight_circle), FadeOut(mid_lines)) - self.dither() + self.wait() class EquationSolver2d(ZoomedScene): #TODO diff --git a/active_projects/fourier.py b/active_projects/fourier.py index fc4e67ec..caf0a4ea 100644 --- a/active_projects/fourier.py +++ b/active_projects/fourier.py @@ -132,7 +132,7 @@ class AddingPureFrequencies(PiCreatureScene): GrowFromCenter(brace), Write(words) ) - self.dither() + self.wait() graph.save_state() self.play( FadeOut(brace), @@ -167,7 +167,7 @@ class AddingPureFrequencies(PiCreatureScene): n_circles = 6, ) self.play(randy.change, "confused", graph) - self.dither(2) + self.wait(2) self.set_variables_as_attrs( D_label, @@ -184,7 +184,7 @@ class AddingPureFrequencies(PiCreatureScene): for graph in self.A_graph, self.D_graph ] ) - self.dither() + self.wait() def separate_out_parts(self): axes = self.axes @@ -215,7 +215,7 @@ class AddingPureFrequencies(PiCreatureScene): for mob in randy, speaker ] )) - self.dither() + self.wait() self.set_variables_as_attrs(A_axes, D_axes) @@ -243,9 +243,9 @@ class AddingPureFrequencies(PiCreatureScene): self.play(GrowFromCenter(v_line)) self.play(FadeOut(v_line)) self.play(*map(ShowCreation, lines)) - self.dither() + self.wait() self.play(MoveToTarget(sum_lines, path_arc = np.pi/4)) - self.dither(2) + self.wait(2) self.play(*[ Transform( line, @@ -280,7 +280,7 @@ class AddingPureFrequencies(PiCreatureScene): run_time = 15, rate_func = None ) - self.dither() + self.wait() self.sum_graph = sum_graph @@ -346,7 +346,7 @@ class AddingPureFrequencies(PiCreatureScene): (axes, new_sum_graph), ] ]) - self.dither() + self.wait() #### @@ -484,7 +484,7 @@ class BreakApartSum(Scene): self.play(ShowCreation(h_line)) for pure_graph in reversed(pure_graphs): self.play(ReplacementTransform(graph.copy(), pure_graph)) - self.dither() + self.wait() self.all_graphs = VGroup(graph, h_line, pure_graphs) self.pure_graphs = pure_graphs @@ -513,7 +513,7 @@ class BreakApartSum(Scene): ) self.play(FadeOut(rect)) self.play(Blink(randy)) - self.dither() + self.wait() class Quadrant(Mobject1D): CONFIG = { @@ -604,10 +604,10 @@ class MachineThatTreatsOneFrequencyDifferently(Scene): self.change_graph_frequency(1) graph.highlight(GREEN) - self.dither() + self.wait() graph.highlight(YELLOW) self.change_graph_frequency(2) - self.dither() + self.wait() def change_graph_frequency(self, frequency, run_time = 2): diff --git a/constants.py b/constants.py index 2aa27934..12f2a72e 100644 --- a/constants.py +++ b/constants.py @@ -43,7 +43,7 @@ DEFAULT_MOBJECT_TO_MOBJECT_BUFFER = MED_SMALL_BUFF #All in seconds DEFAULT_ANIMATION_RUN_TIME = 1.0 DEFAULT_POINTWISE_FUNCTION_RUN_TIME = 3.0 -DEFAULT_DITHER_TIME = 1.0 +DEFAULT_wait_TIME = 1.0 ORIGIN = np.array(( 0., 0., 0.)) diff --git a/eop/bayes.py b/eop/bayes.py index b7ac737c..0cb25d40 100644 --- a/eop/bayes.py +++ b/eop/bayes.py @@ -84,8 +84,8 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene): card.scale(0.01) card.move_to(deck[-1], UP+RIGHT) self.play(LaggedStart(MoveToTarget, group, lag_ratio = 0.8)) - self.dither() - self.dither() + self.wait() + self.wait() self.community_cards = community_cards self.deck = deck @@ -136,13 +136,13 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene): remover = True, )) self.play(you.change, "hooray", straight_cards) - self.dither(2) + self.wait(2) self.play( selected_community_cards.restore, you.hand.restore, you.change_mode, "happy" ) - self.dither() + self.wait() def show_flush_potential(self): you, her = self.you, self.her @@ -200,7 +200,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene): hearts, new_symbols, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play(FadeOut(heart_qs)) self.play( heart_cards.restore, @@ -244,7 +244,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene): ) self.play(LaggedStart(FadeIn, equation)) - self.dither(2) + self.wait(2) self.play( FadeIn(num_hearts), ShowCreation(num_hearts_arrow), @@ -255,7 +255,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene): ShowCreation(num_cards_arrow), fourty_five.highlight, BLUE ) - self.dither(3) + self.wait(3) equation.remove(percentage) self.play(*map(FadeOut, [ equation, @@ -290,9 +290,9 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene): self.play(*map(GrowFromCenter, [ brace for brace in braces ])) - self.dither(2) + self.wait(2) self.play(Write(bottom_label)) - self.dither(2) + self.wait(2) self.sample_space = sample_space @@ -315,8 +315,8 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene): hand.scale(0.01) hand.move_to(part.get_right()) self.play(hand.restore) - self.dither() - self.dither() + self.wait() + self.wait() self.play(*map(FadeOut, it.chain(*hand_lists))) def place_high_bet(self): @@ -345,7 +345,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene): run_time = 5, )) self.play(you.change_mode, "confused") - self.dither() + self.wait() self.money = money @@ -410,16 +410,16 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene): Write(title, run_time = 2), self.you.change_mode, "pondering" ) - self.dither() + self.wait() self.play(FadeIn(subtitle)) self.play(prior_word.highlight, GREEN) self.play( ShowCreation(rect), ShowCreation(arrow) ) - self.dither(3) + self.wait(3) self.play(Write(words)) - self.dither(3) + self.wait(3) ###### @@ -469,7 +469,7 @@ class HowDoesPokerWork(TeacherStudentsScene): run_time = 1 ) self.change_student_modes(*["confused"]*3) - self.dither(2) + self.wait(2) class YourGutKnowsBayesRule(TeacherStudentsScene): def construct(self): @@ -478,7 +478,7 @@ class YourGutKnowsBayesRule(TeacherStudentsScene): run_time = 1 ) self.change_student_modes("confused", "gracious", "guilty") - self.dither(3) + self.wait(3) class UpdatePokerPrior(SampleSpaceScene): CONFIG = { @@ -516,7 +516,7 @@ class UpdatePokerPrior(SampleSpaceScene): LaggedStart(FadeIn, sample_space), Write(braces_and_labels) ) - self.dither() + self.wait() sample_space.add(braces_and_labels) self.sample_space = sample_space @@ -543,7 +543,7 @@ class UpdatePokerPrior(SampleSpaceScene): GrowFromCenter(brace), ) self.play(Write(explanation, run_time = 3)) - self.dither(2) + self.wait(2) self.sample_space.add(brace, label) @@ -566,7 +566,7 @@ class UpdatePokerPrior(SampleSpaceScene): her.change_mode, "happy", Animation(glasses) ) - self.dither(2) + self.wait(2) self.her = her @@ -595,7 +595,7 @@ class UpdatePokerPrior(SampleSpaceScene): her.change_mode, "shruggie", MaintainPositionRelativeTo(her.glasses, her.eyes) ) - self.dither() + self.wait() self.play(*[ ReplacementTransform( VGroup(*label[i1:i2]).copy(), @@ -610,9 +610,9 @@ class UpdatePokerPrior(SampleSpaceScene): (3, 6, 3), ]) ]) - self.dither() + self.wait() self.play(Write(VGroup(*label[-2:]))) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [her, her.glasses])) self.sample_space.add(brace, label) @@ -677,9 +677,9 @@ class UpdatePokerPrior(SampleSpaceScene): FadeIn(question), randy.look_at, question ) - self.dither() + self.wait() self.play(Blink(randy)) - self.dither() + self.wait() self.play( randy.change_mode, "pondering", FadeOut(questions) @@ -715,7 +715,7 @@ class UpdatePokerPrior(SampleSpaceScene): *self.get_conditional_change_anims(i%2, value) ) if i%2 == 1: - self.dither() + self.wait() self.play(FadeOut(randy)) def show_restricted_space(self): @@ -748,7 +748,7 @@ class UpdatePokerPrior(SampleSpaceScene): Write(words), *map(ShowCreation, arrows) ) - self.dither() + self.wait() for rect in high_bet_space: self.play(Indicate(rect, scale_factor = 1)) self.play(*map(FadeOut, [words, arrows])) @@ -784,12 +784,12 @@ class UpdatePokerPrior(SampleSpaceScene): self.play(LaggedStart(FadeIn, posterior_tex)) self.play(Write(arrow)) self.play(MoveToTarget(rects[0])) - self.dither() + self.wait() self.play(*it.chain( map(Write, [frac_line, plus]), map(MoveToTarget, rects[1:]) )) - self.dither(3) + self.wait(3) self.play(*map(FadeOut, [arrow, fraction] + rects)) self.posterior_tex = posterior_tex @@ -808,14 +808,14 @@ class UpdatePokerPrior(SampleSpaceScene): run_time = 2, ), ) - self.dither(2) + self.wait(2) self.play(ReplacementTransform(self.posterior_tex, labels[0])) self.posterior_tex = labels[0] self.play(GrowFromCenter(braces)) - self.dither() + self.wait() self.play(ShowCreation(height_rect)) self.play(FadeOut(height_rect)) - self.dither() + self.wait() self.post_rects = post_rects @@ -836,19 +836,19 @@ class UpdatePokerPrior(SampleSpaceScene): ) self.play(ShowCreation(prior_rect)) - self.dither() + self.wait() self.play(ReplacementTransform(prior_rect, post_rect)) - self.dither() + self.wait() self.play(FadeOut(post_rect)) self.play(Indicate(post_tex.get_part_by_tex(self.cash_string))) - self.dither() + self.wait() self.play( Write(post_words), ShowCreation(post_arrow) ) - self.dither() + self.wait() self.play(post_words[1].fade, 0.8) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [post_words, post_arrow])) def preview_tweaks(self): @@ -865,7 +865,7 @@ class UpdatePokerPrior(SampleSpaceScene): self.play(*self.get_prior_change_anims( new_values[-1], post_rects )) - self.dither(2) + self.wait(2) def tweak_non_flush_case(self): her = self.her @@ -890,11 +890,11 @@ class UpdatePokerPrior(SampleSpaceScene): arrows.arrange_submobjects(DOWN) arrows.next_to(prior_rects[1], RIGHT, SMALL_BUFF) - self.dither(2) + self.wait(2) self.play(*map(FadeIn, [her, her.glasses])) self.play(LaggedStart(FadeIn, risk_averse_words)) self.play(her.change_mode, "sad", Animation(her.glasses)) - self.dither() + self.wait() self.play(ShowCreation(arrows)) self.play( *it.chain( @@ -904,11 +904,11 @@ class UpdatePokerPrior(SampleSpaceScene): run_time = 3 ) self.play(FadeOut(arrows)) - self.dither(2) + self.wait(2) post_surrounding_rect = SurroundingRectangle(posterior) self.play(ShowCreation(post_surrounding_rect)) self.play(FadeOut(post_surrounding_rect)) - self.dither() + self.wait() self.play( FadeOut(risk_averse_words), *self.get_conditional_change_anims(1, 0.3, post_rects), @@ -926,11 +926,11 @@ class UpdatePokerPrior(SampleSpaceScene): *self.get_conditional_change_anims(0, 0.47, post_rects), run_time = 3 ) - self.dither(3) + self.wait(3) self.play(*self.get_conditional_change_anims( 0, 0.97, post_rects )) - self.dither() + self.wait() def tweak_prior(self): her = self.her @@ -943,7 +943,7 @@ class UpdatePokerPrior(SampleSpaceScene): *self.get_prior_change_anims(0.3, post_rects), run_time = 2 ) - self.dither(3) + self.wait(3) self.play( *self.get_prior_change_anims(1./22, post_rects), run_time = 2 @@ -1007,8 +1007,8 @@ class UpdatePokerPrior(SampleSpaceScene): self.play(Write(fraction.get_part_by_tex("over"))) for pair in zip(pre_top_rect_products, products[0]): self.play(*map(Indicate, pair)) - self.dither() - self.dither() + self.wait() + self.wait() self.play(Indicate(prior_rects[1], scale_factor = 1)) self.play(*[ ReplacementTransform( @@ -1019,18 +1019,18 @@ class UpdatePokerPrior(SampleSpaceScene): pre_bottom_rect_products, products[1] ) ]) - self.dither() + self.wait() for pair in zip(pre_bottom_rect_products, products[1]): self.play(*map(Indicate, pair)) - self.dither() + self.wait() self.play( Write(fraction.get_part_by_tex("+")), ReplacementTransform(products[0].copy(), products[2]) ) - self.dither() + self.wait() self.play(ShowCreation(to_rhs_arrow)) self.play(Write(rhs)) - self.dither(3) + self.wait(3) ###### @@ -1132,11 +1132,11 @@ class BayesRuleInMemory(Scene): MoveToTarget(rule), randy.change, "pondering", ) - self.dither() + self.wait() self.play(rule.fade, 0.7, run_time = 2) self.play(randy.change, "confused", rule) self.play(Blink(randy)) - self.dither(2) + self.wait(2) self.play( FadeOut(VGroup(bubble, rule)), randy.change, "pondering", screen_rect, @@ -1145,7 +1145,7 @@ class BayesRuleInMemory(Scene): randy.look_at, screen_rect.get_right(), ShowCreation(screen_rect), ) - self.dither(4) + self.wait(4) class NextVideoWrapper(TeacherStudentsScene): CONFIG = { @@ -1171,7 +1171,7 @@ class NextVideoWrapper(TeacherStudentsScene): look_at_arg = screen ) self.play(Animation(screen)) - self.dither(5) + self.wait(5) class BayesianNetworkPreview(Scene): def construct(self): @@ -1259,7 +1259,7 @@ class BayesianNetworkPreview(Scene): self.play(*anims) covered_nodes.update(curr_nodes) curr_nodes = list(next_nodes) - self.dither() + self.wait() self.play(FadeOut(all_ghosts)) @@ -1379,7 +1379,7 @@ class GeneralizeBayesRule(SampleSpaceScene): self.play(FadeIn(rule)) self.play(Write(bayes_rule_words)) - self.dither(2) + self.wait(2) self.bayes_rule_words = bayes_rule_words self.bayes_rule = rule @@ -1420,21 +1420,21 @@ class GeneralizeBayesRule(SampleSpaceScene): ShowCreation(prior_arrow), ShowCreation(prior_rect), ) - self.dither() + self.wait() self.play(Transform( prior.copy(), prior_target, run_time = 2, path_arc = -np.pi/3, remover = True, )) - self.dither() + self.wait() parts = self.sample_space[0].vertical_parts self.play( Indicate(likelihood), Indicate(parts.labels), Indicate(parts.braces), ) - self.dither() + self.wait() self.play(Indicate(P_I)) self.play(FocusOn(self.sample_space[0][0])) for i in range(2): @@ -1442,7 +1442,7 @@ class GeneralizeBayesRule(SampleSpaceScene): self.sample_space[i][0], scale_factor = 1 )) - self.dither() + self.wait() self.play( Write(posterior_word), ShowCreation(posterior_arrow), @@ -1484,13 +1484,13 @@ class GeneralizeBayesRule(SampleSpaceScene): Write(name), *map(ShowCreation, arrows+rects) ) - self.dither() + self.wait() self.play(FadeIn(morty)) self.play(morty.change, "confused", name) self.play(Blink(morty)) self.play(morty.look, DOWN) - self.dither() + self.wait() self.play(morty.look_at, name) self.play(Blink(morty)) self.play(morty.change, "shruggie") @@ -1513,9 +1513,9 @@ class GeneralizeBayesRule(SampleSpaceScene): cross.replace(word, stretch = True) self.play(Write(word)) - self.dither() + self.wait() self.play(ShowCreation(cross)) - self.dither() + self.wait() self.play(FadeOut(VGroup(cross, word))) self.play(FadeOut(self.bayes_rule)) self.play( @@ -1540,7 +1540,7 @@ class GeneralizeBayesRule(SampleSpaceScene): rate_func = there_and_back, lag_ratio = 0.7 )) - self.dither(2) + self.wait(2) self.play(ReplacementTransform( prior_rects.copy(), post_rects, run_time = 2 @@ -1548,10 +1548,10 @@ class GeneralizeBayesRule(SampleSpaceScene): self.play(*map(FadeIn, [ post_rects.braces, post_rects.labels ])) - self.dither() + self.wait() self.play(*self.get_conditional_change_anims(1, 0.2, post_rects)) self.play(*self.get_conditional_change_anims(0, 0.6, post_rects)) - self.dither() + self.wait() self.play(*it.chain( self.get_division_change_animations( self.sample_space, @@ -1560,7 +1560,7 @@ class GeneralizeBayesRule(SampleSpaceScene): ), self.get_posterior_rectangle_change_anims(post_rects) )) - self.dither(3) + self.wait(3) #### @@ -1573,7 +1573,7 @@ class MoreExamples(TeacherStudentsScene): def construct(self): self.teacher_says("More examples!", target_mode = "hooray") self.change_student_modes(*["hooray"]*3) - self.dither(2) + self.wait(2) class MusicExample(SampleSpaceScene, PiCreatureScene): def construct(self): @@ -1616,10 +1616,10 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): Animation(randy.arms) ) randy.add(guitar, randy.arms) - self.dither() + self.wait() self.play_notes(guitar) self.change_pi_creature_with_guitar("concerned_musician") - self.dither(2) + self.wait(2) self.play( randy.scale, 0.7, randy.to_corner, UP+LEFT, @@ -1648,12 +1648,12 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): self.play(*map(GrowFromCenter, braces)) for label in labels: self.play(Write(label, run_time = 2)) - self.dither() + self.wait() for word, mode in zip(words, ["maybe", "soulful_musician"]): self.play(LaggedStart(FadeIn, word, run_time = 1)) self.change_pi_creature_with_guitar(mode) - self.dither() - self.dither() + self.wait() + self.wait() self.play(*map(FadeOut, words)) self.sample_space = sample_space @@ -1700,7 +1700,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): self.play(FadeIn(bottom_part.vertical_parts)) self.play(GrowFromCenter(brace)) self.play(Write(label)) - self.dither() + self.wait() def friend_gives_compliment(self): friends = self.friends @@ -1718,7 +1718,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): ApplyMethod, friends, lambda pi : (pi.change_mode, "conniving") )) - self.dither() + self.wait() self.play( ShowCreation(bubble), Write(bubble.content, run_time = 1), @@ -1728,7 +1728,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): lambda pi : (pi.change_mode, "happy") ), ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [bubble, content])) def friends_dont_like(self): @@ -1744,7 +1744,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): MoveToTarget, friends )) self.change_pi_creature_with_guitar("concerned_musician") - self.dither() + self.wait() def false_compliment(self): friend = self.friends[0] @@ -1764,7 +1764,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): Write(content) ) self.change_pi_creature_with_guitar("happy") - self.dither() + self.wait() self.play(*map(FadeOut, [bubble, content])) self.bubble = bubble @@ -1780,7 +1780,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): self.play(FadeIn(top_part.vertical_parts)) self.play(GrowFromCenter(brace)) self.play(Write(label, run_time = 2)) - self.dither() + self.wait() def get_positive_review(self): friends = self.friends @@ -1813,7 +1813,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): run_time = 2, lag_ratio = 0.7, )) - self.dither() + self.wait() self.negative_space = negative_space @@ -1834,7 +1834,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): )) self.play(GrowFromCenter(brace)) self.play(Write(label)) - self.dither() + self.wait() self.post_rects = post_rects self.post_tex = label @@ -1864,7 +1864,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): ), Write(VGroup(*top_product[::2])) ) - self.dither(2) + self.wait(2) self.play( ReplacementTransform( side_labels[1][-1].copy(), @@ -1876,7 +1876,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): ), Write(VGroup(*bottom_product[::2])) ) - self.dither(2) + self.wait(2) self.products = products @@ -1910,7 +1910,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): ShowCreation(to_ratio_arrow), FadeIn(ratio) ) - self.dither(2) + self.wait(2) for mob in prior_rects, prior_rects[0]: self.play( mob.highlight, YELLOW, @@ -1918,11 +1918,11 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): rate_func = there_and_back, run_time = 2 ) - self.dither() - self.dither() + self.wait() + self.wait() self.play(ShowCreation(to_rhs_arrow)) self.play(Write(rhs, run_time = 1)) - self.dither(2) + self.wait(2) self.post_rhs = rhs self.ratio_group = VGroup(ratio, to_ratio_arrow, to_rhs_arrow) @@ -1943,14 +1943,14 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): run_time = 2, )) self.play(ShowCreation(post_rect)) - self.dither(2) + self.wait(2) for mode, time in ("shruggie", 2), ("hesitant", 0): self.play(LaggedStart( ApplyMethod, friends, lambda pi : (pi.change, mode), run_time = 2, )) - self.dither(time) + self.wait(time) self.play(*map(FadeOut, [ prior_rect, post_rect, self.ratio_group, self.post_rhs @@ -1968,7 +1968,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): value, post_rects, new_label_kwargs = {"labels" : [label]}, ), run_time = 2) - self.dither(2) + self.wait(2) def fade_out_post_rect(self): self.play(*map(FadeOut, [ @@ -2002,15 +2002,15 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): lambda pi : (pi.change, "pondering", post_rects), run_time = 1 )) - self.dither() + self.wait() self.play(ReplacementTransform( new_prior_rects.copy(), post_rects, run_time = 2 )) self.play(GrowFromCenter(brace)) - self.dither(2) + self.wait(2) self.play(Write(label)) - self.dither(3) + self.wait(3) self.post_rects = post_rects @@ -2019,9 +2019,9 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): post_num_rect = SurroundingRectangle(post_num) self.play(ShowCreation(self.prior_num_rect)) - self.dither() + self.wait() self.play(ShowCreation(post_num_rect)) - self.dither() + self.wait() self.post_num_rect = post_num_rect @@ -2044,9 +2044,9 @@ class MusicExample(SampleSpaceScene, PiCreatureScene): Write(bubble.content) ) self.change_pi_creature_with_guitar("sad") - self.dither() + self.wait() self.change_pi_creature_with_guitar("concerned_musician") - self.dither(3) + self.wait(3) ###### @@ -2166,7 +2166,7 @@ class FinalWordsOnRule(SampleSpaceScene): uses.to_edge(UP) for use in uses: self.play(Write(use, run_time = 2)) - self.dither() + self.wait() def tweak_values(self): post_rects = self.post_rects @@ -2180,13 +2180,13 @@ class FinalWordsOnRule(SampleSpaceScene): self.play(*self.get_conditional_change_anims( i, value, post_rects )) - self.dither() + self.wait() self.play(*it.chain( self.get_horizontal_division_change_animations(new_values[-1]), self.get_posterior_rectangle_change_anims(post_rects) )) - self.dither() - self.dither(2) + self.wait() + self.wait(2) class FootnoteWrapper(NextVideoWrapper): CONFIG = { diff --git a/eop/bayes_footnote.py b/eop/bayes_footnote.py index 0f69a994..cdd5e49b 100644 --- a/eop/bayes_footnote.py +++ b/eop/bayes_footnote.py @@ -80,7 +80,7 @@ class Introduction(TeacherStudentsScene): example.scale, 0.5, example.next_to, self.teacher.get_corner(UP+LEFT), UP, ) - self.dither(2) + self.wait(2) self.example = example @@ -106,7 +106,7 @@ class Introduction(TeacherStudentsScene): self.play(Write(arrow)) self.play(ShowCreation(cross)) self.change_student_modes(*["confused"]*3) - self.dither(2) + self.wait(2) self.bayes_to_intuition = group @@ -119,7 +119,7 @@ class Introduction(TeacherStudentsScene): target_mode = "hooray", added_anims = [disease_group.to_corner, UP+LEFT] ) - self.dither(2) + self.wait(2) self.disease_group = disease_group @@ -156,11 +156,11 @@ class Introduction(TeacherStudentsScene): for example in examples: self.play(FadeIn(example)) - self.dither() + self.wait() self.play(GrowFromCenter(brace)) self.play(FadeIn(bayes_to_intuition)) self.play(Write(check)) - self.dither(2) + self.wait(2) self.intuitive_examples = VGroup( examples, brace, bayes_to_intuition, check @@ -199,7 +199,7 @@ class Introduction(TeacherStudentsScene): "erm", "confused", "hesitant", added_anims = [self.teacher.change_mode, "happy"] ) - self.dither(3) + self.wait(3) ##### @@ -293,7 +293,7 @@ class OneInOneThousandHaveDisease(Scene): Write(title), LaggedStart(FadeIn, all_creatures, run_time = 3) ) - self.dither() + self.wait() class TestScene(PiCreatureScene): def get_result(self, creature, word, color): @@ -341,7 +341,7 @@ class TestDiseaseCase(TestScene): self.play(FadeIn(result[0])) self.play(Write(result[1])) self.play(FadeIn(accuracy)) - self.dither() + self.wait() class TestNonDiseaseCase(TestScene): def construct(self): @@ -397,7 +397,7 @@ class TestNonDiseaseCase(TestScene): ) for x in range(2): self.play(Blink(last_guy)) - self.dither(2) + self.wait(2) class ReceivePositiveResults(TestScene): def construct(self): @@ -412,17 +412,17 @@ class ReceivePositiveResults(TestScene): self.add(status, randy) self.play(FadeIn(result[0])) - self.dither() + self.wait() self.play(Write(result[1])) self.play(randy.change, "maybe", result) - self.dither(2) + self.wait(2) self.play( randy.change, "pleading", accuracy, Write(accuracy, run_time = 1) ) - self.dither() + self.wait() self.play(randy.change, "sad", accuracy) - self.dither(2) + self.wait(2) class AskAboutRephrasingQuestion(TeacherStudentsScene): def construct(self): @@ -430,7 +430,7 @@ class AskAboutRephrasingQuestion(TeacherStudentsScene): "What if we rephrased \\\\ the question?", run_time = 1 ) - self.dither(3) + self.wait(3) class RephraseQuestion(Scene): def construct(self): @@ -466,16 +466,16 @@ class RephraseQuestion(Scene): ShowCreation(prior_arrow), run_time = 1 ) - self.dither() + self.wait() self.play(FadeIn(words[1])) - self.dither() + self.wait() self.play(FadeIn(words[2])) self.play( LaggedStart(FadeIn, posterior), ShowCreation(posterior_arrow), run_time = 1 ) - self.dither(2) + self.wait(2) class TryUnitSquareVisual(SampleSpaceScene): def construct(self): @@ -493,18 +493,18 @@ class TryUnitSquareVisual(SampleSpaceScene): hard_to_see.highlight(YELLOW) arrow = Arrow(hard_to_see, prior_label) - self.dither() + self.wait() anims = self.get_division_change_animations( sample_space, sample_space.horizontal_parts, 0.001, new_label_kwargs = {"labels" : final_labels} ) self.play(*anims, run_time = 2) - self.dither() + self.wait() self.play( Write(hard_to_see, run_time = 2), ShowCreation(arrow) ) - self.dither(2) + self.wait(2) def add_prior_division(self): sample_space = self.sample_space @@ -535,7 +535,7 @@ class TryUnitSquareVisual(SampleSpaceScene): self.play(GrowFromCenter(top_brace)) self.play(FadeIn(top_label)) - self.dither() + self.wait() bottom_part.divide_vertically( 0.95, colors = [BLUE_E, YELLOW_E] @@ -555,7 +555,7 @@ class TryUnitSquareVisual(SampleSpaceScene): GrowFromCenter(bottom_brace), ) self.play(FadeIn(bottom_label)) - self.dither() + self.wait() class ShowRestrictedSpace(Scene): CONFIG = { @@ -606,7 +606,7 @@ class ShowRestrictedSpace(Scene): sick_one.next_to, sick_one_words, DOWN, sick_one.to_edge, RIGHT, ) - self.dither() + self.wait() self.play(sick_one.restore) self.play( Write(healthy_words), @@ -617,7 +617,7 @@ class ShowRestrictedSpace(Scene): lag_ratio = 0.2, ) ) - self.dither() + self.wait() self.play(FadeOut(title)) self.all_creatures = all_creatures @@ -636,7 +636,7 @@ class ShowRestrictedSpace(Scene): equation.to_corner(UP+LEFT) self.play(Write(equation, run_time = 1)) - self.dither(2) + self.wait(2) self.disease_conditional = equation @@ -652,7 +652,7 @@ class ShowRestrictedSpace(Scene): self.play(ReplacementTransform( self.disease_conditional, equation )) - self.dither() + self.wait() self.healthy_conditional = equation @@ -676,7 +676,7 @@ class ShowRestrictedSpace(Scene): ) ) self.play(Write(words)) - self.dither() + self.wait() self.false_positives = false_positives self.false_positives_brace = brace @@ -732,7 +732,7 @@ class ShowRestrictedSpace(Scene): posterior.shift(LEFT) self.play(FadeIn(posterior)) - self.dither(2) + self.wait(2) self.posterior = posterior @@ -756,7 +756,7 @@ class ShowRestrictedSpace(Scene): times_90.next_to(arrow, RIGHT) self.play(ShowCreation(arrow)) self.play(Write(times_90, run_time = 1)) - self.dither(2) + self.wait(2) ###### @@ -812,7 +812,7 @@ class DepressingForMedicalTestDesigners(TestScene): self.add(title) self.play(Write(checks)) - self.dither(2) + self.wait(2) self.play(*map(MoveToTarget, [title, checks])) def reject_test(self): @@ -825,12 +825,12 @@ class DepressingForMedicalTestDesigners(TestScene): FadeIn(result), randy.change_mode, "pondering" ) - self.dither() + self.wait() self.say( "Whatever, I'm 91\\% \\\\ sure that's wrong", target_mode = "shruggie" ) - self.dither(2) + self.wait(2) class HowMuchCanYouChangeThisPrior(ShowRestrictedSpace, PiCreatureScene): def construct(self): @@ -879,7 +879,7 @@ class HowMuchCanYouChangeThisPrior(ShowRestrictedSpace, PiCreatureScene): subgroup.stretch_in_place(1./width_factor, 0) subgroup.stretch_in_place(1./height_factor, 1) - self.dither() + self.wait() self.play(MoveToTarget(subgroups)) subgroups.remove(special_group) @@ -893,7 +893,7 @@ class HowMuchCanYouChangeThisPrior(ShowRestrictedSpace, PiCreatureScene): special_group, buff = 0, color = RED ) self.play(FadeIn(rects), FadeIn(special_rect)) - self.dither() + self.wait() self.to_fade = VGroup(subgroups, rects) self.special_group = special_group @@ -907,7 +907,7 @@ class HowMuchCanYouChangeThisPrior(ShowRestrictedSpace, PiCreatureScene): special_group.scale_to_fit_height, 6, special_group.center, ) - self.dither() + self.wait() class ShowTheFormula(TeacherStudentsScene): CONFIG = { @@ -967,7 +967,7 @@ class ShowTheFormula(TeacherStudentsScene): #Ask question self.student_says("What does the \\\\ formula look like here?") self.play(self.teacher.change, "happy") - self.dither() + self.wait() self.play( Write(lhs), RemovePiCreatureBubble( @@ -977,7 +977,7 @@ class ShowTheFormula(TeacherStudentsScene): self.students[0].change, "pondering", self.students[2].change, "pondering", ) - self.dither() + self.wait() #Show initial formula lhs_copy = lhs.copy() @@ -988,34 +988,34 @@ class ShowTheFormula(TeacherStudentsScene): ), Animation(lhs_copy, remover = True), ) - self.dither(2) + self.wait(2) self.play(ShowCreation(numerator_rect)) self.play(FadeOut(numerator_rect)) - self.dither() + self.wait() self.play(Transform(numerator, alt_numerator)) initial_formula.add(*numerator) formula.add(*numerator) - self.dither(3) + self.wait(3) #Show number_fraction self.play( initial_formula.move_to, initial_formula.saved_state, FadeIn(VGroup(*number_fraction[:3])) ) - self.dither(2) + self.wait(2) self.play(LaggedStart( FadeIn, VGroup(*number_fraction[3:]), run_time = 3, lag_ratio = 0.7 )) - self.dither(2) + self.wait(2) #Show rhs self.play(formula.shift, UP) self.play(Write(rhs)) self.change_student_modes(*["happy"]*3) self.look_at(rhs) - self.dither(2) + self.wait(2) class SourceOfConfusion(Scene): CONFIG = { @@ -1063,7 +1063,7 @@ class SourceOfConfusion(Scene): ) self.play(Write(question)) - self.dither() + self.wait() self.play(ShowCreation(question_arrow)) self.question = question @@ -1094,7 +1094,7 @@ class SourceOfConfusion(Scene): rule.restore, run_time = 2 ) - self.dither(3) + self.wait(3) def shift_arrow(self): new_arrow = Arrow( @@ -1107,7 +1107,7 @@ class SourceOfConfusion(Scene): self.question_arrow, new_arrow )) - self.dither(2) + self.wait(2) class StatisticsVsEmpathy(PiCreatureScene): def construct(self): @@ -1131,15 +1131,15 @@ class StatisticsVsEmpathy(PiCreatureScene): look_at_arg = randy.eyes )) self.play(randy.change, "pondering", morty.eyes) - self.dither() + self.wait() self.play(Write(prior)) - self.dither() + self.wait() self.play( prior.scale, 0.1, prior.set_fill, None, 0, prior.move_to, randy.eyes ) - self.dither() + self.wait() self.play( PiCreatureBubbleIntroduction( randy, sick_group, @@ -1154,7 +1154,7 @@ class StatisticsVsEmpathy(PiCreatureScene): sick_one.change_mode, "sick", sick_one.highlight, SICKLY_GREEN ) - self.dither() + self.wait() probably_me = TextMobject("That's probably \\\\ me") probably_me.next_to(sick_one, DOWN) @@ -1167,12 +1167,12 @@ class StatisticsVsEmpathy(PiCreatureScene): target_sick_group, target_mode = "pleading", ) - self.dither(2) + self.wait(2) self.play(prior.restore) for new_prior in priors[1:]: self.play(Transform(prior, new_prior, run_time = 0.5)) - self.dither() + self.wait() ###### @@ -1190,13 +1190,13 @@ class LessMedicalExample(Scene): cross = Cross(disease) self.add(disease) - self.dither() + self.wait() self.play(ShowCreation(cross)) self.play( FadeIn(telepathy), VGroup(disease, cross).shift, 2*UP ) - self.dither() + self.wait() class PlaneCrashProbability(Scene): def construct(self): @@ -1218,11 +1218,11 @@ class PlaneCrashProbability(Scene): ) self.play(Write(plane_prob)) - self.dither(2) + self.wait(2) self.play(ReplacementTransform( plane_prob.copy(), car_prob )) - self.dither(2) + self.wait(2) class IntroduceTelepathyExample(StatisticsVsEmpathy): def construct(self): @@ -1253,7 +1253,7 @@ class IntroduceTelepathyExample(StatisticsVsEmpathy): run_time = 1, look_at_arg = morty.eyes, )) - self.dither() + self.wait() self.play(RemovePiCreatureBubble( randy, target_mode = "happy", @@ -1274,14 +1274,14 @@ class IntroduceTelepathyExample(StatisticsVsEmpathy): for number in numbers: self.add(number) - Scene.dither(self, 0.1) + Scene.wait(self, 0.1) self.remove(number) self.play( ShowCreation(bubble), number.move_to, bubble.get_bubble_center(), DOWN+LEFT, morty.change, "pondering", ) - self.dither() + self.wait() morty.bubble = bubble self.number = number @@ -1296,7 +1296,7 @@ class IntroduceTelepathyExample(StatisticsVsEmpathy): target_mode = "hooray", look_at_arg = morty.eyes )) - self.dither() + self.wait() def ask_about_chances(self): probability = TexMobject( @@ -1308,11 +1308,11 @@ class IntroduceTelepathyExample(StatisticsVsEmpathy): probability.to_edge(UP) self.play(morty.change, "confused", randy.eyes) - self.dither() + self.wait() self.play(ReplacementTransform( self.title, VGroup(*it.chain(*probability)) )) - self.dither() + self.wait() def say_you_probably_got_lucky(self): randy, morty = self.randy, self.morty @@ -1330,7 +1330,7 @@ class IntroduceTelepathyExample(StatisticsVsEmpathy): look_at_arg = morty.eyes, ) ) - self.dither(2) + self.wait(2) ### @@ -1339,7 +1339,7 @@ class IntroduceTelepathyExample(StatisticsVsEmpathy): self.play(pi1.change, "telepath", pi2.eyes) self.send_mind_waves(pi1, pi2) self.send_mind_waves(pi2, pi1) - self.dither() + self.wait() def send_mind_waves(self, pi1, pi2): angle = np.pi/3 @@ -1406,11 +1406,11 @@ class CompareNumbersInBothExamples(Scene): LaggedStart(FadeIn, titles, lag_ratio = 0.7), *map(ShowCreation, [h_line, v_line]) ) - self.dither() + self.wait() self.play(FadeIn(priors)) - self.dither() + self.wait() self.play(FadeIn(likelihoods)) - self.dither(3) + self.wait(3) class NonchalantReactionToPositiveTest(TestScene): @@ -1425,7 +1425,7 @@ class NonchalantReactionToPositiveTest(TestScene): self.add(accuracy) self.play(Write(result, run_time = 2)) self.play(randy.change, "pondering", result) - self.dither() + self.wait() words = TextMobject("Pssht, I'm probably fine.") words.scale(0.8) self.pi_creature_says( @@ -1438,7 +1438,7 @@ class NonchalantReactionToPositiveTest(TestScene): }, content_introduction_class = FadeIn, ) - self.dither(4) + self.wait(4) class OneInOneThousandHaveDiseaseCopy(OneInOneThousandHaveDisease): pass @@ -1472,7 +1472,7 @@ class ExampleMeasuresDisbeliefInStatistics(Introduction): *["pondering"]*3, look_at_arg = statistics_to_belief ) - self.dither(3) + self.wait(3) statistics_to_belief.add(cross) self.statistics_to_belief = statistics_to_belief @@ -1488,7 +1488,7 @@ class ExampleMeasuresDisbeliefInStatistics(Introduction): b_to_i.next_to, self.teacher, UP, b_to_i.to_edge, RIGHT, MED_SMALL_BUFF, ) - self.dither(2) + self.wait(2) self.play( self.teacher.change_mode, "raise_right_hand", self.teacher.look, UP+LEFT, @@ -1496,7 +1496,7 @@ class ExampleMeasuresDisbeliefInStatistics(Introduction): s_to_b.shift, LEFT, b_to_i.shift, 2*UP ) - self.dither(2) + self.wait(2) class AlwaysPictureTheSpaceOfPossibilities(PiCreatureScene): def construct(self): @@ -1506,7 +1506,7 @@ class AlwaysPictureTheSpaceOfPossibilities(PiCreatureScene): "width" : 8, } ) - self.dither(3) + self.wait(3) def create_pi_creature(self): return Randolph().to_corner(DOWN+LEFT) diff --git a/eop/combinations.py b/eop/combinations.py index 99b9b632..85891823 100644 --- a/eop/combinations.py +++ b/eop/combinations.py @@ -125,7 +125,7 @@ class ExperienceProblemSolver(PiCreatureScene): equation.to_edge(UP) self.play(Write(equation)) - self.dither() + self.wait() self.equation = equation @@ -140,7 +140,7 @@ class ExperienceProblemSolver(PiCreatureScene): target_mode = "hooray", bubble_kwargs = {"height" : 2, "width" : 3} ) - self.dither() + self.wait() self.play( randy.change, "confused", self.equation, Write(randy_words) @@ -149,7 +149,7 @@ class ExperienceProblemSolver(PiCreatureScene): self.play(randy.look_at, jenny.eyes) self.play(jenny.change, "happy") self.play(randy.change, "tired") - self.dither() + self.wait() self.play(*map(FadeOut, [ jenny.bubble, jenny_words, randy_words ])) @@ -168,7 +168,7 @@ class ExperienceProblemSolver(PiCreatureScene): jenny.change, "sassy", cross, randy.change, "happy" ) - self.dither(2) + self.wait(2) self.to_fade = VGroup(lightbulb, cross) @@ -209,7 +209,7 @@ class ExperienceProblemSolver(PiCreatureScene): for mobs in curr_row[1:], curr_row[:-1] ]) self.add(curr_row) - self.dither(3) + self.wait(3) @@ -255,7 +255,7 @@ class InitialFiveChooseThreeExample(Scene): run_time = 0.2*len(stack), submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.set_variables_as_attrs(stacks) @@ -301,7 +301,7 @@ class InitialFiveChooseThreeExample(Scene): )) self.remove(mover) self.add(binomial_equations) - self.dither() + self.wait() self.set_variables_as_attrs( n_choose_k, n_choose_k_words, @@ -313,7 +313,7 @@ class InitialFiveChooseThreeExample(Scene): new_words.move_to(self.n_choose_k_words, LEFT) self.play(Transform(self.n_choose_k_words, new_words)) - self.dither(2) + self.wait(2) def issolate_single_stack(self): stack = self.stacks[3] @@ -328,7 +328,7 @@ class InitialFiveChooseThreeExample(Scene): FadeOut(to_fade), equation.scale, 1.5, equation.get_bottom(), ) - self.dither() + self.wait() for line in stack: ones = VGroup(*filter( lambda mob : "1" in mob.get_tex_string(), @@ -353,11 +353,11 @@ class InitialFiveChooseThreeExample(Scene): line.save_state() line.highlight(YELLOW) self.add(number, brace) - self.dither(0.25) + self.wait(0.25) self.remove(number, brace) line.restore() self.add(number, brace) - self.dither() + self.wait() self.set_variables_as_attrs( stack_brace = brace, @@ -379,11 +379,11 @@ class InitialFiveChooseThreeExample(Scene): num = TexMobject(str(count)) num.next_to(lines, DOWN) self.add(ones, num) - self.dither(0.35) + self.wait(0.35) self.remove(ones, num) count += 1 self.add(num, ones) - self.dither() + self.wait() self.play(*map(FadeOut, [lines, num, ones])) def walk_though_notation(self): @@ -396,7 +396,7 @@ class InitialFiveChooseThreeExample(Scene): self.play(Write(words)) self.play(ShowCreation(rect)) self.play(FadeOut(rect)) - self.dither(2) + self.wait(2) def emphasize_pattern_over_number(self): morty = Mortimer().flip() @@ -428,7 +428,7 @@ class InitialFiveChooseThreeExample(Scene): run_time = 0.25 ) last_ones = ones - self.dither() + self.wait() #### @@ -478,7 +478,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample): lag_ratio = 0.1, run_time = 10, )) - self.dither() + self.wait() self.set_variables_as_attrs(stack) @@ -511,7 +511,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample): LaggedStart(GrowArrow, arrows), Write(choose_k, run_time = 1) ) - self.dither(2) + self.wait(2) self.play( line.restore, *map(FadeOut, [brace, n_options, arrows, choose_k]) @@ -527,11 +527,11 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample): line.ones.highlight(YELLOW) line.ones.set_stroke(RED, 1) self.add(brace, num) - self.dither(0.15) + self.wait(0.15) self.remove(brace, num) line.ones.restore() self.add(brace, num) - self.dither() + self.wait() lhs = TexMobject( "\\frac{6 \\cdot 5 \\cdot 3}{1 \\cdot 2 \\cdot 3} =" @@ -542,7 +542,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample): coming_soon.highlight(MAROON_B) self.play(*map(FadeIn, [lhs, coming_soon])) - self.dither() + self.wait() self.play( ApplyMethod( lhs.shift, 0.65*SPACE_WIDTH*(LEFT+UP), @@ -552,7 +552,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample): ), *map(FadeOut, [brace, num, coming_soon]) ) - self.dither() + self.wait() def think_about_pattern(self): self.revert_to_original_skipping_status() @@ -569,7 +569,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample): run_time = 0.2 ) last_ones = ones - self.dither() + self.wait() class SixChooseThreeInOtherContext(Scene): def construct(self): @@ -633,7 +633,7 @@ class SixChooseThreeInOtherContext(Scene): last_rights = rights last_ups = ups last_line = line - self.dither() + self.wait() # class Introduction(Scene): # CONFIG = { @@ -654,7 +654,7 @@ class SixChooseThreeInOtherContext(Scene): # FadeIn(symbol), # Write(words) # ) -# self.dither() +# self.wait() # self.set_variables_as_attrs(n_choose_k_group = group) @@ -698,7 +698,7 @@ class SixChooseThreeInOtherContext(Scene): # VGroup(n_choose_k, point, point).copy(), # eq # )) -# self.dither() +# self.wait() # self.set_variables_as_attrs(stacks, binomial_equations) @@ -755,7 +755,7 @@ class SixChooseThreeInOtherContext(Scene): # run_time = 1, # remover = True # )) -# self.dither() +# self.wait() # self.play(Write(add_y, run_time = 1)) # self.play(Transform(stacks, new_stacks)) # self.play(LaggedStart( @@ -764,7 +764,7 @@ class SixChooseThreeInOtherContext(Scene): # run_time = 1, # remover = True # )) -# self.dither() +# self.wait() # self.play( # top_stacks.shift, s_to_s_distance*RIGHT/2, @@ -804,7 +804,7 @@ class SixChooseThreeInOtherContext(Scene): # self.play(MoveToTarget(top_stack)) # self.play(Write(term)) -# self.dither() +# self.wait() # class DifferentWaysToThinkAboutNChooseK(Scene): # CONFIG = { @@ -823,7 +823,7 @@ class SixChooseThreeInOtherContext(Scene): # term = TexMobject("{5 \\choose 3} = 10") # term.to_edge(UP) # self.play(FadeIn(term, submobject_mode = "lagged_start")) -# self.dither() +# self.wait() # self.n_choose_k_term = term @@ -846,9 +846,9 @@ class SixChooseThreeInOtherContext(Scene): # self.add(term, number) # if last_number: # self.remove(last_number) -# self.dither(0.25) +# self.wait(0.25) # last_number = number -# self.dither() +# self.wait() # self.stack = stack # self.stack_count = last_number @@ -891,12 +891,12 @@ class SixChooseThreeInOtherContext(Scene): # Write(choose_words, run_time = 1), # LaggedStart(FadeIn, subset_mobs) # ) -# self.dither() +# self.wait() # for subset, subset_mob in zip(letter_subsets, subset_mobs): # VGroup(subset_mob, *subset).highlight(BLUE) -# self.dither(0.5) +# self.wait(0.5) # VGroup(*subset).highlight(WHITE) -# self.dither() +# self.wait() # self.set_variables_as_attrs( # subset_mobs, letter_set, choose_words, @@ -930,7 +930,7 @@ class SixChooseThreeInOtherContext(Scene): # Write(brace_tex), # ShowCreation(rect) # ) -# self.dither() +# self.wait() # def split_choices_by_start(self): # subset_mobs = self.subset_mobs @@ -947,7 +947,7 @@ class SixChooseThreeInOtherContext(Scene): # GrowFromCenter(brace) # ) # self.play(Write(expression)) -# self.dither() +# self.wait() # class FormulaVsPattern(TeacherStudentsScene): # def construct(self): @@ -965,7 +965,7 @@ class SixChooseThreeInOtherContext(Scene): # self.student_thinks(formula, student_index = 1) # self.play(self.teacher.change, "sassy") -# self.dither(2) +# self.wait(2) # self.play( # FadeOut(self.students[1].bubble), # FadeOut(formula), @@ -989,7 +989,7 @@ class SixChooseThreeInOtherContext(Scene): # self.play(LaggedStart(DrawBorderThenFill, cards)) # self.play(Write(words)) -# self.dither(3) +# self.wait(3) class ProbabilityOfKWomenInGroupOfFive(Scene): CONFIG = { @@ -1040,7 +1040,7 @@ class ProbabilityOfKWomenInGroupOfFive(Scene): self.play(*anims, run_time = 0.75) self.remove(last_lineup) self.add(lineup) - self.dither(0.25) + self.wait(0.25) last_lineup = lineup self.title = title @@ -1117,7 +1117,7 @@ class ProbabilityOfKWomenInGroupOfFive(Scene): lag_ratio = 0.9**i, run_time = 1, )) - self.dither() + self.wait() curr_lineup_group = lineup_group self.lineups = curr_lineup_group @@ -1129,7 +1129,7 @@ class ProbabilityOfKWomenInGroupOfFive(Scene): twos.next_to, eq_32, LEFT, FadeIn(eq_32), ) - self.dither() + self.wait() n_possibilities.add(*eq_32) self.set_variables_as_attrs(n_possibilities) @@ -1157,7 +1157,7 @@ class ProbabilityOfKWomenInGroupOfFive(Scene): run_time = 2, path_arc = np.pi/2 )) - self.dither() + self.wait() self.stacks = stacks @@ -1193,7 +1193,7 @@ class ProbabilityOfKWomenInGroupOfFive(Scene): Write(equation, run_time = 1) ) self.play(LaggedStart(Indicate, women, rate_func = there_and_back)) - self.dither() + self.wait() self.equations = equations self.numbers = VGroup(*[eq[-1] for eq in equations]) @@ -1212,7 +1212,7 @@ class ProbabilityOfKWomenInGroupOfFive(Scene): self.play(FadeOut(n_possibilities_rect)) for number in numbers: self.play(Indicate(number, color = PINK, run_time = 0.5)) - self.dither() + self.wait() def show_answer_to_question(self): stacks = self.stacks @@ -1254,7 +1254,7 @@ class ProbabilityOfKWomenInGroupOfFive(Scene): FadeIn(prob_words) ) self.play(ShowCreation(rect)) - self.dither(2) + self.wait(2) self.play( num.restore, FadeOut(rect), @@ -1273,7 +1273,7 @@ class ProbabilityOfKWomenInGroupOfFive(Scene): self.play(LaggedStart(FadeIn, question)) self.play(LaggedStart(ShowCreationThenDestruction, circles)) - self.dither(2) + self.wait(2) ###### @@ -1318,14 +1318,14 @@ class AskAboutAllPossibilities(ProbabilityOfKWomenInGroupOfFive): self.add(brace, question) for lineup in all_lineups: self.add(lineup) - self.dither(0.25) + self.wait(0.25) self.remove(lineup) class RememberThisSensation(TeacherStudentsScene): def construct(self): self.teacher_says("Remember this \\\\ sensation") self.change_student_modes("confused", "pondering", "erm") - self.dither(2) + self.wait(2) class TeacherHoldingSomething(TeacherStudentsScene): def construct(self): @@ -1336,7 +1336,7 @@ class TeacherHoldingSomething(TeacherStudentsScene): *["pondering"]*3, look_at_arg = 2*UP+2*RIGHT ) - self.dither(6) + self.wait(6) # class GroupsOf6(Scene): # def construct(self): @@ -1369,7 +1369,7 @@ class TeacherHoldingSomething(TeacherStudentsScene): # run_time = 3, # )) # self.play(Write(numbers, run_time = 3)) -# self.dither() +# self.wait() # self.play(LaggedStart( # ApplyMethod, women_groups, # lambda m : (m.highlight, PINK), @@ -1393,10 +1393,10 @@ class TeacherHoldingSomething(TeacherStudentsScene): # number = TexMobject(str(n)) # number.next_to(ORIGIN, DOWN, LARGE_BUFF) # self.add(item, number) -# self.dither(0.2) +# self.wait(0.2) # self.remove(item, number) # self.add(item, number) -# self.dither(2) +# self.wait(2) class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive): def construct(self): @@ -1457,7 +1457,7 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive): anims.append(FadeIn(n_possibilities[-1])) self.remove(twos) self.play(*anims) - self.dither() + self.wait() curr_lineup_group = lineup_group self.lineups = curr_lineup_group @@ -1469,7 +1469,7 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive): twos.next_to, eq_16, LEFT, FadeIn(eq_16), ) - self.dither() + self.wait() n_possibilities.add(eq_16) self.n_possibilities = n_possibilities @@ -1497,7 +1497,7 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive): run_time = 2, path_arc = np.pi/2 )) - self.dither() + self.wait() self.stacks = stacks @@ -1515,12 +1515,12 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive): number = TexMobject(str(n+1)) number.next_to(stack, UP) self.add(lineup_copy, number) - self.dither(0.25) + self.wait(0.25) self.remove(lineup_copy, number) self.add(number) numbers.add(number) self.play(FadeOut(rect)) - self.dither() + self.wait() stacks.numbers = numbers @@ -1573,7 +1573,7 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive): MoveToTarget(stacks), MoveToTarget(stacks.numbers) ) - self.dither() + self.wait() #Fill extra slot add_man = TextMobject("Add", "$\\male$") @@ -1592,7 +1592,7 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive): self.play(Write(words, run_time = 1)) self.play(to_fade_in.restore) - self.dither() + self.wait() #Perform shift dist = top_stacks[1].get_center()[0] - top_stacks[0].get_center()[0] @@ -1602,7 +1602,7 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive): bottom_stacks.shift, dist*LEFT/2, bottom_stacks.numbers.shift, dist*LEFT/2, ) - self.dither() + self.wait() self.play(*map(FadeOut, [add_man, add_woman, h_line])) self.set_variables_as_attrs(top_stacks, bottom_stacks) @@ -1649,13 +1649,13 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive): VGroup(top_stacks[-1], top_stacks.numbers[-1]).align_to, bottom_stacks, DOWN ) - self.dither() + self.wait() new_numbers.add_to_back(bottom_stacks.numbers[0].copy()) new_numbers.add(top_stacks.numbers[-1].copy()) new_numbers.highlight(PINK) self.play(Write(new_numbers, run_time = 3)) - self.dither() + self.wait() class BuildUpFromStart(Scene): CONFIG = { @@ -1672,9 +1672,9 @@ class BuildUpFromStart(Scene): self.add(stacks, stacks.numbers) for x in range(self.n_iterations): if x < 2: - dither_time = 1 + wait_time = 1 else: - dither_time = 0.2 + wait_time = 0.2 #Divide low_stacks = stacks low_group = VGroup(low_stacks, low_stacks.numbers) @@ -1688,7 +1688,7 @@ class BuildUpFromStart(Scene): num.next_to(stack, UP) group.target.next_to(ORIGIN, vect) self.play(*map(MoveToTarget, [top_group, low_group])) - self.dither(dither_time) + self.wait(wait_time) #Expand for stacks, i in (low_stacks, 0), (top_stacks, -1): @@ -1722,7 +1722,7 @@ class BuildUpFromStart(Scene): top_stacks, low_stacks, top_stacks.numbers, low_stacks.numbers, ])) - self.dither(dither_time) + self.wait(wait_time) #Shift dist = top_stacks[1].get_center()[0] - top_stacks[0].get_center()[0] @@ -1730,7 +1730,7 @@ class BuildUpFromStart(Scene): top_group.shift, dist*RIGHT/2, low_group.shift, dist*LEFT/2, ) - self.dither(dither_time) + self.wait(wait_time) #Stack all_movers = VGroup() @@ -1774,7 +1774,7 @@ class BuildUpFromStart(Scene): self.play(ReplacementTransform( expressions, VGroup(*map(VGroup, new_numbers)) )) - self.dither(dither_time) + self.wait(wait_time) stacks.numbers = new_numbers @@ -1810,7 +1810,7 @@ class IntroducePascalsTriangle(Scene): for mobs in curr_row[1:], curr_row[:-1] ]) self.add(curr_row) - self.dither() + self.wait() self.rows = rows @@ -1846,7 +1846,7 @@ class IntroducePascalsTriangle(Scene): ReplacementTransform(example.rect.copy(), ex_top1.rect), ReplacementTransform(example.rect.copy(), ex_top2.rect), ) - self.dither(2) + self.wait(2) self.play(rows_to_fade.fade, 1) self.play( top_row.align_to, low_row, LEFT, @@ -1857,7 +1857,7 @@ class IntroducePascalsTriangle(Scene): ShowCreation(h_line), Write(plus) ) - self.dither(2) + self.wait(2) for row in top_row, top_row_copy: row.remove(row[-1]) self.play( @@ -1870,7 +1870,7 @@ class IntroducePascalsTriangle(Scene): FadeOut(VGroup(h_line, plus)), FadeOut(rects), ) - self.dither() + self.wait() def keep_in_mind_what_these_mean(self): morty = Mortimer().flip() @@ -1914,9 +1914,9 @@ class IntroducePascalsTriangle(Scene): self.highlight_num(num) self.add(line) if n < self.max_n: - self.dither(0.25) + self.wait(0.25) else: - self.dither(1.25) + self.wait(1.25) self.dehighlight_num(num) self.remove(line) for k in range(1, 5): @@ -1925,13 +1925,13 @@ class IntroducePascalsTriangle(Scene): line.next_to(num, DOWN, MED_LARGE_BUFF) self.highlight_num(num) self.add(line) - self.dither(0.5) + self.wait(0.5) self.dehighlight_num(num) self.remove(line) num.highlight(YELLOW) num.scale_in_place(1.2) self.add(line) - self.dither() + self.wait() self.nine_choose_four_term = num self.nine_choose_four_line = line @@ -1953,10 +1953,10 @@ class IntroducePascalsTriangle(Scene): num = Integer(n+1) num.next_to(line, DOWN, MED_LARGE_BUFF) self.add(line, num) - self.dither(0.1) + self.wait(0.1) self.remove(line, num) self.add(line, num) - self.dither() + self.wait() self.curr_line = line #Probability @@ -1975,16 +1975,16 @@ class IntroducePascalsTriangle(Scene): eq_result = TexMobject("\\approx 0.246") eq_result.next_to(frac, RIGHT) - def show_random_lines(n, dither_time = 1): + def show_random_lines(n, wait_time = 1): for x in range(n): if x == n-1: - dither_time = 0 + wait_time = 0 new_line = random.choice(all_lines) new_line.move_to(self.curr_line) self.remove(self.curr_line) self.curr_line = new_line self.add(self.curr_line) - self.dither(dither_time) + self.wait(wait_time) self.play(FadeOut(num), FadeIn(expr)) show_random_lines(4) @@ -2032,7 +2032,7 @@ class IntroducePascalsTriangle(Scene): self.play(ShowCreation(circle)) self.play(Write(top_row)) - self.dither() + self.wait() curr_line_group = line_groups[0] self.play(FadeIn(curr_line_group)) for line_group in line_groups[1:]: @@ -2040,7 +2040,7 @@ class IntroducePascalsTriangle(Scene): curr_line_group, line_group )) curr_line_group = line_group - self.dither() + self.wait() ### @@ -2166,7 +2166,7 @@ class StacksApproachBellCurve(Scene): self.add(bars) self.add(numbers) - self.dither() + self.wait() # class IsThereABetterWayToCompute(TeacherStudentsScene): # def construct(self): @@ -2175,14 +2175,14 @@ class StacksApproachBellCurve(Scene): # target_mode = "raise_left_hand", # ) # self.change_student_modes("confused", "raise_left_hand", "erm") -# self.dither() +# self.wait() # self.play(self.teacher.change_mode, "happy") -# self.dither() +# self.wait() # self.teacher_says( # "There is! But first...", # target_mode = "hooray" # ) -# self.dither(2) +# self.wait(2) class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene): CONFIG = { @@ -2222,13 +2222,13 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene): num = TexMobject(str(i+1)) num.next_to(stack, UP) self.add(line, num) - self.dither(0.25) + self.wait(0.25) self.remove(num) self.play( Write(VGroup(*equation[:-1])), ReplacementTransform(num, equation[-1]) ) - self.dither() + self.wait() self.set_variables_as_attrs(stack, equation) @@ -2274,7 +2274,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene): lag_ratio = 0.2, run_time = 4, )) - self.dither() + self.wait() self.name_triplets = movers @@ -2311,12 +2311,12 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene): MoveToTarget(people), MoveToTarget(names), ) - self.dither() + self.wait() self.play( ReplacementTransform(line_rect, full_line_rect), triplet.highlight, YELLOW ) - self.dither(2) + self.wait(2) self.play( people.restore, names.restore, @@ -2369,7 +2369,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene): ) ] if i == 1: - self.dither() + self.wait() if i == 4: anims.append(Write(words, run_time = 1)) self.play(*anims) @@ -2435,7 +2435,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene): if i < len(word_arrow_groups): anims.append(FadeIn(word_arrow_groups[i])) self.play(*anims) - self.dither() + self.wait() word_arrow_groups.submobjects = [ word_arrow_groups[j] for j in 1, 2, 0 @@ -2464,13 +2464,13 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene): lambda pi : (pi.change, "happy", ones), ) ) - self.dither() + self.wait() for trip in it.combinations(self.people, 3): rects = VGroup(*map(SurroundingRectangle, trip)) self.add(rects) - self.dither(0.3) + self.wait(0.3) self.remove(rects) - self.dither() + self.wait() ### @@ -2523,7 +2523,7 @@ class SubsetProbabilityExample(ChooseThreeFromFive): group = VGroup(people, names, braces) self.play(group.shift, -group.get_center()[0]*RIGHT) - self.dither() + self.wait() self.set_variables_as_attrs(names, braces) @@ -2574,7 +2574,7 @@ class SubsetProbabilityExample(ChooseThreeFromFive): ShowCreation(rect), run_time = run_time, ) - self.dither(0.5) + self.wait(0.5) self.play( group.restore, FadeOut(symbol), @@ -2603,7 +2603,7 @@ class SubsetProbabilityExample(ChooseThreeFromFive): GrowFromCenter(brace), Write(total_count), ) - self.dither() + self.wait() self.set_variables_as_attrs(brace, total_count) @@ -2639,17 +2639,17 @@ class SubsetProbabilityExample(ChooseThreeFromFive): arrow.next_to(pi, UP) arrows.add(arrow) self.add(arrows) - self.dither(0.5) + self.wait(0.5) self.remove(arrows) self.add(arrows) - self.dither() + self.wait() self.play( FadeIn(frac_lines), five_choose_three.next_to, frac_lines[0], DOWN, SMALL_BUFF, ten.next_to, frac_lines[1], DOWN, SMALL_BUFF, Write(four_choose_two) ) - self.dither() + self.wait() self.play(ReplacementTransform( four_choose_two.copy(), six )) @@ -2660,7 +2660,7 @@ class SubsetProbabilityExample(ChooseThreeFromFive): name_rect.highlight(BLUE) name_rect.set_fill(BLUE, opacity = 0.25) self.play(Animation(name_rect, run_time = 0)) - self.dither(0.25) + self.wait(0.25) self.remove(name_rect) class StudentsGetConfused(PiCreatureScene): @@ -2694,7 +2694,7 @@ class StudentsGetConfused(PiCreatureScene): ) for x in range(4): self.play(self.get_shuffle_anim(line)) - self.dither() + self.wait() def create_pi_creatures(self): pis = VGroup(*[ @@ -2764,9 +2764,9 @@ class HowToComputeNChooseK(ChooseThreeFromFive): if x == 0: anims += [ShowCreation(line), FadeIn(word)] self.play(*anims) - self.dither() + self.wait() self.play(chosen_names.restore) - self.dither() + self.wait() self.set_variables_as_attrs(lines, place_words) @@ -2798,7 +2798,7 @@ class HowToComputeNChooseK(ChooseThreeFromFive): name.next_to, line, UP, SMALL_BUFF, GrowArrow(arrow) ) - self.dither() + self.wait() name_rects.remove(name.rect) name_rects.set_stroke(YELLOW, 3) @@ -2823,7 +2823,7 @@ class HowToComputeNChooseK(ChooseThreeFromFive): Write(dots), GrowFromCenter(chosen_names_brace), ) - self.dither() + self.wait() self.set_variables_as_attrs( chosen_names, chosen_names_brace, choice_numbers, @@ -2843,7 +2843,7 @@ class HowToComputeNChooseK(ChooseThreeFromFive): ) for i, name in zip(indices, chosen_names) ]) - self.dither(0.5) + self.wait(0.5) def count_permutations_of_ABC(self): n, k = self.n, self.k @@ -2874,7 +2874,7 @@ class HowToComputeNChooseK(ChooseThreeFromFive): name.next_to, line, UP, SMALL_BUFF, path_arc = -np.pi/3, ) - self.dither() + self.wait() #Consolidate choice counts choice_numbers = VGroup(*[ @@ -2895,7 +2895,7 @@ class HowToComputeNChooseK(ChooseThreeFromFive): Write(dots), ShowCreation(frac_line), ) - self.dither() + self.wait() self.fraction = VGroup( numerator, frac_line, VGroup(choice_numbers, dots) @@ -2962,12 +2962,12 @@ class HowToComputeNChooseK(ChooseThreeFromFive): lag_ratio = 0.2, ), ) - self.dither() + self.wait() self.play( LaggedStart(FadeIn, rects), Write(rhs[-1]) ) - self.dither() + self.wait() self.ordered_triplets = lines self.triplet_group_rects = rects @@ -2985,12 +2985,12 @@ class HowToComputeNChooseK(ChooseThreeFromFive): self.play(FocusOn(fraction)) self.play(ShowCreation(frac_rect)) self.play(FadeOut(frac_rect)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(brace_tex), ) - self.dither() + self.wait() #### @@ -3108,7 +3108,7 @@ class NineChooseFourExample(HowToComputeNChooseK): for line in stack: self.play(FadeIn(line, run_time = 0.1)) - self.dither(2) + self.wait(2) self.play(FadeOut( stack, submobject_mode = "lagged_start", run_time = 2 )) @@ -3130,7 +3130,7 @@ class NineChooseFourExample(HowToComputeNChooseK): LaggedStart(FadeIn, people, run_time = 1), FadeIn(n_items), ) - self.dither() + self.wait() self.play( FadeIn(choose_k), LaggedStart( @@ -3138,7 +3138,7 @@ class NineChooseFourExample(HowToComputeNChooseK): lambda m : (m.shift, MED_LARGE_BUFF*DOWN) ) ) - self.dither() + self.wait() self.play( chosen_subset.shift, MED_LARGE_BUFF*UP, n_items.next_to, n_items.get_center(), LEFT, @@ -3177,7 +3177,7 @@ class NineChooseFourExample(HowToComputeNChooseK): self.fraction.next_to, equals, RIGHT, FadeIn(equals), ) - self.dither() + self.wait() for mob in six, eight, two_three, four: mob.cross = Cross(mob) @@ -3191,15 +3191,15 @@ class NineChooseFourExample(HowToComputeNChooseK): ShowCreation(six.cross), ShowCreation(two_three.cross), ) - self.dither() + self.wait() self.play( ShowCreation(eight.cross), ShowCreation(four.cross), FadeIn(two) ) - self.dither() + self.wait() self.play(Write(rhs)) - self.dither() + self.wait() class WeirdKindOfCancelation(TeacherStudentsScene): def construct(self): @@ -3255,7 +3255,7 @@ class WeirdKindOfCancelation(TeacherStudentsScene): ShowCreationThenDestruction(rect), MoveToTarget(name), ) - self.dither(2) + self.wait(2) #Go through denominators permutations = list(it.permutations(range(3)))[1:] @@ -3266,7 +3266,7 @@ class WeirdKindOfCancelation(TeacherStudentsScene): VGroup(*map(SurroundingRectangle, bottom_numbers[::2])) )) self.shuffle(chosen_names, permutations[2:]) - self.dither() + self.wait() #Show cancelation top_cross = Cross(ordered) @@ -3278,7 +3278,7 @@ class WeirdKindOfCancelation(TeacherStudentsScene): ) self.play(ShowCreation(bottom_cross)) self.change_student_modes(*["happy"]*3) - self.dither(3) + self.wait(3) ### @@ -3325,7 +3325,7 @@ class ShowFormula(Scene): self.play(FadeIn(specific_formula)) self.play(FadeIn(general_formula)) - self.dither(3) + self.wait(3) class ConfusedPi(Scene): def construct(self): @@ -3337,9 +3337,9 @@ class ConfusedPi(Scene): self.add(morty) self.play(Blink(morty)) self.play(morty.change, "confused") - self.dither() + self.wait() self.play(Blink(morty)) - self.dither(2) + self.wait(2) class SumsToPowerOf2(Scene): CONFIG = { @@ -3371,7 +3371,7 @@ class SumsToPowerOf2(Scene): LaggedStart(FadeIn, stacks), LaggedStart(FadeIn, numbers), ) - self.dither() + self.wait() self.set_variables_as_attrs(stacks, numbers) @@ -3403,11 +3403,11 @@ class SumsToPowerOf2(Scene): number.to_edge(UP) VGroup(number, line_copy).highlight(YELLOW) self.add(line_copy, number) - self.dither(0.15) + self.wait(0.15) self.remove(line_copy, number) sum_result = number self.add(sum_result) - self.dither() + self.wait() sum_result.target = TexMobject(str(2**self.n)) sum_result.target.highlight(sum_result.get_color()) @@ -3419,7 +3419,7 @@ class SumsToPowerOf2(Scene): Write(plusses), Write(rhs), ) - self.dither() + self.wait() self.set_variables_as_attrs( plusses, sum_result, rhs, @@ -3449,7 +3449,7 @@ class SumsToPowerOf2(Scene): submobject_mode = "lagged_start", run_time = 2 ) - self.dither() + self.wait() def show_alternate_sum(self): fractions = self.get_fractions(self.alt_n) @@ -3480,7 +3480,7 @@ class SumsToPowerOf2(Scene): LaggedStart(FadeIn, sum_group), ) self.play(LaggedStart(FadeIn, rhs)) - self.dither(2) + self.wait(2) #### @@ -3536,7 +3536,7 @@ class AskWhyTheyAreCalledBinomial(TeacherStudentsScene): "Why are they called \\\\ ``binomial coefficients''?" ) self.play(LaggedStart(FadeIn, pascals)) - self.dither() + self.wait() self.play( FadeIn(example_binomials[0]), RemovePiCreatureBubble(self.students[1]), @@ -3546,7 +3546,7 @@ class AskWhyTheyAreCalledBinomial(TeacherStudentsScene): for binom in example_binomials[1:]: self.play(Transform(moving_binom, binom)) self.add(binom) - self.dither() + self.wait() #Name themn self.play( @@ -3555,7 +3555,7 @@ class AskWhyTheyAreCalledBinomial(TeacherStudentsScene): ) self.change_student_modes(*["pondering"]*3) self.play(Write(two_variables)) - self.dither(2) + self.wait(2) class NextVideo(Scene): def construct(self): @@ -3568,7 +3568,7 @@ class NextVideo(Scene): Write(title), ShowCreation(screen) ) - self.dither() + self.wait() class CombinationsPatreonEndScreen(PatreonEndScreen): CONFIG = { diff --git a/eop/independence.py b/eop/independence.py index 14ea222b..e393263a 100644 --- a/eop/independence.py +++ b/eop/independence.py @@ -159,7 +159,7 @@ class DangerInProbability(Scene): warning.next_to, probability, UP, LARGE_BUFF, LaggedStart(FadeIn, probability) ) - self.dither() + self.wait() ##### @@ -249,7 +249,7 @@ class MeaningOfIndependence(SampleSpaceScene): ShowCreation(line), Write(word, run_time = 1) ) - self.dither() + self.wait() self.independence_word = word self.independence_line = line @@ -274,7 +274,7 @@ class MeaningOfIndependence(SampleSpaceScene): self.independence_word.next_to, equation, UP, MED_LARGE_BUFF, Write(equation) ) - self.dither() + self.wait() self.equation = equation @@ -296,9 +296,9 @@ class MeaningOfIndependence(SampleSpaceScene): morty.change, "hooray", everything, ShowCreation(bubble) ) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() self.morty = morty @@ -315,7 +315,7 @@ class MeaningOfIndependence(SampleSpaceScene): FadeOut(self.independence_line) ] )) - self.dither() + self.wait() class IntroduceBinomial(Scene): CONFIG = { @@ -398,7 +398,7 @@ class IntroduceBinomial(Scene): def play_with_p_value(self, *values): for value in values: self.change_p(value) - self.dither() + self.wait() def write_independence_assumption(self): assumption = TextMobject("Independence assumption") @@ -407,7 +407,7 @@ class IntroduceBinomial(Scene): assumption.highlight(GREEN_C) self.play(Write(assumption, run_time = 2)) - self.dither() + self.wait() self.assumption = assumption @@ -418,7 +418,7 @@ class IntroduceBinomial(Scene): self.play(ShowCreation(cross)) self.play(self.bar_chart.fade, 0.7) - self.dither(2) + self.wait(2) self.play(self.bar_chart.restore) def shift_weight_to_tails(self): @@ -450,7 +450,7 @@ class IntroduceBinomial(Scene): self.play( chart_copy.change_bar_values, values ) - self.dither(2) + self.wait(2) @@ -484,7 +484,7 @@ class IntroduceQuiz(PiCreatureScene): Write(quiz), self.randy.change, "pondering", quiz ) - self.dither() + self.wait() self.quiz = quiz @@ -518,7 +518,7 @@ class IntroduceQuiz(PiCreatureScene): self.quiz.next_to, self.randy, RIGHT, self.randy.change, "confused", probabilities ) - self.dither() + self.wait() self.probabilities = probabilities self.abbreviated_probabilities = abbreviated_probabilities @@ -555,7 +555,7 @@ class IntroduceQuiz(PiCreatureScene): self.abbreviated_probabilities, ) ]) - self.dither() + self.wait() self.bar_chart = chart @@ -573,7 +573,7 @@ class IntroduceQuiz(PiCreatureScene): self.randy.change, "happy", prob ) self.play(ShowCreation(rect)) - self.dither() + self.wait() self.single_question_probability = VGroup( prob, rect @@ -635,10 +635,10 @@ class BreakDownQuestionPatterns(IntroduceQuiz): group_group = slot_group_groups[0] self.revert_to_original_skipping_status() self.play(Write(group_group, run_time = 1)) - self.dither() + self.wait() for new_group_group in slot_group_groups[1:]: self.play(Transform(group_group, new_group_group)) - self.dither(2) + self.wait(2) self.slot_groups = slot_group_groups[-1] @@ -651,7 +651,7 @@ class BreakDownQuestionPatterns(IntroduceQuiz): GrowFromCenter(brace), Write(count) ) - self.dither() + self.wait() ####### @@ -702,7 +702,7 @@ class AssociatePatternsWithScores(BreakDownQuestionPatterns): for score, score_group in zip(scores, score_groups): score_group.save_state() self.play(score_group.next_to, score_group, LEFT, MED_LARGE_BUFF) - self.dither() + self.wait() self.play( ReplacementTransform( score_group.copy(), score_group.organized @@ -710,7 +710,7 @@ class AssociatePatternsWithScores(BreakDownQuestionPatterns): LaggedStart(FadeIn, score, run_time = 1) ) self.play(score_group.restore) - self.dither() + self.wait() def think_about_binomial_patterns(self): triangle = PascalsTriangle( @@ -742,7 +742,7 @@ class AssociatePatternsWithScores(BreakDownQuestionPatterns): LaggedStart(FadeIn, triangle, run_time = 4), ) self.play(row.highlight, YELLOW) - self.dither(4) + self.wait(4) class BeforeCounting(TeacherStudentsScene): def construct(self): @@ -769,7 +769,7 @@ class BeforeCounting(TeacherStudentsScene): GrowFromCenter(brace), LaggedStart(FadeIn, q_marks) ) - self.dither(2) + self.wait(2) class TemptingButWrongCalculation(BreakDownQuestionPatterns): def construct(self): @@ -823,7 +823,7 @@ class TemptingButWrongCalculation(BreakDownQuestionPatterns): LaggedStart(FadeIn, slot_group.content, run_time = 3), self.randy.change, "pondering" ) - self.dither(2) + self.wait(2) for part, mob in zip(rhs, slot_group.content): self.play(*[ ReplacementTransform( @@ -836,13 +836,13 @@ class TemptingButWrongCalculation(BreakDownQuestionPatterns): ]) self.play(GrowFromCenter(part.brace)) self.play(FadeIn(part.value)) - self.dither() - self.dither() + self.wait() + self.wait() self.play( Write(question), self.randy.change, "confused" ) - self.dither(3) + self.wait(3) self.question = question self.rhs = rhs @@ -907,7 +907,7 @@ class ThousandPossibleQuizzes(Scene): ), Animation(full_quizzes, remover = True) ) - self.dither() + self.wait() self.quizzes = quizzes self.title = title @@ -940,7 +940,7 @@ class ThousandPossibleQuizzes(Scene): ) for label in labels: self.play(FadeIn(label)) - self.dither() + self.wait() self.splits = VGroup(top_split, bottom_split) self.q1_split_labels = labels @@ -973,14 +973,14 @@ class ThousandPossibleQuizzes(Scene): self.play(Write(question)) self.play(ShowCreation(little_rects)) - self.dither() + self.wait() self.play(FadeOut(little_rects)) self.play(ShowCreation(big_rect)) self.play( FadeOut(big_rect), FadeOut(question), ) - self.dither() + self.wait() def show_uncorrelated_division_by_second(self): top_split = self.splits[0] @@ -1013,7 +1013,7 @@ class ThousandPossibleQuizzes(Scene): rate_func = there_and_back, lag_ratio = 0.2, )) - self.dither() + self.wait() self.top_left_label = left_label self.top_splits = VGroup(left_split, right_split) @@ -1042,9 +1042,9 @@ class ThousandPossibleQuizzes(Scene): ), Transform(left_label_equation, new_equation) ) - self.dither(2) + self.wait(2) self.play(Indicate(left_label_equation[0])) - self.dither() + self.wait() left_split.add(*movers) right_split.remove(*movers) @@ -1089,7 +1089,7 @@ class ThousandPossibleQuizzes(Scene): *map(MoveToTarget, [left_split, right_split]) ) self.play(FadeIn(label)) - self.dither() + self.wait() self.play( MoveToTarget( movers, @@ -1098,7 +1098,7 @@ class ThousandPossibleQuizzes(Scene): ), Transform(equation, alt_equation) ) - self.dither() + self.wait() left_split.remove(*movers) right_split.add(*movers) @@ -1153,7 +1153,7 @@ class ThousandPossibleQuizzes(Scene): *map(Animation, [num1, num2]) ) self.remove(num1, num2) - self.dither() + self.wait() self.play(FadeOut(rects)) def emphasize_disproportionate_divide(self): @@ -1177,9 +1177,9 @@ class ThousandPossibleQuizzes(Scene): self.play(*map(MoveToTarget, both_movers)) self.play(ShowCreation(line)) self.play(FadeOut(line)) - self.dither() + self.wait() self.play(both_movers.restore) - self.dither() + self.wait() def show_third_question_results(self): all_splits = VGroup( @@ -1210,7 +1210,7 @@ class ThousandPossibleQuizzes(Scene): ) for split in all_splits: self.play(MoveToTarget(split)) - self.dither() + self.wait() self.play(LaggedStart( ApplyMethod, all_right, lambda m : (m.highlight, YELLOW), @@ -1218,7 +1218,7 @@ class ThousandPossibleQuizzes(Scene): lag_ratio = 0.2, run_time = 2 )) - self.dither(2) + self.wait(2) ##### @@ -1259,7 +1259,7 @@ class ExampleConditional(Scene): expression.center().to_edge(DOWN) self.play(Write(expression)) - self.dither() + self.wait() class HarderQuizzes(Scene): def construct(self): @@ -1284,10 +1284,10 @@ class HarderQuizzes(Scene): for quiz in quizzes: self.play(FadeIn(quiz)) - self.dither() + self.wait() for cross in crosses: self.play(ShowCreation(cross)) - self.dither() + self.wait() class WritePSecond(Scene): def construct(self): @@ -1324,13 +1324,13 @@ class SubmitToTemptation(TemptingButWrongCalculation): ) for part in self.rhs: self.play(Indicate(part.value)) - self.dither() + self.wait() class AccurateProductRule(SampleSpaceScene, ThreeDScene): def construct(self): self.setup_terms() self.add_sample_space() - self.dither() + self.wait() self.show_first_division() self.show_second_division() self.move_to_third_dimension() @@ -1402,9 +1402,9 @@ class AccurateProductRule(SampleSpaceScene, ThreeDScene): self.play(ReplacementTransform( top_label.copy(), self.terms[1] )) - self.dither() + self.wait() self.play(Write(self.terms[1].value)) - self.dither() + self.wait() space.add(braces_and_labels) self.top_part = space.horizontal_parts[0] @@ -1428,9 +1428,9 @@ class AccurateProductRule(SampleSpaceScene, ThreeDScene): self.play(ReplacementTransform( label.copy(), self.terms[2] )) - self.dither() + self.wait() self.play(Write(self.terms[2].value)) - self.dither() + self.wait() space.add(braces_and_labels) self.top_left_part = top_part.vertical_parts[0] @@ -1462,7 +1462,7 @@ class AccurateProductRule(SampleSpaceScene, ThreeDScene): cubes[1].set_fill, None, 0.5, cubes[1].set_stroke, WHITE, 1, ) - self.dither() + self.wait() self.cubes = cubes @@ -1480,11 +1480,11 @@ class AccurateProductRule(SampleSpaceScene, ThreeDScene): GrowFromCenter(brace), FadeIn(label), ) - self.dither() + self.wait() self.play(ReplacementTransform( label.copy(), self.terms[3] )) - self.dither() + self.wait() def show_confusion(self): randy = Randolph() @@ -1495,7 +1495,7 @@ class AccurateProductRule(SampleSpaceScene, ThreeDScene): self.play(randy.look_at, self.cubes) self.play(Blink(randy)) self.play(randy.look_at, self.terms) - self.dither() + self.wait() class ShowAllEightConditionals(Scene): def construct(self): @@ -1539,10 +1539,10 @@ class ShowAllEightConditionals(Scene): run_time = 5, lag_ratio = 0.3 )) - self.dither() + self.wait() self.play(ShowCreation(rect, run_time = 2)) self.play(FadeOut(rect)) - self.dither() + self.wait() def suggest_independence(self): full_screen_rect = FullScreenFadeRectangle() @@ -1559,7 +1559,7 @@ class ShowAllEightConditionals(Scene): target_mode = "shruggie" )) self.play(Blink(randy)) - self.dither() + self.wait() class ShowIndependenceSymbolically(Scene): def construct(self): @@ -1592,13 +1592,13 @@ class ShowIndependenceSymbolically(Scene): words.next_to(arrow, UP) self.add(rhs, lhs, arrow, words) - self.dither() + self.wait() for bool_list in bool_lists: slot_group = get_slot_group(bool_list, SMALL_BUFF, False) slot_group.replace(condition) slot_group.move_to(condition, DOWN) self.play(Transform(condition, slot_group)) - self.dither() + self.wait() class ComputeProbabilityOfOneWrong(Scene): CONFIG = { @@ -1635,20 +1635,20 @@ class ComputeProbabilityOfOneWrong(Scene): probabilities.center() self.play(Write(probabilities[0])) - self.dither(2) + self.wait(2) for i in range(2): self.play(ReplacementTransform( probabilities[i].copy(), probabilities[i+1] )) - self.dither() + self.wait() for group in point_8s, point_2s: self.play(LaggedStart( Indicate, group, rate_func = there_and_back, lag_ratio = 0.7 )) - self.dither() + self.wait() def show_final_result(self): result = TexMobject( @@ -1666,7 +1666,7 @@ class ComputeProbabilityOfOneWrong(Scene): result.to_edge(UP) self.play(Write(result)) - self.dither() + self.wait() class ComputeProbabilityOfOneRight(ComputeProbabilityOfOneWrong): CONFIG = { @@ -1730,7 +1730,7 @@ class ShowFullDistribution(Scene): def add_scores_zero_and_three(self): self.p_slot_groups = VGroup() - self.dither() + self.wait() self.add_edge_score(0, UP, False) self.add_edge_score(3, DOWN, True) @@ -1747,7 +1747,7 @@ class ShowFullDistribution(Scene): run_time = 2, lag_ratio = 0.7, )) - self.dither(2) + self.wait(2) self.p_slot_groups.add(brace, p_slot_group) def show_bar_chart(self): @@ -1790,7 +1790,7 @@ class ShowFullDistribution(Scene): Transform(p_terms, new_p_terms), FadeOut(to_fade), ) - self.dither(2) + self.wait(2) chart.bar_top_labels = p_terms chart.add(p_terms) @@ -1814,12 +1814,12 @@ class ShowFullDistribution(Scene): LaggedStart(FadeIn, bars), LaggedStart(FadeIn, nums), ) - self.dither(2) + self.wait(2) self.play(bars_copy.shift, -vect) self.play(ReplacementTransform( bars_copy, self.bar_chart.bars )) - self.dither(2) + self.wait(2) self.play( VGroup(self.bar_chart, bars, nums).to_edge, LEFT ) @@ -1855,14 +1855,14 @@ class ShowFullDistribution(Scene): self.play(FadeIn(new_prob)) self.play(Transform(new_prob[-1], alt_rhss[0])) point_5_probs = self.show_point_5_probs(new_prob) - self.dither() + self.wait() self.play(Transform(self.bar_chart, alt_charts[0])) - self.dither() + self.wait() self.play(FadeOut(point_5_probs)) for rhs, chart in zip(alt_rhss, alt_charts)[1:]: self.play(Transform(new_prob[-1], rhs)) self.play(Transform(self.bar_chart, chart)) - self.dither(2) + self.wait(2) def show_point_5_probs(self, mob): probs = VGroup() @@ -1883,7 +1883,7 @@ class ShowFullDistribution(Scene): buff = SMALL_BUFF self.play(LaggedStart(FadeIn, probs)) - self.dither() + self.wait() return probs class ProbablyWrong(TeacherStudentsScene): @@ -1896,7 +1896,7 @@ class ProbablyWrong(TeacherStudentsScene): *["angry"]*3, run_time = 1 ) - self.dither() + self.wait() class ShowTrueDistribution(PiCreatureScene): def construct(self): @@ -1952,7 +1952,7 @@ class ShowTrueDistribution(PiCreatureScene): chart.change_bar_values, alt_values, *map(ShowCreation, arrows) ) - self.dither(2) + self.wait(2) self.bar_chart = chart self.old_bars = old_bars @@ -1972,24 +1972,24 @@ class ShowTrueDistribution(PiCreatureScene): )) self.play(ShowCreation(prob_rect)) - self.dither() + self.wait() self.play(ReplacementTransform( prob_rect, bar_rect )) - self.dither() + self.wait() self.play(FadeOut(bar_rect)) def get_angry(self): randy = self.randy self.play(randy.change, "angry") - self.dither(2) + self.wait(2) self.play(PiCreatureSays( randy, "It's not representative!", target_mode = "pleading", bubble_kwargs = {"fill_opacity" : 1} )) - self.dither(2) + self.wait(2) ##### @@ -2036,7 +2036,7 @@ class TeacherAssessingLiklihoodOfZero(TeacherStudentsScene): FadeIn(words), Write(prob) ) - self.dither() + self.wait() self.ind_group = VGroup(prob, words) @@ -2059,7 +2059,7 @@ class TeacherAssessingLiklihoodOfZero(TeacherStudentsScene): run_time = 2, ) self.play(randy.change, "sad") - self.dither(2) + self.wait(2) self.play( RemovePiCreatureBubble( self.teacher, target_mode = "guilty", @@ -2067,7 +2067,7 @@ class TeacherAssessingLiklihoodOfZero(TeacherStudentsScene): PiCreatureSays(randy, "Wait!", target_mode = "surprised"), run_time = 1 ) - self.dither(1) + self.wait(1) class CorrelationsWith35Percent(ThousandPossibleQuizzes): def construct(self): @@ -2110,19 +2110,19 @@ class CorrelationsWith35Percent(ThousandPossibleQuizzes): term_brace = Brace(term, DOWN) self.add(quizzes) - self.dither() + self.wait() self.play( GrowFromCenter(brace), FadeIn(prop), *map(MoveToTarget, parts) ) - self.dither() + self.wait() self.play( top_part.fade, 0.8, Transform(brace, term_brace), prop.next_to, term_brace, DOWN, ) - self.dither() + self.wait() self.quizzes = bottom_part self.quizzes.sort_submobjects(lambda p : p[0]) @@ -2149,7 +2149,7 @@ class CorrelationsWith35Percent(ThousandPossibleQuizzes): FadeIn(prop), *map(MoveToTarget, parts) ) - self.dither() + self.wait() self.play( Transform(brace, term_brace), prop.next_to, term_brace, DOWN @@ -2182,13 +2182,13 @@ class CorrelationsWith35Percent(ThousandPossibleQuizzes): FadeIn(prop), *map(MoveToTarget, parts) ) - self.dither() + self.wait() self.play( Transform(brace, term_brace), prop.next_to, term_brace, DOWN, ) self.play(top_part.fade, 0.8) - self.dither() + self.wait() self.quizzes = bottom_part @@ -2203,7 +2203,7 @@ class CorrelationsWith35Percent(ThousandPossibleQuizzes): ShowCreation(rect), FadeIn(words) ) - self.dither() + self.wait() class WeighingIndependenceAssumption(PiCreatureScene): def construct(self): @@ -2236,7 +2236,7 @@ class WeighingIndependenceAssumption(PiCreatureScene): randy.change, "raise_right_hand", randy.look, UP+RIGHT, ) - self.dither(2) + self.wait(2) #### @@ -2292,12 +2292,12 @@ class NameBinomial(Scene): formula.to_corner(UP+RIGHT) self.add(charts[0], probability) - self.dither() + self.wait() self.play(Write(title)) - self.dither() + self.wait() self.play(ReplacementTransform(*charts)) self.play(Write(formula)) - self.dither() + self.wait() self.play( formula.scale, 0.7, formula.next_to, charts, DOWN, @@ -2348,7 +2348,7 @@ class NameBinomial(Scene): ) for mob in full_group ]) - self.dither() + self.wait() self.play( LaggedStart( Rotate, flipped_arrows, @@ -2360,7 +2360,7 @@ class NameBinomial(Scene): faded_crosses.set_fill, None, 0.5, faded_checkmarks.set_fill, None, 0.5, ) - self.dither() + self.wait() self.checkmarks = checkmarks self.crosses = crosses @@ -2397,7 +2397,7 @@ class NameBinomial(Scene): submobject_mode = "lagged_start", run_time = 3 )) - self.dither() + self.wait() self.boys = boys self.girls = girls @@ -2421,7 +2421,7 @@ class NameBinomial(Scene): Transform(p_mob, new_p_mob), ) self.play(self.chart.change_bar_values, values) - self.dither() + self.wait() def point_out_example_input(self): boy_girl_groups = VGroup(*[ @@ -2462,7 +2462,7 @@ class NameBinomial(Scene): run_time = 2, lag_ratio = 0.5, )) - self.dither() + self.wait() self.play(Write(prob)) self.play(LaggedStart( @@ -2472,7 +2472,7 @@ class NameBinomial(Scene): rate_func = there_and_back )) self.play(FadeOut(prob)) - self.dither() + self.wait() self.chart_rect = chart_rect self.girl_rects = girl_rects @@ -2488,7 +2488,7 @@ class NameBinomial(Scene): self.play(FocusOn(probability)) self.play(Indicate(probability[-1])) - self.dither() + self.wait() self.play( ReplacementTransform( VGroup(probability.copy()), probability_copies @@ -2496,7 +2496,7 @@ class NameBinomial(Scene): FadeOut(self.children_brace), FadeOut(self.n_children_words), ) - self.dither() + self.wait() self.probability_copies = probability_copies @@ -2507,7 +2507,7 @@ class NameBinomial(Scene): self.play(FadeIn(randy)) self.play(randy.change, "pondering") self.play(Blink(randy)) - self.dither() + self.wait() ## @@ -2590,7 +2590,7 @@ class Compute6of10GirlsProbability(CycleThroughPatterns): pattern_rect.to_edge(UP, buff = MED_SMALL_BUFF) self.add(pattern_rect) - self.dither(5) + self.wait(5) self.pattern_rect = pattern_rect @@ -2615,12 +2615,12 @@ class Compute6of10GirlsProbability(CycleThroughPatterns): GrowFromCenter(brace) ) self.play(Write(ten_choose_six)) - self.dither(2) + self.wait(2) self.play( ten_choose_six.next_to, computation.copy(), LEFT, Write(VGroup(computation, rhs)) ) - self.dither() + self.wait() self.ten_choose_six = ten_choose_six self.rhs = rhs @@ -2684,18 +2684,18 @@ class ProbabilityOfAGivenBoyGirlPattern(CycleThroughPatterns): final_probability.next_to(factored_in_nums, DOWN, LARGE_BUFF) self.play(FadeIn(prob)) - self.dither() + self.wait() self.play(ReplacementTransform( pattern.copy(), factored, run_time = 1.5, )) - self.dither(2) + self.wait(2) self.play(ReplacementTransform( factored, factored_in_nums, run_time = 2, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) for group, tex in (gp_nums, "0.49"), (bp_nums, "0.51"): part = final_probability.get_part_by_tex(tex) self.play(group.shift, MED_LARGE_BUFF*DOWN) @@ -2705,9 +2705,9 @@ class ProbabilityOfAGivenBoyGirlPattern(CycleThroughPatterns): ), Write(part[-1]) ) - self.dither() + self.wait() self.play(group.restore) - self.dither() + self.wait() self.final_probability = final_probability @@ -2725,7 +2725,7 @@ class ProbabilityOfAGivenBoyGirlPattern(CycleThroughPatterns): ten_choose_six.target, RIGHT ) self.play(MoveToTarget(ten_choose_six)) - self.dither() + self.wait() class CycleThroughPatternsForThree(CycleThroughPatterns): CONFIG = { @@ -2791,20 +2791,20 @@ class GeneralBinomialDistributionValues(Scene): shown_prob = probabilities[6].copy() self.play(FadeIn(shown_prob)) - self.dither() + self.wait() self.play(LaggedStart( FadeIn, self.full_probability, run_time = 4, lag_ratio = 0.5, )) - self.dither() + self.wait() last_k = 6 for k in 3, 8, 5, 9, 6: self.play(Transform( shown_prob, probabilities[k], path_arc = -np.pi/6 if k > last_k else np.pi/6 )) - self.dither(2) + self.wait(2) last_k = k self.shown_prob = shown_prob @@ -2834,7 +2834,7 @@ class GeneralBinomialDistributionValues(Scene): last_row.gradient_highlight, BLUE, YELLOW, Write(ten_choose_ks, run_time = 2) ) - self.dither() + self.wait() self.play(ApplyWave(self.chart.bars, direction = UP)) self.play(FocusOn(last_row)) self.play(LaggedStart( @@ -2842,7 +2842,7 @@ class GeneralBinomialDistributionValues(Scene): lambda m : (m.scale_in_place, 1.2), rate_func = there_and_back, )) - self.dither() + self.wait() self.pascals_triangle = triangle self.ten_choose_ks = ten_choose_ks @@ -2865,7 +2865,7 @@ class GeneralBinomialDistributionValues(Scene): GrowFromCenter(brace), FadeIn(words) ) - self.dither(2) + self.wait(2) self.play( bars.restore, *map(FadeOut, [ @@ -2899,9 +2899,9 @@ class GeneralBinomialDistributionValues(Scene): Transform(self.full_probability, alt_probs[0]) ) self.chart = alt_chart - self.dither(2) + self.wait(2) self.play(Transform(self.full_probability, alt_probs[1])) - self.dither() + self.wait() def play_with_p_value(self): p = self.p @@ -2928,7 +2928,7 @@ class GeneralBinomialDistributionValues(Scene): ShowCreation(interval), Write(triangle, run_time = 1) ) - self.dither() + self.wait() for new_p in new_p_values: p = new_p dist = get_binomial_distribution(self.alt_n, p) @@ -2937,7 +2937,7 @@ class GeneralBinomialDistributionValues(Scene): self.chart.change_bar_values, values, triangle.move_to, interval.number_to_point(p), DOWN ) - self.dither() + self.wait() ####### @@ -2985,16 +2985,16 @@ class PointOutSimplicityOfFormula(TeacherStudentsScene, GeneralBinomialDistribut *["pondering"]*3, look_at_arg = prob ) - self.dither() + self.wait() self.student_says( "Simpler than I feared", target_mode = "hooray", student_index = 0, added_anims = [prob.to_corner, UP+RIGHT] ) - self.dither() + self.wait() self.teacher_says("Due to \\\\ independence") - self.dither(2) + self.wait(2) class CorrectForDependence(NameBinomial): CONFIG = { @@ -3021,9 +3021,9 @@ class CorrectForDependence(NameBinomial): GrowFromCenter(brace), Write(words) ) - self.dither() + self.wait() self.play(ShowCreation(cross)) - self.dither() + self.wait() def show_tendency_to_align(self): checkmarks = self.checkmarks @@ -3039,7 +3039,7 @@ class CorrectForDependence(NameBinomial): self.play(ShowCreation(top_rect)) self.play(*self.get_arrow_flip_anims([0])) - self.dither() + self.wait() self.play(*self.get_arrow_flip_anims(indices_to_follow)) self.play(FocusOn(self.chart.bars)) @@ -3080,7 +3080,7 @@ class CorrectForDependence(NameBinomial): MoveToTarget(old_bars), MoveToTarget(bars), ) - self.dither() + self.wait() self.play(*map(ShowCreation, arrows)) self.play(chart.change_bar_values, alt_values) @@ -3130,9 +3130,9 @@ class ButWhatsTheAnswer(TeacherStudentsScene): target_mode = "confused" ) self.change_student_modes(*["confused"]*3) - self.dither() + self.wait() self.play(self.teacher.change, "pondering") - self.dither(3) + self.wait(3) class PermuteQuizQuestions(Scene): def construct(self): @@ -3151,14 +3151,14 @@ class PermuteQuizQuestions(Scene): quiz.scale(2) self.add(quiz) - self.dither() + self.wait() for m1, m2 in it.combinations(questions, 2): self.play( m1.move_to, m2, LEFT, m2.move_to, m1, LEFT, path_arc = np.pi ) - self.dither() + self.wait() class AssumeOrderDoesntMatter(Scene): def construct(self): @@ -3210,13 +3210,13 @@ class AssumeOrderDoesntMatter(Scene): run_time = 2, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) self.play(FadeIn( VGroup(prob_groups[0], *prob_groups[2:]), run_time = 3, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.prob_groups = prob_groups @@ -3234,7 +3234,7 @@ class AssumeOrderDoesntMatter(Scene): Write(question), assumption_group.next_to, bottom, DOWN, LARGE_BUFF ) - self.dither() + self.wait() self.assumption_group = assumption_group self.question = question @@ -3261,7 +3261,7 @@ class AssumeOrderDoesntMatter(Scene): part.highlight, YELLOW ) self.play(Write(words)) - self.dither() + self.wait() @@ -3277,13 +3277,13 @@ class FormulaCanBeRediscovered(PointOutSimplicityOfFormula): Write(prob), self.teacher.change, "hesitant", prob ) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(rediscover, run_time = 1) ) self.change_student_modes(*["happy"]*3) - self.dither(2) + self.wait(2) class CompareTwoSituations(PiCreatureScene): def construct(self): @@ -3300,12 +3300,12 @@ class CompareTwoSituations(PiCreatureScene): randy.change, "raise_%s_hand"%s, screen, ShowCreation(screen) ) - self.dither(3) + self.wait(3) self.play( randy.change, "pondering", arrow, ShowCreation(arrow) ) - self.dither(2) + self.wait(2) #### @@ -3336,14 +3336,14 @@ class SkepticalOfDistributions(TeacherStudentsScene): ) for values in binomial.values_list: self.play(binomial.change_bar_values, values) - self.dither() + self.wait() self.student_says( "Is that valid?", target_mode = "sassy", student_index = 0, run_time = 1 ) self.play(self.teacher.change, "guilty") - self.dither() + self.wait() binomial.add(title) self.binomial = binomial @@ -3369,12 +3369,12 @@ class SkepticalOfDistributions(TeacherStudentsScene): self.play(Write(poisson.title, run_time = 1)) self.play(FadeIn(gaussian, submobject_mode = "lagged_start")) self.play(Write(gaussian.title, run_time = 1)) - self.dither(2) + self.wait(2) self.change_student_modes( *["sassy"]*3, added_anims = [self.teacher.change, "plain"] ) - self.dither(2) + self.wait(2) self.poisson = poisson self.gaussian = gaussian @@ -3409,8 +3409,8 @@ class SkepticalOfDistributions(TeacherStudentsScene): for pi in self.pi_creatures ] ) - self.dither() - self.dither(2) + self.wait() + self.wait(2) #### diff --git a/example_scenes.py b/example_scenes.py index 6ebf7762..80c37370 100644 --- a/example_scenes.py +++ b/example_scenes.py @@ -26,16 +26,21 @@ from mobject.vectorized_mobject import * ## To watch one of these scenes, run the following: ## python extract_scene.py -p file_name + + + + class SquareToCircle(Scene): def construct(self): circle = Circle() - circle.shift(np.array([10, -5, 0])) square = Square() square.rotate(np.pi/8) - square.shift(np.array([10, -5, 0])) + self.add(circle, square) + return + self.play(ShowCreation(square)) self.play(Transform(square, circle)) - self.dither() + self.wait() class WarpSquare(Scene): def construct(self): @@ -44,7 +49,7 @@ class WarpSquare(Scene): lambda (x, y, z) : complex_to_R3(np.exp(complex(x, y))), square )) - self.dither() + self.wait() class WriteStuff(Scene): diff --git a/nn/part1.py b/nn/part1.py index 2efa5d80..91b8884b 100644 --- a/nn/part1.py +++ b/nn/part1.py @@ -389,7 +389,7 @@ class ExampleThrees(PiCreatureScene): FadeIn(three_mob[0]), LaggedStart(FadeIn, three_mob[1]) ) - self.dither() + self.wait() self.play( LaggedStart( DrawBorderThenFill, three_mob_copy, @@ -403,7 +403,7 @@ class ExampleThrees(PiCreatureScene): map(FadeIn, brace_labels) ) ) - self.dither() + self.wait() self.play( ShowCreation(bubble), MoveToTarget(three_mob), @@ -415,7 +415,7 @@ class ExampleThrees(PiCreatureScene): ShowCreation(arrow), Write(real_three) ) - self.dither() + self.wait() self.bubble = bubble self.arrow = arrow @@ -442,7 +442,7 @@ class ExampleThrees(PiCreatureScene): for alt_three in alt_threes: self.add(alt_three) - self.dither(0.5) + self.wait(0.5) self.play( randy.change, "plain", *map(FadeOut, [ @@ -451,7 +451,7 @@ class ExampleThrees(PiCreatureScene): ) for alt_three in alt_threes[:2]: self.play(three.replace, alt_three) - self.dither() + self.wait() for moving_three in three, alt_threes[1]: moving_three.generate_target() moving_three.target.next_to(alt_threes, LEFT, LARGE_BUFF) @@ -492,7 +492,7 @@ class ExampleThrees(PiCreatureScene): MoveToTarget(right_three), Write(equals), ) - self.dither() + self.wait() self.equals = equals @@ -518,10 +518,10 @@ class ExampleThrees(PiCreatureScene): Transform(three, alt_mobs[0]), ShowCreation(cross) ) - self.dither() + self.wait() for mob in alt_mobs[1:]: self.play(Transform(three, mob)) - self.dither() + self.wait() ###### @@ -568,7 +568,7 @@ class BrainAndHow(Scene): run_time = 2 ) ) - self.dither() + self.wait() class WriteAProgram(Scene): def construct(self): @@ -625,7 +625,7 @@ class WriteAProgram(Scene): rect.move_to, choices[n], MaintainPositionRelativeTo(q_mark, rect) ) - self.dither(1) + self.wait(1) choice = choices[3] choices.remove(choice) choice.add(rect) @@ -635,7 +635,7 @@ class WriteAProgram(Scene): FadeOut(choices), FadeOut(q_mark), ) - self.dither(2) + self.wait(2) class LayOutPlan(TeacherStudentsScene, NetworkScene): def setup(self): @@ -720,7 +720,7 @@ class LayOutPlan(TeacherStudentsScene, NetworkScene): equation.to_edge(UP) self.play(Write(equation, run_time = 2)) - self.dither() + self.wait() self.equation = equation @@ -730,7 +730,7 @@ class LayOutPlan(TeacherStudentsScene, NetworkScene): student_index = 2, bubble_kwargs = {"direction" : LEFT} ) - self.dither() + self.wait() self.play(RemovePiCreatureBubble(self.students[2])) def show_learning(self): @@ -764,7 +764,7 @@ class LayOutPlan(TeacherStudentsScene, NetworkScene): width = 4*np.random.random()**2 ) self.play(MoveToTarget(edge_group)) - self.dither() + self.wait() self.learning_word = word @@ -799,9 +799,9 @@ class LayOutPlan(TeacherStudentsScene, NetworkScene): FadeIn(structure), self.get_student_changes(*["pondering"]*3) ) - self.dither() + self.wait() self.play(DrawBorderThenFill(videos[1])) - self.dither() + self.wait() class PreviewMNistNetwork(NetworkScene): CONFIG = { @@ -897,18 +897,18 @@ class AlternateNeuralNetworks(PiCreatureScene): Write(examples[0], run_time = 2), morty.change, "raise_right_hand" ) - self.dither() + self.wait() self.play( examples[0].shift, MED_LARGE_BUFF*UP, FadeIn(examples[1], submobject_mode = "lagged_start"), ) - self.dither() + self.wait() self.play( examples.shift, UP, FadeIn(maybe_words), morty.change, "maybe" ) - self.dither(2) + self.wait(2) class PlainVanillaWrapper(Scene): def construct(self): @@ -919,9 +919,9 @@ class PlainVanillaWrapper(Scene): subtitle.next_to(title, DOWN) self.add(title) - self.dither(2) + self.wait(2) self.play(Write(subtitle, run_time = 2)) - self.dither(2) + self.wait(2) class NotPerfectAddOn(Scene): def construct(self): @@ -937,7 +937,7 @@ class NotPerfectAddOn(Scene): ShowCreation(arrow), run_time = 1 ) - self.dither(2) + self.wait(2) class MoreAThanI(TeacherStudentsScene): def construct(self): @@ -946,7 +946,7 @@ class MoreAThanI(TeacherStudentsScene): target_mode = "hesitant" ) self.change_student_modes("sad", "erm", "tired") - self.dither(2) + self.wait(2) class BreakDownName(Scene): def construct(self): @@ -992,7 +992,7 @@ class BreakDownName(Scene): ) ) self.play(Blink(randy)) - self.dither() + self.wait() self.play( Write(q1, run_time = 1), ShowCreation(a1), @@ -1003,7 +1003,7 @@ class BreakDownName(Scene): ShowCreation(a2), name[1].highlight, q2.get_color() ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ name, randy, brain, @@ -1040,12 +1040,12 @@ class BreakDownName(Scene): ShowCreation(arrow), Write(description, run_time = 1) ) - self.dither() + self.wait() self.play( neuron.set_fill, None, 0.2, num.restore ) - self.dither() + self.wait() for value in 0.8, 0.4, 0.1, 0.5: mob = TexMobject(str(value)) mob.replace(num) @@ -1053,7 +1053,7 @@ class BreakDownName(Scene): neuron.set_fill, None, value, Transform(num, mob) ) - self.dither() + self.wait() class IntroduceEachLayer(PreviewMNistNetwork): CONFIG = { @@ -1113,14 +1113,14 @@ class IntroduceEachLayer(PreviewMNistNetwork): self.corner_image.to_corner(UP+LEFT) self.add(image_mob, rect) - self.dither() + self.wait() self.play( ReplacementTransform(image_mob, neurons), FadeOut(rect), FadeIn(braces), FadeIn(labels), ) - self.dither() + self.wait() self.play( ReplacementTransform(labels[0].copy(), equation[0]), Write(equation[1]), @@ -1128,7 +1128,7 @@ class IntroduceEachLayer(PreviewMNistNetwork): Write(equation[3]), Write(equation[4]), ) - self.dither() + self.wait() self.neurons = neurons self.braces = braces @@ -1182,11 +1182,11 @@ class IntroduceEachLayer(PreviewMNistNetwork): MoveToTarget(example_neuron), MoveToTarget(example_num) ) - self.dither() + self.wait() curr_opacity = example_neuron.get_fill_opacity() for num in 0.3, 0.01, 1.0, curr_opacity: change_activation(num) - self.dither() + self.wait() rect = SurroundingRectangle(example_num, color = YELLOW) activation = TextMobject("``Activation''") @@ -1194,11 +1194,11 @@ class IntroduceEachLayer(PreviewMNistNetwork): activation.highlight(rect.get_color()) self.play(ShowCreation(rect)) self.play(Write(activation, run_time = 1)) - self.dither() + self.wait() change_activation(1.0) - self.dither() + self.wait() change_activation(0.2) - self.dither() + self.wait() self.play( example_neuron.restore, @@ -1257,13 +1257,13 @@ class IntroduceEachLayer(PreviewMNistNetwork): FadeIn(layer.brace), ) self.play(layer.restore, FadeIn(self.corner_image)) - self.dither() + self.wait() for edge_group, layer in zip(network_mob.edge_groups, network_mob.layers[1:]): self.play( LaggedStart(FadeIn, layer, run_time = 1), ShowCreation(edge_group), ) - self.dither() + self.wait() def show_output_layer(self): layer = self.network_mob.layers[-1] @@ -1302,7 +1302,7 @@ class IntroduceEachLayer(PreviewMNistNetwork): self.play(ShowCreation(rect)) self.play(LaggedStart(FadeIn, labels)) - self.dither() + self.wait() self.play( MoveToTarget(neuron), MoveToTarget(label), @@ -1310,7 +1310,7 @@ class IntroduceEachLayer(PreviewMNistNetwork): self.play(FadeIn(activation)) for num in 0.5, 0.38, 0.97: change_activation(num) - self.dither() + self.wait() self.play( neuron.restore, neuron.set_fill, None, 1, @@ -1318,7 +1318,7 @@ class IntroduceEachLayer(PreviewMNistNetwork): FadeOut(activation), FadeOut(rect), ) - self.dither() + self.wait() def show_hidden_layers(self): hidden_layers = VGroup(*self.network_mob.layers[1:3]) @@ -1343,9 +1343,9 @@ class IntroduceEachLayer(PreviewMNistNetwork): ShowCreation(rect), Write(name) ) - self.dither() + self.wait() self.play(Write(q_marks)) - self.dither() + self.wait() self.play( FadeOut(q_marks), Animation(q_marks[-1].copy()) @@ -1388,16 +1388,16 @@ class DiscussChoiceForHiddenLayers(TeacherStudentsScene): Write(two_words, run_time = 1), self.teacher.change, "raise_right_hand", ) - self.dither() + self.wait() self.play( FadeOut(rects), ReplacementTransform(two_words, sixteen_words), neurons_anim ) - self.dither() + self.wait() self.play(self.teacher.change, "shruggie") self.change_student_modes("erm", "confused", "sassy") - self.dither() + self.wait() self.student_says( "Why 2 \\\\ layers?", student_index = 1, @@ -1406,7 +1406,7 @@ class DiscussChoiceForHiddenLayers(TeacherStudentsScene): target_mode = "raise_left_hand", ) self.play(self.teacher.change, "happy") - self.dither() + self.wait() self.student_says( "Why 16?", student_index = 0, @@ -1417,7 +1417,7 @@ class DiscussChoiceForHiddenLayers(TeacherStudentsScene): self.teacher.change, "shruggie", RemovePiCreatureBubble(self.students[0]), ) - self.dither() + self.wait() class MoreHonestMNistNetworkPreview(IntroduceEachLayer): CONFIG = { @@ -1465,13 +1465,13 @@ class AskAboutPropogationAndTraining(TeacherStudentsScene): student_index = 0, run_time = 1 ) - self.dither() + self.wait() self.student_says( "How does \\\\ training work?", student_index = 2, run_time = 1 ) - self.dither(3) + self.wait(3) class AskAboutLayers(PreviewMNistNetwork): def construct(self): @@ -1503,9 +1503,9 @@ class AskAboutLayers(PreviewMNistNetwork): run_time = 2 ) ) - self.dither() + self.wait() self.play(*map(ShowCreation, rects)) - self.dither() + self.wait() class BreakUpMacroPatterns(IntroduceEachLayer): CONFIG = { @@ -1578,21 +1578,21 @@ class BreakUpMacroPatterns(IntroduceEachLayer): right_line[1].pixel_array[:14,:,3] = 0 self.play(FadeIn(nine)) - self.dither() + self.wait() self.play(*map(FadeIn, parts)) - self.dither() + self.wait() self.play( Write(equation[1]), upper_loop[1].restore, FadeIn(upper_loop[0]) ) - self.dither() + self.wait() self.play( Write(equation[3]), right_line[1].restore, FadeIn(right_line[0]), ) - self.dither() + self.wait() self.nine_equation = equation @@ -1616,14 +1616,14 @@ class BreakUpMacroPatterns(IntroduceEachLayer): self.upper_loop.copy(), upper_loop )) - self.dither() + self.wait() self.play(FadeIn(lower_loop[1])) self.play( Write(equation[3]), lower_loop[1].restore, FadeIn(lower_loop[0]), ) - self.dither() + self.wait() self.eight_equation = equation @@ -1649,7 +1649,7 @@ class BreakUpMacroPatterns(IntroduceEachLayer): self.play(LaggedStart( FadeIn, VGroup(*equation[3:]) )) - self.dither(2) + self.wait(2) self.four_equation = equation @@ -1690,7 +1690,7 @@ class BreakUpMacroPatterns(IntroduceEachLayer): ), MoveToTarget(patterns) ) - self.dither(2) + self.wait(2) self.patterns = patterns @@ -1724,7 +1724,7 @@ class BreakUpMacroPatterns(IntroduceEachLayer): ) self.add_foreground_mobject(self.patterns) self.feed_forward(np.random.random(784)) - self.dither(2) + self.wait(2) def show_what_learning_is_required(self): edge_group = self.network_mob.edge_groups[-1].copy() @@ -1734,7 +1734,7 @@ class BreakUpMacroPatterns(IntroduceEachLayer): ShowCreationThenDestruction, edge_group, run_time = 3 )) - self.dither() + self.wait() ###### @@ -1770,7 +1770,7 @@ class GenerallyLoopyPattern(Scene): for image in images: image.to_corner(DOWN+RIGHT) self.add(image) - self.dither(0.2) + self.wait(0.2) self.remove(image) class HowWouldYouRecognizeSubcomponent(TeacherStudentsScene): @@ -1783,7 +1783,7 @@ class HowWouldYouRecognizeSubcomponent(TeacherStudentsScene): self.play( self.teacher.change, "guilty" ) - self.dither() + self.wait() class BreakUpMicroPatterns(BreakUpMacroPatterns): CONFIG = { @@ -1838,20 +1838,20 @@ class BreakUpMicroPatterns(BreakUpMacroPatterns): randy.change, "pondering", loop ) self.play(Blink(randy)) - self.dither() + self.wait() self.play(LaggedStart( ApplyMethod, edges, lambda e : (e.restore,), run_time = 4 )) - self.dither() + self.wait() self.play( MoveToTarget(loop, run_time = 2), MoveToTarget(edges, run_time = 2), Write(symbols), randy.change, "happy", equation, ) - self.dither() + self.wait() self.loop_equation = equation self.randy = randy @@ -1888,12 +1888,12 @@ class BreakUpMicroPatterns(BreakUpMacroPatterns): ) self.play(Blink(randy)) self.play(LaggedStart(FadeIn, digits)) - self.dither() + self.wait() self.play( LaggedStart(FadeIn, Group(*equation[1:])), randy.change, "pondering", equation ) - self.dither(3) + self.wait(3) class SecondLayerIsLittleEdgeLayer(IntroduceEachLayer): CONFIG = { @@ -1984,7 +1984,7 @@ class SecondLayerIsLittleEdgeLayer(IntroduceEachLayer): ShowCreation(rect), Write(words, run_time = 2) ) - self.dither() + self.wait() self.play(*map(FadeOut, [rect, words])) def show_propogation(self): @@ -2051,14 +2051,14 @@ class SecondLayerIsLittleEdgeLayer(IntroduceEachLayer): activate_layer(1) self.play(edge_colored_nine.restore) self.separate_parts(edge_colored_nine) - self.dither() + self.wait() activate_layer(2) self.play(pattern_colored_nine.restore) self.separate_parts(pattern_colored_nine) activate_layer(3) - self.dither(2) + self.wait(2) def ask_question(self): question = TextMobject( @@ -2072,12 +2072,12 @@ class SecondLayerIsLittleEdgeLayer(IntroduceEachLayer): arrow.highlight(BLUE) self.play(Write(question, run_time = 2)) - self.dither() + self.wait() self.play( FadeIn(later), GrowFromPoint(arrow, arrow.get_start()) ) - self.dither() + self.wait() ### @@ -2125,7 +2125,7 @@ class EdgeDetection(Scene): self.play(FadeIn(lion)) self.play(lion_copy.move_to, edges) self.play(Transform(lion_copy, edges, run_time = 3)) - self.dither(2) + self.wait(2) class ManyTasksBreakDownLikeThis(TeacherStudentsScene): def construct(self): @@ -2164,7 +2164,7 @@ class ManyTasksBreakDownLikeThis(TeacherStudentsScene): "break down like this" ) self.change_student_modes(*["pondering"]*3) - self.dither() + self.wait() content = self.teacher.bubble.content pre_word = content[1] content.remove(pre_word) @@ -2174,7 +2174,7 @@ class ManyTasksBreakDownLikeThis(TeacherStudentsScene): ShowCreation(audio), pre_word.shift, MED_SMALL_BUFF, DOWN ) - self.dither(2) + self.wait(2) self.play( RemovePiCreatureBubble(self.teacher), audio.restore, @@ -2189,17 +2189,17 @@ class ManyTasksBreakDownLikeThis(TeacherStudentsScene): self.play( GrowFromPoint(arrows[0], arrows[0].get_start()), ) - self.dither() + self.wait() self.play( GrowFromPoint(arrows[1], arrows[1].get_start()), LaggedStart(FadeIn, syllables, run_time = 1) ) - self.dither() + self.wait() self.play( GrowFromPoint(arrows[2], arrows[2].get_start()), LaggedStart(FadeIn, word, run_time = 1) ) - self.dither() + self.wait() def get_wave_form(self): func = lambda x : abs(sum([ @@ -2254,7 +2254,7 @@ class AskAboutWhatEdgesAreDoing(IntroduceEachLayer): self.add(image) self.feed_forward(in_vect) - self.dither() + self.wait() class IntroduceWeights(IntroduceEachLayer): CONFIG = { @@ -2318,7 +2318,7 @@ class IntroduceWeights(IntroduceEachLayer): submobject_mode = "lagged_start", run_time = 2 ) - self.dither(2) + self.wait(2) self.pixels = pixels self.pixels_to_detect = pixels_to_detect @@ -2379,7 +2379,7 @@ class IntroduceWeights(IntroduceEachLayer): LaggedStart(FadeIn, p_labels), LaggedStart(FadeIn, decimals), ) - self.dither() + self.wait() self.play( *changing_decimals + pixel_updates, run_time = 5, @@ -2441,7 +2441,7 @@ class IntroduceWeights(IntroduceEachLayer): rate_func = wiggle, run_time = 2 )) - self.dither() + self.wait() self.w_labels = w_labels self.weights_word = weights_word @@ -2498,7 +2498,7 @@ class IntroduceWeights(IntroduceEachLayer): ], run_time = 1.5 ) - self.dither() + self.wait() self.play(*[ ReplacementTransform(w1.copy(), w2) for w1, w2 in zip(self.w_labels, w_labels)[:4] @@ -2510,7 +2510,7 @@ class IntroduceWeights(IntroduceEachLayer): self.w_labels[-1].copy(), weighted_sum[-2] ) ], run_time = 2) - self.dither(2) + self.wait(2) self.weighted_sum = weighted_sum @@ -2545,7 +2545,7 @@ class IntroduceWeights(IntroduceEachLayer): for decimal, pixel in zip(decimals, weight_grid) ] ) - self.dither() + self.wait() self.weight_grid = weight_grid @@ -2570,15 +2570,15 @@ class IntroduceWeights(IntroduceEachLayer): run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play(Transform( pixels, digit, run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play(weight_grid.move_to, pixels) - self.dither() + self.wait() self.play( ReplacementTransform( self.pixels_to_detect.copy(), @@ -2588,7 +2588,7 @@ class IntroduceWeights(IntroduceEachLayer): ), Animation(weight_grid), ) - self.dither() + self.wait() def add_negative_weights_around_the_edge(self): weight_grid = self.weight_grid @@ -2604,9 +2604,9 @@ class IntroduceWeights(IntroduceEachLayer): for y in 6, 10 for x in range(14-4, 14+4) ]) - self.dither(2) + self.wait(2) self.play(weight_grid.move_to, pixels) - self.dither(2) + self.wait(2) #### @@ -2704,7 +2704,7 @@ class MotivateSquishing(Scene): GrowFromCenter(interval), ) self.play(Write(words, run_time = 2)) - self.dither() + self.wait() self.lower_number_line = lower_number_line @@ -2734,7 +2734,7 @@ class MotivateSquishing(Scene): MoveToTarget(line), GrowFromPoint(arrow, arrow.get_start()) ) - self.dither(2) + self.wait(2) class IntroduceSigmoid(GraphScene): CONFIG = { @@ -2777,7 +2777,7 @@ class IntroduceSigmoid(GraphScene): ) self.play(ShowCreation(graph)) - self.dither() + self.wait() self.sigmoid_graph = graph @@ -2795,9 +2795,9 @@ class IntroduceSigmoid(GraphScene): ] self.play(ShowCreation(line)) - self.dither() + self.wait() self.play(Transform(line, graph_part)) - self.dither() + self.wait() class IncludeBias(IntroduceWeights): def construct(self): @@ -2878,12 +2878,12 @@ class IncludeBias(IntroduceWeights): FadeIn(activation_word), neuron.set_fill, WHITE, 0.8, ) - self.dither() + self.wait() self.play( GrowArrow(arrow), ReplacementTransform(activation_word, words), ) - self.dither(2) + self.wait(2) self.play(FadeOut(arrow)) self.how_positive_words = words @@ -2910,7 +2910,7 @@ class IncludeBias(IntroduceWeights): run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.gt_ten = words[-1] @@ -2934,12 +2934,12 @@ class IncludeBias(IntroduceWeights): ), MoveToTarget(rp), ) - self.dither(2) + self.wait(2) self.play( ShowCreation(rect), Write(name) ) - self.dither(2) + self.wait(2) self.bias_name = name @@ -2957,9 +2957,9 @@ class IncludeBias(IntroduceWeights): lag_ratio = 0.4, run_time = 4 )) - self.dither() + self.wait() self.play(Indicate(bias_name)) - self.dither(2) + self.wait(2) ### @@ -2985,7 +2985,7 @@ class BiasForInactiviyWords(Scene): words.to_edge(UP) self.play(Write(words)) - self.dither(3) + self.wait(3) class ContinualEdgeUpdate(ContinualAnimation): CONFIG = { @@ -3086,7 +3086,7 @@ class ShowRemainingNetwork(IntroduceWeights): ), VGroup(*last_edges[1:]).set_stroke, None, 1 ) - self.dither() + self.wait() self.weights_words = words @@ -3111,7 +3111,7 @@ class ShowRemainingNetwork(IntroduceWeights): lag_ratio = 0.3, ) ) - self.dither() + self.wait() self.bias_words = words self.bias_arrows = arrows @@ -3134,7 +3134,7 @@ class ShowRemainingNetwork(IntroduceWeights): MoveToTarget(ww2), FadeOut(ww3) ) - self.dither() + self.wait() self.play( ReplacementTransform(times_16.copy(), bias_count[0]), FadeOut(bb1), @@ -3142,7 +3142,7 @@ class ShowRemainingNetwork(IntroduceWeights): FadeOut(bb3), LaggedStart(FadeOut, bias_arrows) ) - self.dither() + self.wait() self.weights_count = VGroup(ww1, times_16, ww2) self.bias_count = bias_count @@ -3192,7 +3192,7 @@ class ShowRemainingNetwork(IntroduceWeights): lag_ratio = 0.3, ) ) - self.dither(2) + self.wait(2) weights_count.add(added_weights) bias_count.add(added_biases) @@ -3214,7 +3214,7 @@ class ShowRemainingNetwork(IntroduceWeights): MoveToTarget(group), ) self.play(Write(num_mob)) - self.dither() + self.wait() self.final_number = num_mob @@ -3229,9 +3229,9 @@ class ShowRemainingNetwork(IntroduceWeights): group.next_to(self.final_number, DOWN, MED_LARGE_BUFF) self.add(ContinualEdgeUpdate(self.network_mob)) - self.dither(5) + self.wait(5) self.play(Write(group)) - self.dither(10) + self.wait(10) ### @@ -3269,12 +3269,12 @@ class ImagineSettingByHand(Scene): self.add(randy, bubble, network_mob) self.add(ContinualEdgeUpdate(network_mob)) self.play(randy.change, "pondering") - self.dither() + self.wait() self.play(Blink(randy)) - self.dither() + self.wait() self.play(randy.change, "horrified", network_mob) self.play(Blink(randy)) - self.dither(10) + self.wait(10) class WhenTheNetworkFails(MoreHonestMNistNetworkPreview): CONFIG = { @@ -3306,7 +3306,7 @@ class WhenTheNetworkFails(MoreHonestMNistNetworkPreview): Write(words, run_time = 2), DrawBorderThenFill(box) ) - self.dither() + self.wait() self.play(*map(FadeOut, [words, box])) def incorrect_classification(self): @@ -3332,7 +3332,7 @@ class WhenTheNetworkFails(MoreHonestMNistNetworkPreview): self.add(ContinualEdgeUpdate(self.network_mob)) self.play(Write(question)) - self.dither(10) + self.wait(10) ### @@ -3347,7 +3347,7 @@ class EvenWhenItWorks(TeacherStudentsScene): "dig into why." ) self.change_student_modes(*["pondering"]*3) - self.dither(7) + self.wait(7) class IntroduceWeightMatrix(NetworkScene): CONFIG = { @@ -3569,12 +3569,12 @@ class IntroduceWeightMatrix(NetworkScene): Transform(pre_brackets, post_bracketes), run_time = 2 ) - self.dither() + self.wait() self.play(*[ LaggedStart(Indicate, mob, rate_func = there_and_back) for mob in a_labels, a_labels_in_sum ]) - self.dither() + self.wait() self.a_column = a_labels self.a_column_brackets = pre_brackets @@ -3629,7 +3629,7 @@ class IntroduceWeightMatrix(NetworkScene): run_time = 3, submobject_mode = "lagged_start", )) - self.dither() + self.wait() self.top_matrix_row = w_labels self.lower_matrix_rows = lower_rows @@ -3647,7 +3647,7 @@ class IntroduceWeightMatrix(NetworkScene): ShowCreationThenDestruction, edges, lag_ratio = 0.8 )) - self.dither() + self.wait() self.top_row_rect = rect @@ -3697,7 +3697,7 @@ class IntroduceWeightMatrix(NetworkScene): self.play(LaggedStart( FadeIn, VGroup(*result_terms[1:]) )) - self.dither(2) + self.wait(2) self.show_meaning_of_lower_rows( arrow, brace, top_row_rect, result_terms ) @@ -3788,7 +3788,7 @@ class IntroduceWeightMatrix(NetworkScene): self.play(LaggedStart( FadeIn, VGroup(*b_column[1:]) )) - self.dither() + self.wait() self.bias_plus = plus self.b_brackets = b_brackets @@ -3814,7 +3814,7 @@ class IntroduceWeightMatrix(NetworkScene): Transform(slp, big_lp), Transform(srp, big_rp), ) - self.dither(2) + self.wait(2) self.big_sigma_group = VGroup(VGroup(sigma), slp, srp) @@ -3876,13 +3876,13 @@ class IntroduceWeightMatrix(NetworkScene): self.big_sigma_group.copy(), VGroup(sigma, lp, rp) )) - self.dither() + self.wait() self.play(*neuron_anims, run_time = 2) self.play( ReplacementTransform(neurons.copy(), a1), FadeIn(equals) ) - self.dither(2) + self.wait(2) def fade_weighted_sum(self): self.play(*map(FadeOut, [ @@ -3916,7 +3916,7 @@ class HorrifiedMorty(Scene): morty.look, UP, ) self.play(Blink(morty)) - self.dither(2) + self.wait(2) class SigmoidAppliedToVector(Scene): def construct(self): @@ -3941,7 +3941,7 @@ class SigmoidAppliedToVector(Scene): for i in indices: tex[i].highlight(YELLOW) self.add(tex) - self.dither() + self.wait() class EoLA3Wrapper(PiCreatureScene): def construct(self): @@ -3957,7 +3957,7 @@ class EoLA3Wrapper(PiCreatureScene): FadeIn(title), morty.change, "raise_right_hand", rect ) - self.dither(4) + self.wait(4) class FeedForwardCode(ExternallyAnimatedScene): pass @@ -3978,7 +3978,7 @@ class NeuronIsFunction(MoreHonestMNistNetworkPreview): self.fade_network_back_in() self.network_is_a_function() self.feed_in_new_image(9, 4) - self.dither(2) + self.wait(2) def setup_network_mob(self): @@ -4029,7 +4029,7 @@ class NeuronIsFunction(MoreHonestMNistNetworkPreview): rate_func = squish_rate_func(smooth, 0.3, 1) ) ) - self.dither() + self.wait() self.play(neuron_group.restore) self.neuron_word = neuron_word @@ -4064,7 +4064,7 @@ class NeuronIsFunction(MoreHonestMNistNetworkPreview): FadeIn(function_word), VGroup(thing_words, cross).to_edge, DOWN, ) - self.dither() + self.wait() self.function_word = function_word @@ -4090,7 +4090,7 @@ class NeuronIsFunction(MoreHonestMNistNetworkPreview): GrowArrow(arrow), Transform(self.decimal, decimal) ) - self.dither(2) + self.wait(2) self.non_faded_network_parts = VGroup( neuron, edges, prev_layer @@ -4154,7 +4154,7 @@ class ComplicationIsReassuring(TeacherStudentsScene): student_index = 0 ) self.play(self.teacher.change, "happy") - self.dither(4) + self.wait(4) class NextVideo(MoreHonestMNistNetworkPreview, PiCreatureScene): CONFIG = { @@ -4200,10 +4200,10 @@ class NextVideo(MoreHonestMNistNetworkPreview, PiCreatureScene): self.add(edge_update) self.play(morty.change, "confused", network_mob) - self.dither(2) + self.wait(2) for data_mob in data_mobs: self.add(data_mob) - self.dither(0.2) + self.wait(0.2) self.remove(data_mob) self.content = network_mob @@ -4235,9 +4235,9 @@ class NextVideo(MoreHonestMNistNetworkPreview, PiCreatureScene): FadeIn(video), ) self.add_foreground_mobjects(rect, video) - self.dither(2) + self.wait(2) self.play(Write(words)) - self.dither(2) + self.wait(2) self.video = Group(content, rect, video, words) @@ -4271,10 +4271,10 @@ class NextVideo(MoreHonestMNistNetworkPreview, PiCreatureScene): MoveToTarget(morty), ) self.play(GrowArrow(arrow)) - self.dither(2) + self.wait(2) self.play(morty.change, "maybe", arrow) self.play(Transform(bang, q_mark)) - self.dither(3) + self.wait(3) def show_video_neural_network(self): morty = self.pi_creature @@ -4313,7 +4313,7 @@ class NextVideo(MoreHonestMNistNetworkPreview, PiCreatureScene): run_time = 3 )) self.play(morty.change, "shruggie") - self.dither(10) + self.wait(10) ### @@ -4379,9 +4379,9 @@ class NNPatreonThanks(PatreonThanks): class PiCreatureGesture(PiCreatureScene): def construct(self): self.play(self.pi_creature.change, "raise_right_hand") - self.dither(5) + self.wait(5) self.play(self.pi_creature.change, "happy") - self.dither(4) + self.wait(4) class IntroduceReLU(IntroduceSigmoid): CONFIG = { @@ -4416,7 +4416,7 @@ class IntroduceReLU(IntroduceSigmoid): Write(old_school, run_time = 1), GrowArrow(arrow) ) - self.dither(2) + self.wait(2) self.play( ApplyMethod( VGroup(cross, sigmoid_title).shift, @@ -4455,12 +4455,12 @@ class IntroduceReLU(IntroduceSigmoid): self.play(Write(equation)) self.play(ShowCreation(graph), Animation(equation)) - self.dither(2) + self.wait(2) self.play( Write(name), equation.shift, DOWN ) - self.dither(2) + self.wait(2) self.ReLU_graph = graph @@ -4480,10 +4480,10 @@ class IntroduceReLU(IntroduceSigmoid): self.revert_to_original_skipping_status() self.play(ShowCreation(l1.copy().highlight(RED))) self.play(Write(neg_words)) - self.dither() + self.wait() self.play(ShowCreation(l2.copy().highlight(GREEN))) self.play(Write(pos_words)) - self.dither(2) + self.wait(2) class CompareSigmoidReLUOnDeepNetworks(PiCreatureScene): def construct(self): @@ -4539,7 +4539,7 @@ class CompareSigmoidReLUOnDeepNetworks(PiCreatureScene): Write(slow_learner, run_time = 1), GrowArrow(slow_arrow) ) - self.dither() + self.wait() self.play( FadeIn(relu_name), ShowCreation(relu_graph), @@ -4548,7 +4548,7 @@ class CompareSigmoidReLUOnDeepNetworks(PiCreatureScene): ) self.play(FadeIn(network_mob)) self.add(edge_update) - self.dither(10) + self.wait(10) @@ -4574,10 +4574,10 @@ class ShowAmplify(PiCreatureScene): ShowCreation(rect), morty.change, "raise_right_hand" ) - self.dither(2) + self.wait(2) self.play(Write(email)) self.play(morty.change, "happy", rect) - self.dither(10) + self.wait(10) class Thumbnail(NetworkScene): CONFIG = { diff --git a/nn/part2.py b/nn/part2.py index c6f75105..bde9e1ad 100644 --- a/nn/part2.py +++ b/nn/part2.py @@ -116,7 +116,7 @@ class ShowLastVideo(TeacherStudentsScene): GrowArrow(arrow), FadeIn(assumption_words) ) - self.dither(5) + self.wait(5) class ShowPlan(Scene): def construct(self): @@ -143,7 +143,7 @@ class ShowPlan(Scene): rect = SurroundingRectangle(VGroup(*items[1:3])) self.add(items) - self.dither() + self.wait() self.play(ShowCreation(rect)) self.play(FadeOut(rect)) for item in items[1:]: @@ -152,7 +152,7 @@ class ShowPlan(Scene): to_fade.set_fill, None, 0.5, item.set_fill, None, 1, ) - self.dither() + self.wait() class BeginAndEndRecap(Scene): def construct(self): @@ -165,9 +165,9 @@ class BeginAndEndRecap(Scene): new_langle.move_to(recap[0], RIGHT) self.add(recap) - self.dither(2) + self.wait(2) self.play(Transform(recap[0], new_langle)) - self.dither(2) + self.wait(2) class PreviewLearning(NetworkScene): CONFIG = { @@ -430,14 +430,14 @@ class TrainingVsTestData(Scene): GrowFromCenter(train_brace), FadeIn(train_words) ) - self.dither() + self.wait() self.play( MoveToTarget(test_examples), GrowFromCenter(test_brace), FadeIn(test_words) ) self.play(Write(marks)) - self.dither() + self.wait() def scroll_through_much_data(self): training_examples = self.training_examples @@ -449,7 +449,7 @@ class TrainingVsTestData(Scene): self.remove(train_ex) self.add(new_ex) new_ex[0][0].highlight(color) - self.dither(1./30) + self.wait(1./30) training_examples = new_examples class MNistDescription(Scene): @@ -480,7 +480,7 @@ class MNistDescription(Scene): Write(link_words, run_time = 2), LaggedStart(GrowArrow, arrows), ) - self.dither() + self.wait() training_data, validation_data, test_data = load_data_wrapper() epc = self.n_rows_per_grid*self.n_cols_per_grid @@ -513,7 +513,7 @@ class MNistDescription(Scene): self.remove(t1) self.add(t2) if time > self.frame_duration: - self.dither(self.frame_duration) + self.wait(self.frame_duration) time = 0 last_group = group @@ -549,14 +549,14 @@ class NotSciFi(TeacherStudentsScene): bubble_kwargs = {"direction" : LEFT}, run_time = 1, ) - self.dither() + self.wait() students[0].bubble = bubble self.teacher_says( "It's actually \\\\ just calculus.", run_time = 1 ) self.teacher.bubble = None - self.dither() + self.wait() self.student_says( "Even worse!", target_mode = "horrified", @@ -566,7 +566,7 @@ class NotSciFi(TeacherStudentsScene): "height" : 2, }, ) - self.dither(2) + self.wait(2) class FunctionMinmization(GraphScene): CONFIG = { @@ -601,7 +601,7 @@ class FunctionMinmization(GraphScene): ContinualUpdateFromFunc(dot, update_dot) for dot in dots ]) - self.dither(10) + self.wait(10) class ChangingDecimalWithColor(ChangingDecimal): def update_mobject(self, alpha): @@ -737,7 +737,7 @@ class IntroduceCostFunction(PreviewLearning): *map(GrowArrow, weights_arrow_to_syms), run_time = 1 ) - self.dither() + self.wait() self.play( ReplacementTransform( w_labels.copy(), weighted_edges, @@ -749,13 +749,13 @@ class IntroduceCostFunction(PreviewLearning): VGroup(weights_arrow_to_edges), ) ) - self.dither() + self.wait() self.play( Write(bias_word), GrowArrow(bias_arrow), run_time = 1 ) - self.dither(2) + self.wait(2) ## Initialize randomly w_random = TextMobject("Initialize randomly") @@ -864,7 +864,7 @@ class IntroduceCostFunction(PreviewLearning): ShowCreation(rect), Write(words, run_time = 2) ) - self.dither() + self.wait() self.trash_rect = rect self.trash_words = words @@ -896,7 +896,7 @@ class IntroduceCostFunction(PreviewLearning): self.play(FadeIn(words)) self.play(ReplacementTransform(layer.copy(), desired_layer)) self.play(GrowFromCenter(double_arrow)) - self.dither(2) + self.wait(2) self.desired_last_layer = desired_layer self.diff_arrow = double_arrow @@ -962,7 +962,7 @@ class IntroduceCostFunction(PreviewLearning): FadeIn(cost_of), GrowFromCenter(brace), ) - self.dither() + self.wait() self.decimal_groups = decimal_groups self.image_group = image_group @@ -1046,9 +1046,9 @@ class IntroduceCostFunction(PreviewLearning): for neuron, t in zip(neurons, target_vect) ] )) - self.dither() + self.wait() self.play(LaggedStart(Indicate, decimals, rate_func = there_and_back)) - self.dither() + self.wait() for update in update_decimals: update.rate_func = lambda a : smooth(1-a) self.play(*it.chain( @@ -1056,7 +1056,7 @@ class IntroduceCostFunction(PreviewLearning): term_updates, [neurons.restore] ), run_time = 2) - self.dither() + self.wait() self.play( cost_group.restore, brace.restore, @@ -1070,7 +1070,7 @@ class IntroduceCostFunction(PreviewLearning): random_neurons = self.network_mob.layers[-1].neurons desired_neurons = self.desired_last_layer.neurons - dither_times = iter(it.chain( + wait_times = iter(it.chain( 4*[0.5], 4*[0.25], 8*[0.125], @@ -1107,7 +1107,7 @@ class IntroduceCostFunction(PreviewLearning): self.add(new_image_group) image_group = new_image_group - self.dither(dither_times.next()) + self.wait(wait_times.next()) #### @@ -1205,7 +1205,7 @@ class YellAtNetwork(PiCreatureScene, PreviewLearning): ) self.play(ShowCreation(rect)) layer_copy.add(rect) - self.dither() + self.wait() self.play( layer.copy().replace, layer_copy, 1, Write(q_marks, run_time = 1), @@ -1213,7 +1213,7 @@ class YellAtNetwork(PiCreatureScene, PreviewLearning): randy.change, "angry", eyes, ) self.play(eyes.look_at_anim(3*RIGHT + 3*RIGHT)) - self.dither() + self.wait() #### @@ -1239,7 +1239,7 @@ class ThisIsVeryComplicated(TeacherStudentsScene): run_time = 1, ) self.change_student_modes(*3*["guilty"]) - self.dither(2) + self.wait(2) class EmphasizeComplexityOfCostFunction(IntroduceCostFunction): CONFIG = { @@ -1310,12 +1310,12 @@ class EmphasizeComplexityOfCostFunction(IntroduceCostFunction): FadeIn(output), FadeIn(output_words[1]) ) - self.dither() + self.wait() self.play( FadeIn(parameter_words[1]), self.get_edge_animation() ) - self.dither(2) + self.wait(2) self.to_fade = group self.curr_words = words @@ -1380,18 +1380,18 @@ class EmphasizeComplexityOfCostFunction(IntroduceCostFunction): ), self.get_edge_animation() ) - self.dither() + self.wait() self.play( GrowArrow(arrow), Write(cost, run_time = 1) ) self.play(Write(new_output_word, run_time = 1)) - self.dither() + self.wait() self.play( FadeIn(new_parameter_word), FadeIn(training_examples[0]) ) - self.dither(0.5) + self.wait(0.5) for last_ex, ex in zip(training_examples, training_examples[1:]): activations = self.network.get_activation_of_all_layers( ex.in_vect @@ -1402,7 +1402,7 @@ class EmphasizeComplexityOfCostFunction(IntroduceCostFunction): Transform(layer, active_layer).update(1) self.remove(last_ex) self.add(ex) - self.dither(0.25) + self.wait(0.25) #### @@ -1458,14 +1458,14 @@ class NetworkGrowthMindset(YellAtNetwork): ), eyes.change_mode_anim("concerned_musician") ) - self.dither() + self.wait() self.add(edge_update) self.pi_creature_says( "But we can do better! \\\\ Growth mindset!", target_mode = "hooray" ) self.play(eyes.change_mode_anim("happy")) - self.dither(3) + self.wait(3) class SingleVariableCostFunction(GraphScene): CONFIG = { @@ -1508,7 +1508,7 @@ class SingleVariableCostFunction(GraphScene): GrowFromCenter(big_brace), FadeIn(big_brace_text) ) - self.dither() + self.wait() self.play( ReplacementTransform(big_brace, lil_brace), ReplacementTransform(big_brace_text, lil_brace_text), @@ -1541,7 +1541,7 @@ class SingleVariableCostFunction(GraphScene): self.input_to_graph_point(5, graph), RIGHT, ShowCreation(graph) ) - self.dither() + self.wait() self.graph = graph @@ -1575,10 +1575,10 @@ class SingleVariableCostFunction(GraphScene): ) self.play(ShowCreation(line)) self.play(DrawBorderThenFill(dot, run_time = 1)) - self.dither() + self.wait() self.play(Write(formula, run_time = 2)) self.play(GrowArrow(arrow)) - self.dither() + self.wait() self.dot = dot self.line = line @@ -1616,7 +1616,7 @@ class SingleVariableCostFunction(GraphScene): Write(words, run_time = 1), GrowFromCenter(brace) ) - self.dither(2) + self.wait(2) self.play(FadeOut(VGroup(words, brace, deriv_group))) def take_steps(self): @@ -1658,12 +1658,12 @@ class SingleVariableCostFunction(GraphScene): line_update_anim, dot_update_anim, ) - self.dither() + self.wait() self.play(*it.chain( map(GrowArrow, arrows), map(FadeIn, q_marks), )) - self.dither() + self.wait() self.arrow_group = VGroup(arrows, q_marks) self.line_update_anim = line_update_anim @@ -1691,7 +1691,7 @@ class SingleVariableCostFunction(GraphScene): MaintainPositionRelativeTo(arrow_group, w_mob), line_update_anim, dot_update_anim, ) - self.dither() + self.wait() new_x = 0.3 new_point = self.coords_to_point(new_x, 0) @@ -1711,7 +1711,7 @@ class SingleVariableCostFunction(GraphScene): Animation(dot), Animation(arrow_group), ) - self.dither() + self.wait() self.play(VGroup(arrows[0], q_marks).set_fill, None, 0) self.play( w_mob.shift, MED_SMALL_BUFF*RIGHT, @@ -1722,14 +1722,14 @@ class SingleVariableCostFunction(GraphScene): FadeOut(VGroup(new_tangent_line, arrow_group)), Animation(dot), ) - self.dither() + self.wait() for x in 0.8, 1.1, 0.95: self.play( w_mob.next_to, self.coords_to_point(x, 0), DOWN, line_update_anim, dot_update_anim, ) - self.dither() + self.wait() def ball_rolling_down_hill(self): ball = self.dot @@ -1768,7 +1768,7 @@ class SingleVariableCostFunction(GraphScene): UpdateFromFunc(ball, update_ball), run_time = 3, ) - self.dither(2) + self.wait(2) points = [ VectorizedPoint(self.coords_to_point(x, 0)) @@ -1788,7 +1788,7 @@ class SingleVariableCostFunction(GraphScene): self.play(ReplacementTransform(ball, balls)) self.add(*updates) - self.dither(5) + self.wait(5) self.remove(*updates) self.remove(*points) self.play(FadeOut(balls)) @@ -1821,8 +1821,8 @@ class SingleVariableCostFunction(GraphScene): line_update_anim, UpdateFromFunc(line, update_line), ) - self.dither(0.5) - self.dither() + self.wait(0.5) + self.wait() ### @@ -1844,7 +1844,7 @@ class LocalVsGlobal(TeacherStudentsScene): Global minimum = Crazy hard """) self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) class TwoVariableInputSpace(Scene): def construct(self): @@ -1868,7 +1868,7 @@ class TwoVariableInputSpace(Scene): *map(Write, [plane, name, x, y]), run_time = 1 ) - self.dither() + self.wait() self.plane = plane @@ -1898,7 +1898,7 @@ class TwoVariableInputSpace(Scene): FadeIn(question), LaggedStart(GrowArrow, arrows) ) - self.dither() + self.wait() self.arrows = arrows self.dot = dot @@ -1943,7 +1943,7 @@ class TwoVariableInputSpace(Scene): ) self.play(FadeIn(gradient)) self.play(Write(gradient_words, run_time = 2)) - self.dither(2) + self.wait(2) self.play( arrow.fade, ReplacementTransform( @@ -1951,7 +1951,7 @@ class TwoVariableInputSpace(Scene): anti_arrow ) ) - self.dither(2) + self.wait(2) class CostSurface(ExternallyAnimatedScene): pass @@ -1966,9 +1966,9 @@ class KhanAcademyMVCWrapper(PiCreatureScene): ShowCreation(screen), morty.change, "raise_right_hand", ) - self.dither(3) + self.wait(3) self.play(morty.change, "happy", screen) - self.dither(5) + self.wait(5) class KAGradientPreview(ExternallyAnimatedScene): pass @@ -1989,7 +1989,7 @@ class GradientDescentAlgorithm(Scene): for word in words: self.play(Write(word, run_time = 1)) - self.dither() + self.wait() class GradientDescentName(Scene): def construct(self): @@ -1999,7 +1999,7 @@ class GradientDescentName(Scene): words.to_edge(DOWN) self.play(Write(words, run_time = 2)) - self.dither() + self.wait() class ShowFullCostFunctionGradient(PreviewLearning): def construct(self): @@ -2057,7 +2057,7 @@ class ShowFullCostFunctionGradient(PreviewLearning): LaggedStart(FadeIn, words), ) self.play(*map(Write, [lb, rb, lhs]), run_time = 1) - self.dither() + self.wait() self.column_vect = column_vect @@ -2112,7 +2112,7 @@ class ShowFullCostFunctionGradient(PreviewLearning): lambda a : interpolate(od_num, od_num+nd_num, a) ) ) - self.dither() + self.wait() class DotsInsert(Scene): def construct(self): @@ -2162,7 +2162,7 @@ class HowMinimizingCostMeansBetterTrainingPerformance(IntroduceCostFunction): ApplyMethod(neuron.set_fill, WHITE, target_value) for neuron, target_value in zip(neurons, target_values) ], run_time = 3) - self.dither() + self.wait() ### @@ -2179,7 +2179,7 @@ class ConfusedAboutHighDimension(TeacherStudentsScene): target_mode = "confused" ) self.change_student_modes(*["confused"]*3) - self.dither(2) + self.wait(2) self.teacher_thinks( "", bubble_kwargs = {"width" : 6, "height" : 4}, @@ -2267,14 +2267,14 @@ class NonSpatialGradientIntuition(Scene): brace = Brace(grad_vect, RIGHT) words = brace.get_text("Example gradient") - self.dither() + self.wait() self.play( ReplacementTransform(self.top_lhs.copy(), lhs), ReplacementTransform(self.vect.copy(), grad_vect), GrowFromCenter(brace), FadeIn(words) ) - self.dither() + self.wait() self.play(FadeOut(VGroup(brace, words))) self.ws = ws @@ -2308,7 +2308,7 @@ class NonSpatialGradientIntuition(Scene): LaggedStart(MoveToTarget, ws), LaggedStart(FadeIn, direction_phrases) ) - self.dither(2) + self.wait(2) self.direction_phrases = direction_phrases self.ws = ws @@ -2346,7 +2346,7 @@ class NonSpatialGradientIntuition(Scene): self.play(LaggedStart(ShowCreation, rects)) self.play(LaggedStart(MoveToTarget, rects)) - self.dither(2) + self.wait(2) class SomeConnectionsMatterMoreThanOthers(PreviewLearning): def setup(self): @@ -2390,7 +2390,7 @@ class SomeConnectionsMatterMoreThanOthers(PreviewLearning): GrowArrow(arrow), FadeIn(words) ) - self.dither() + self.wait() def show_unimportant_connection(self): color = TEAL @@ -2408,7 +2408,7 @@ class SomeConnectionsMatterMoreThanOthers(PreviewLearning): GrowArrow(arrow), FadeIn(words) ) - self.dither() + self.wait() ### def get_edge(self, i1, i2): @@ -2459,7 +2459,7 @@ class SpinningVectorWithLabel(Scene): ), cd1, cd2, ) - self.dither() + self.wait() class TwoGradientInterpretationsIn2D(Scene): def construct(self): @@ -2497,7 +2497,7 @@ class TwoGradientInterpretationsIn2D(Scene): self.play(Write(func, run_time = 1)) self.play(Write(grad_group, run_time = 2)) - self.dither() + self.wait() self.func = func self.grad = grad @@ -2531,7 +2531,7 @@ class TwoGradientInterpretationsIn2D(Scene): Animation(dot) ) self.play(Write(words)) - self.dither() + self.wait() self.remove(vect) self.vect[1].highlight(vect.get_color()) @@ -2565,12 +2565,12 @@ class TwoGradientInterpretationsIn2D(Scene): Write(x_words, run_time = 2), ShowCreation(x_rect) ) - self.dither() + self.wait() self.play( Write(y_words, run_time = 1), ShowCreation(y_rect) ) - self.dither(2) + self.wait(2) def wiggle_in_neighborhood(self): dot = self.dot @@ -2589,14 +2589,14 @@ class TwoGradientInterpretationsIn2D(Scene): FadeOut(steepest_words), GrowFromCenter(neighborhood) ) - self.dither() + self.wait() for vect in RIGHT, UP, 0.3*(3*RIGHT + UP): self.play( dot.shift, 0.5*vect, rate_func = lambda t : wiggle(t, 4), run_time = 3, ) - self.dither() + self.wait() class ParaboloidGraph(ExternallyAnimatedScene): pass @@ -2684,7 +2684,7 @@ class GradientNudging(PreviewLearning): for x in range(self.n_steps): self.play(self.get_edge_change_anim(edges)) self.play(*self.get_decimal_change_anims(decimals)) - self.dither() + self.wait() ### @@ -2748,10 +2748,10 @@ class BackPropWrapper(PiCreatureScene): ShowCreation(screen) ) self.play(Write(title[0], run_time = 1)) - self.dither() + self.wait() self.play(Write(title[1], run_time = 1)) self.play(morty.change, "happy", screen) - self.dither(5) + self.wait(5) class TODOInsertCostSurfaceSteps(TODOStub): CONFIG = { @@ -2793,7 +2793,7 @@ class ContinuouslyRangingNeuron(PreviewLearning): ), decimal_color_anim ) - self.dither() + self.wait() class AskHowItDoes(TeacherStudentsScene): def construct(self): @@ -2801,13 +2801,13 @@ class AskHowItDoes(TeacherStudentsScene): "How well \\\\ does it do?", student_index = 0 ) - self.dither(5) + self.wait(5) class TestPerformance(PreviewLearning): CONFIG = { "n_examples" : 300, "time_per_example" : 0.1, - "wrong_dither_time" : 0.5, + "wrong_wait_time" : 0.5, "stroke_width_exp" : 2, "decimal_kwargs" : { "num_decimal_points" : 3, @@ -2924,9 +2924,9 @@ class TestPerformance(PreviewLearning): self.add(new_decimal) self.decimal = new_decimal - self.dither(self.time_per_example) + self.wait(self.time_per_example) if not correct: - self.dither(self.wrong_dither_time) + self.wait(self.wrong_wait_time) self.remove(rect, rect_wrong, num_wrong, image, choice_mob) @@ -2978,13 +2978,13 @@ class ReactToPerformance(TeacherStudentsScene): run_time = 1 ) self.change_student_modes(*["hooray"]*3) - self.dither() + self.wait() self.teacher_says(last_words, target_mode = "hesitant") self.change_student_modes( *["pondering"]*3, look_at_arg = self.teacher.bubble ) - self.dither() + self.wait() class NoticeWhereItMessesUp(TeacherStudentsScene): def construct(self): @@ -2992,7 +2992,7 @@ class NoticeWhereItMessesUp(TeacherStudentsScene): "Look where it \\\\ messes up", run_time = 1 ) - self.dither(2) + self.wait(2) class WrongExamples(TestPerformance): CONFIG = { @@ -3027,7 +3027,7 @@ class NotAtAll(TeacherStudentsScene, PreviewLearning): self.teacher.change, "concerned_musician", words[1].highlight, WHITE ) - self.dither(2) + self.wait(2) class InterpretFirstWeightMatrixRows(TestPerformance): CONFIG = { @@ -3103,7 +3103,7 @@ class InterpretFirstWeightMatrixRows(TestPerformance): if edge not in neurons[0].edges_in ] ) - self.dither() + self.wait() last_neuron = None for neuron, pixel_array in zip(neurons, self.pixel_arrays): @@ -3153,7 +3153,7 @@ class InputRandomData(TestPerformance): ) ) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.image = image self.rand_vect = rand_vect @@ -3185,7 +3185,7 @@ class InputRandomData(TestPerformance): MoveToTarget, neurons, run_time = 1 )) - self.dither() + self.wait() self.play(FadeOut(VGroup(words, arrow))) def feed_in_random_data(self): @@ -3225,7 +3225,7 @@ class InputRandomData(TestPerformance): self.play(ShowCreation(rect)) self.play(Write(word, run_time = 1)) - self.dither() + self.wait() self.network_mob.add(rect, word) self.choice = choice @@ -3258,7 +3258,7 @@ class InputRandomData(TestPerformance): Write(bubble.content, run_time = 1) ) self.play(eyes.blink_anim()) - self.dither() + self.wait() class CannotDraw(PreviewLearning): def construct(self): @@ -3294,7 +3294,7 @@ class CannotDraw(PreviewLearning): ) self.play(eyes.blink_anim()) self.play(Blink(randy)) - self.dither() + self.wait() class TODOShowCostFunctionDef(TODOStub): CONFIG = { @@ -3348,7 +3348,7 @@ class SomethingToImproveUpon(PiCreatureScene, TestPerformance): Write(words, run_time = 1), morty.change, "sassy", ) - self.dither(2) + self.wait(2) self.play( ApplyMethod( network_mob.next_to, path.get_left(), UP, @@ -3357,7 +3357,7 @@ class SomethingToImproveUpon(PiCreatureScene, TestPerformance): Rotate(path, np.pi, in_place = True), morty.change, "raise_right_hand" ) - self.dither(3) + self.wait(3) self.line = line self.path = path @@ -3389,13 +3389,13 @@ class SomethingToImproveUpon(PiCreatureScene, TestPerformance): morty.change_mode, "hesitant" ) self.play(Write(name)) - self.dither() + self.wait() self.play( FadeIn(modern_variants), FadeOut(VGroup(words, arrow, name)), morty.change, "thinking" ) - self.dither(2) + self.wait(2) self.modern_variants = modern_variants @@ -3414,7 +3414,7 @@ class SomethingToImproveUpon(PiCreatureScene, TestPerformance): group.to_edge(LEFT, buff = LARGE_BUFF) self.add(group) - self.dither(self.time_per_example) + self.wait(self.time_per_example) self.remove(group) def hidden_layers(self): @@ -3435,7 +3435,7 @@ class SomethingToImproveUpon(PiCreatureScene, TestPerformance): self.play(ShowCreation(rects)) self.activate_network(np.random.random(28*28)) - self.dither(3) + self.wait(3) class ShiftingFocus(Scene): def construct(self): @@ -3451,18 +3451,18 @@ class ShiftingFocus(Scene): cap_do.move_to(do, DOWN+LEFT) self.play(Write(words, run_time = 1)) - self.dither() + self.wait() self.play(ShowCreation(cross)) self.play( VGroup(networks, cross).shift, DOWN, Write(viewers, run_time = 1) ) - self.dither(2) + self.wait(2) self.play( FadeOut(how), Transform(do, cap_do) ) - self.dither(2) + self.wait(2) class PauseAndPonder(TeacherStudentsScene): def construct(self): @@ -3478,7 +3478,7 @@ class PauseAndPonder(TeacherStudentsScene): ShowCreation(screen), self.get_student_changes(*["pondering"]*3), ) - self.dither(6) + self.wait(6) class ConvolutionalNetworkPreview(Scene): def construct(self): @@ -3518,7 +3518,7 @@ class ConvolutionalNetworkPreview(Scene): if x > 24 or y > 24: continue kernel.move_to(pixel, UP+LEFT) - self.dither(self.frame_duration) + self.wait(self.frame_duration) self.remove(kernel) class RandomlyLabeledImageData(Scene): @@ -3560,14 +3560,14 @@ class RandomlyLabeledImageData(Scene): run_time = 3, lag_ratio = 0.3, )) - self.dither() + self.wait() self.play(LaggedStart( MoveToTarget, labels, run_time = 4, lag_ratio = 0.5, path_arc = np.pi/3, )) - self.dither() + self.wait() def get_training_group(self, image_name, label_name): arrow = Vector(RIGHT, color = WHITE) @@ -3643,10 +3643,10 @@ class AskNetworkAboutMemorizing(YellAtNetwork): look_at_arg = eyes, run_time = 2 ) - self.dither() + self.wait() self.play(eyes.change_mode_anim("sad")) self.play(eyes.blink_anim()) - self.dither() + self.wait() class CompareLearningCurves(GraphScene): CONFIG = { @@ -3699,7 +3699,7 @@ class CompareLearningCurves(GraphScene): run_time = 12, rate_func = None, )) - self.dither() + self.wait() #### @@ -3719,7 +3719,7 @@ class CompareLearningCurves(GraphScene): self.play(DrawBorderThenFill(rect)) self.play(Write(words)) - self.dither() + self.wait() class ManyMinimaWords(Scene): def construct(self): @@ -3730,7 +3730,7 @@ class ManyMinimaWords(Scene): words.scale_to_fit_width(2*SPACE_WIDTH - 1) words.to_edge(UP) self.play(Write(words)) - self.dither() + self.wait() class NNPart2PatreonThanks(PatreonThanks): diff --git a/nn/part3.py b/nn/part3.py index 0e8471b7..a4dc705b 100644 --- a/nn/part3.py +++ b/nn/part3.py @@ -30,7 +30,7 @@ class LayOutPlan(Scene): ) for i in range(len(items)): self.play(items.fade_all_but, i) - self.dither(2) + self.wait(2) class TODOInsertFeedForwardAnimations(TODOStub): CONFIG = { @@ -145,7 +145,7 @@ class InterpretGradientComponents(GradientNudging): self.play(FadeIn(randy)) self.play(randy.change, "confused", words) self.play(Blink(randy)) - self.dither() + self.wait() self.play(*map(FadeOut, [randy, words, arrow])) def circle_magnitudes(self): @@ -199,10 +199,10 @@ class InterpretGradientComponents(GradientNudging): ) self.play(GrowArrow(d1.arrow)) self.play(ShowCreation(edge1)) - self.dither() + self.wait() self.play(GrowArrow(d2.arrow)) self.play(ShowCreation(edge2)) - self.dither(2) + self.wait(2) self.cost_expression.remove(w_terms) self.cost_expression.add(new_w_terms) @@ -285,7 +285,7 @@ class InterpretGradientComponents(GradientNudging): rate_func = lambda t : wiggle(t, 4), run_time = 2, ) - self.dither() + self.wait() self.play(*map(FadeOut, [ w.dot, w.brace, w.number_line, w.words ])) @@ -389,9 +389,9 @@ class GetLostInNotation(PiCreatureScene): Write(equations), morty.change, "confused", equations ) - self.dither() + self.wait() self.play(morty.change, "pleading") - self.dither(2) + self.wait(2) ## movers = VGroup(*equations.family_members_with_points()) @@ -413,7 +413,7 @@ class GetLostInNotation(PiCreatureScene): ), morty.change, "pondering", ) - self.dither() + self.wait() class TODOInsertPreviewLearning(TODOStub): CONFIG = { @@ -476,7 +476,7 @@ class ShowAveragingCost(PreviewLearning): n_examples_per_adjustment = int(self.examples_per_adjustment_time/self.time_per_example) for train_in, train_out in training_data[:n_start_examples]: self.show_one_example(train_in, train_out) - self.dither(self.time_per_example) + self.wait(self.time_per_example) #Wiggle all edges edges = VGroup(*it.chain(*self.network_mob.edge_groups)) @@ -506,7 +506,7 @@ class ShowAveragingCost(PreviewLearning): self.play(FadeIn(words[x])) for train_in, train_out in training_data[:n_examples_per_adjustment]: self.show_one_example(train_in, train_out) - self.dither(self.time_per_example) + self.wait(self.time_per_example) self.play(LaggedStart( ApplyMethod, reversed_edges, lambda m : (m.rotate_in_place, np.pi), @@ -514,7 +514,7 @@ class ShowAveragingCost(PreviewLearning): lag_ratio = 0.2, )) if x >= 2: - self.dither() + self.wait() #### @@ -540,7 +540,7 @@ class ShowAveragingCost(PreviewLearning): class FocusOnOneExample(TeacherStudentsScene): def construct(self): self.teacher_says("Focus on just \\\\ one example") - self.dither(2) + self.wait(2) class WalkThroughTwoExample(ShowAveragingCost): CONFIG = { @@ -577,7 +577,7 @@ class WalkThroughTwoExample(ShowAveragingCost): layer.neurons.set_fill(opacity = 0) self.activate_network(two_vect) - self.dither() + self.wait() def single_example_influencing_weights(self): two = self.curr_image @@ -614,7 +614,7 @@ class WalkThroughTwoExample(ShowAveragingCost): adjust_edge_group_anim(edge_groups[2]) ) self.play(two.restore) - self.dither() + self.wait() def expand_last_layer(self): neurons = self.network_mob.layers[-1].neurons @@ -679,7 +679,7 @@ class WalkThroughTwoExample(ShowAveragingCost): decimals.add(decimal) self.play(Write(decimals, run_time = 2)) - self.dither() + self.wait() self.decimals = decimals def cannot_directly_affect_activations(self): @@ -735,7 +735,7 @@ class WalkThroughTwoExample(ShowAveragingCost): output_labels.shift, SMALL_BUFF*RIGHT, LaggedStart(GrowArrow, arrows, run_time = 1) ) - self.dither() + self.wait() #Show changing activations anims = [] @@ -765,10 +765,10 @@ class WalkThroughTwoExample(ShowAveragingCost): eight_rect = rects[8].copy() non_two_rects = VGroup(*[r for r in rects if r is not two_rect]) self.play(ShowCreation(two_rect)) - self.dither() + self.wait() self.remove(two_rect) self.play(ReplacementTransform(two_rect.copy(), non_two_rects)) - self.dither() + self.wait() self.play(LaggedStart(FadeOut, non_two_rects, run_time = 1)) self.play(LaggedStart( ApplyFunction, arrows, @@ -779,9 +779,9 @@ class WalkThroughTwoExample(ShowAveragingCost): rate_func = wiggle )) self.play(ShowCreation(two_rect)) - self.dither() + self.wait() self.play(ReplacementTransform(two_rect, eight_rect)) - self.dither() + self.wait() self.play(FadeOut(eight_rect)) self.arrows = arrows @@ -809,7 +809,7 @@ class WalkThroughTwoExample(ShowAveragingCost): )) self.play(FadeOut(to_fade)) - self.dither() + self.wait() for mob in expanded_mobjects: if mob in [neurons, labels]: mob.scale(0.5) @@ -873,19 +873,19 @@ class WalkThroughTwoExample(ShowAveragingCost): Write(dots), run_time = 1.5 ) - self.dither() + self.wait() self.play(ReplacementTransform( prev_neurons.copy(), a_terms, path_arc = np.pi/2 )) - self.dither() + self.wait() self.play( Write(plus_terms[-1]), Write(b) ) - self.dither() + self.wait() self.play(sigma.restore) - self.dither() + self.wait() for mob in b, w_terms, a_terms: self.play( mob.shift, MED_SMALL_BUFF*DOWN, @@ -893,7 +893,7 @@ class WalkThroughTwoExample(ShowAveragingCost): submobject_mode = "lagged_start", run_time = 1.5 ) - self.dither() + self.wait() self.set_variables_as_attrs( rhs, w_terms, a_terms, b, @@ -927,7 +927,7 @@ class WalkThroughTwoExample(ShowAveragingCost): Write(words[0], run_time = 1), ReplacementTransform(mob.copy(), words[1]) ) - self.dither() + self.wait() self.increase_words = increase_words @@ -971,7 +971,7 @@ class WalkThroughTwoExample(ShowAveragingCost): ), rate_func = wiggle )) - self.dither() + self.wait() self.play( ShowCreation(bright_edges), ShowCreation(bright_neurons) @@ -981,13 +981,13 @@ class WalkThroughTwoExample(ShowAveragingCost): lambda m : (m.shift, MED_LARGE_BUFF*LEFT), rate_func = there_and_back )) - self.dither() + self.wait() self.play( ReplacementTransform(bright_edges[0].copy(), w_terms[0]), ReplacementTransform(bright_neurons[0].copy(), a_terms[0]), ShowCreation(terms_rect) ) - self.dither() + self.wait() for x in range(2): self.play(LaggedStart(ShowCreationThenDestruction, bright_edges)) self.play(LaggedStart(ShowCreation, bright_edges)) @@ -997,14 +997,14 @@ class WalkThroughTwoExample(ShowAveragingCost): rate_func = there_and_back )) self.play(FadeOut(terms_rect)) - self.dither() + self.wait() self.play( self.curr_image.shift, MED_LARGE_BUFF*RIGHT, rate_func = wiggle ) - self.dither() + self.wait() self.play(Write(added_words)) - self.dither() + self.wait() self.set_variables_as_attrs( bright_neurons, bright_edges, @@ -1085,19 +1085,19 @@ class WalkThroughTwoExample(ShowAveragingCost): LaggedStart(ShowCreation, bright_edges), run_time = 2, ) - self.dither() + self.wait() self.play( LaggedStart(ShowCreation, neuron_rects), Write(seeing_words, run_time = 2), morty.change, "thinking", seeing_words ) - self.dither() + self.wait() self.play( ShowCreation(two_neuron_rect), Write(thinking_words, run_time = 2), morty.look_at, thinking_words ) - self.dither() + self.wait() self.play(LaggedStart(FadeOut, VGroup( neuron_rects, two_neuron_rect, seeing_words, thinking_words, @@ -1169,7 +1169,7 @@ class WalkThroughTwoExample(ShowAveragingCost): ), rate_func = wiggle )) - self.dither() + self.wait() for positive in [True, False]: if positive: arrows = positive_arrows @@ -1183,7 +1183,7 @@ class WalkThroughTwoExample(ShowAveragingCost): color = self.negative_edge_color s_edges.save_state() self.play(Transform(s_edges, s_edges.alt_position)) - self.dither(0.5) + self.wait(0.5) self.play(s_edges.restore) self.play( LaggedStart(GrowArrow, arrows), @@ -1193,7 +1193,7 @@ class WalkThroughTwoExample(ShowAveragingCost): neurons.set_fill, color, 1, rate_func = there_and_back, )) - self.dither() + self.wait() self.play( two_neuron.set_fill, None, 0.8, ChangingDecimal( @@ -1203,7 +1203,7 @@ class WalkThroughTwoExample(ShowAveragingCost): run_time = 3, rate_func = there_and_back ) - self.dither() + self.wait() self.play(*[ ApplyMethod( edge.set_stroke, None, 3*edge.get_stroke_width(), @@ -1212,7 +1212,7 @@ class WalkThroughTwoExample(ShowAveragingCost): ) for edge in edges ]) - self.dither() + self.wait() self.play(Write(added_words, run_time = 1)) self.play(prev_neurons.set_stroke, WHITE, 2) @@ -1239,12 +1239,12 @@ class WalkThroughTwoExample(ShowAveragingCost): Indicate, prev_neurons, rate_func = wiggle )) - self.dither() + self.wait() self.play(LaggedStart( ShowCreationThenDestruction, edges )) self.play(Transform(words1, words2)) - self.dither() + self.wait() self.play(FadeOut(VGroup(words1, rect))) def show_other_output_neurons(self): @@ -1318,7 +1318,7 @@ class WalkThroughTwoExample(ShowAveragingCost): Write(all_dots_plus), run_time = 3, ) - self.dither(2) + self.wait(2) ## words = TextMobject("Propagate backwards") @@ -1333,7 +1333,7 @@ class WalkThroughTwoExample(ShowAveragingCost): rect.set_fill(BLACK, 1) rect.set_stroke(BLACK, 0) self.play(Write(words)) - self.dither() + self.wait() self.play( FadeOut(self.network_mob.edge_groups[-1]), FadeIn(rect), @@ -1359,7 +1359,7 @@ class WalkThroughTwoExample(ShowAveragingCost): FadeIn(prev_neurons), LaggedStart(ShowCreation, edges), ) - self.dither() + self.wait() for neuron, arrow in zip(neurons, self.prev_neuron_arrows): edge_copies = neuron.edges_in.copy() for edge in edge_copies: @@ -1393,7 +1393,7 @@ class WriteHebbian(Scene): words.scale_to_fit_width(2*SPACE_WIDTH - 1) words.to_edge(UP) self.play(Write(words)) - self.dither() + self.wait() class NotANeuroScientist(TeacherStudentsScene): def construct(self): @@ -1452,13 +1452,13 @@ class NotANeuroScientist(TeacherStudentsScene): Write(no_claim_words, run_time = 1), brain_anim ) - self.dither() + self.wait() self.play(brain_anim) self.play(FocusOn(asterisks)) self.play(Write(asterisks, run_time = 1)) for x in range(2): self.play(brain_anim) - self.dither() + self.wait() class ConstructGradientFromAllTrainingExamples(Scene): CONFIG = { @@ -1536,7 +1536,7 @@ class ConstructGradientFromAllTrainingExamples(Scene): if random.random() < 0.5: self.play(two.eyes.blink_anim()) else: - self.dither() + self.wait() if i == 0: added_anims = [ FadeOut(self.brace), @@ -1561,7 +1561,7 @@ class ConstructGradientFromAllTrainingExamples(Scene): *added_anims ) self.two_changes.add(change) - self.dither() + self.wait() def show_all_examples_requesting_changes(self): training_data, validation_data, test_data = load_data_wrapper() @@ -1702,7 +1702,7 @@ class ConstructGradientFromAllTrainingExamples(Scene): *look_at_anims(averages[1]) ) self.blink(3) - self.dither() + self.wait() averages.add(dots) self.set_variables_as_attrs( @@ -1770,7 +1770,7 @@ class ConstructGradientFromAllTrainingExamples(Scene): GrowFromCenter(eta), minus.shift, MED_SMALL_BUFF*LEFT ) - self.dither() + self.wait() #### @@ -1843,7 +1843,7 @@ class WatchPreviousScene(TeacherStudentsScene): ), ShowCreation(screen) ) - self.dither(10) + self.wait(10) class OpenCloseSGD(Scene): def construct(self): @@ -1861,9 +1861,9 @@ class OpenCloseSGD(Scene): term[1].scale(0.0001).move_to(center) self.play(term.restore) - self.dither(2) + self.wait(2) self.play(Transform(term[0], alt_term0)) - self.dither(2) + self.wait(2) class OrganizeDataIntoMiniBatches(Scene): CONFIG = { @@ -1898,7 +1898,7 @@ class OrganizeDataIntoMiniBatches(Scene): lag_ratio = 0.2, run_time = 4 )) - self.dither() + self.wait() self.examples = examples @@ -1910,7 +1910,7 @@ class OrganizeDataIntoMiniBatches(Scene): run_time = 3, path_arc = np.pi/3, )) - self.dither() + self.wait() def divide_into_minibatches(self): examples = self.examples @@ -1944,7 +1944,7 @@ class OrganizeDataIntoMiniBatches(Scene): lag_ratio = 0.7, rate_func = there_and_back )) - self.dither() + self.wait() self.set_variables_as_attrs(rows, rects, mini_batches_words) @@ -1979,7 +1979,7 @@ class OrganizeDataIntoMiniBatches(Scene): brace.next_to, row, UP, SMALL_BUFF ) self.play(indicate_row(row)) - self.dither() + self.wait() ### @@ -2029,14 +2029,14 @@ class SwimmingInTerms(TeacherStudentsScene): LaggedStart(FadeIn, terms), self.get_student_changes(*["horrified"]*3) ) - self.dither() + self.wait() self.play( terms[-1].next_to, self.teacher.get_corner(UP+LEFT), UP, FadeOut(VGroup(*terms[:-1])), self.teacher.change, "raise_right_hand", self.get_student_changes(*["pondering"]*3) ) - self.dither() + self.wait() class BackpropCode(ExternallyAnimatedScene): pass @@ -2056,7 +2056,7 @@ class BackpropCodeAddOn(PiCreatureScene): morty.look, UP+LEFT ) self.play(morty.look, LEFT) - self.dither(2) + self.wait(2) class CannotFollowCode(TeacherStudentsScene): def construct(self): @@ -2071,14 +2071,14 @@ class CannotFollowCode(TeacherStudentsScene): look_at_arg = self.teacher.eyes ) self.play(self.teacher.change, "hesitant") - self.dither(2) + self.wait(2) self.teacher_says( "Let's get to the \\\\ calculus then", target_mode = "hooray", added_anims = [self.get_student_changes(*3*["plain"])], run_time = 1 ) - self.dither(2) + self.wait(2) class EOCWrapper(Scene): def construct(self): @@ -2089,7 +2089,7 @@ class EOCWrapper(Scene): self.add(title) self.play(ShowCreation(screen)) - self.dither() + self.wait() class SimplestNetworkExample(PreviewLearning): CONFIG = { @@ -2189,7 +2189,7 @@ class SimplestNetworkExample(PreviewLearning): self.network_mob = simple_network_mob self.network = self.network_mob.neural_network self.feed_forward(np.array([0.5])) - self.dither() + self.wait() def show_weights_and_biases(self): network_mob = self.network_mob @@ -2219,9 +2219,9 @@ class SimplestNetworkExample(PreviewLearning): random.shuffle(variables.submobjects) self.play(ReplacementTransform(edges.copy(), w_terms)) - self.dither() + self.wait() self.play(ReplacementTransform(neurons.copy(), b_terms)) - self.dither() + self.wait() self.play(Write(other_terms)) for x in range(2): self.play(LaggedStart( @@ -2229,7 +2229,7 @@ class SimplestNetworkExample(PreviewLearning): rate_func = wiggle, run_time = 4, )) - self.dither() + self.wait() self.play( FadeOut(other_terms), ReplacementTransform(w_terms, edges), @@ -2248,7 +2248,7 @@ class SimplestNetworkExample(PreviewLearning): ApplyMethod, to_fade, lambda m : (m.fade, 0.9) )) - self.dither() + self.wait() self.prev_layers = to_fade @@ -2302,7 +2302,7 @@ class SimplestNetworkExample(PreviewLearning): run_time = 2, rate_func = there_and_back, ) - self.dither() + self.wait() not_exponents = TextMobject("Not exponents") not_exponents.next_to(superscript_rects, DOWN, MED_LARGE_BUFF) @@ -2315,7 +2315,7 @@ class SimplestNetworkExample(PreviewLearning): ), Write(not_exponents, run_time = 2) ) - self.dither() + self.wait() self.play(*map(FadeOut, [not_exponents, superscript_rects])) self.set_variables_as_attrs( @@ -2348,12 +2348,12 @@ class SimplestNetworkExample(PreviewLearning): ShowCreation(rect), Write(words, run_time = 1) ) - self.dither() + self.wait() self.play( Write(y_label, run_time = 1), GrowArrow(y_label_arrow) ) - self.dither() + self.wait() self.set_variables_as_attrs( y_label, y_label_arrow, @@ -2418,13 +2418,13 @@ class SimplestNetworkExample(PreviewLearning): MoveToTarget(decimals), FadeIn(non_numbers) ) - self.dither() + self.wait() self.play( Write(cost_word, run_time = 1), GrowArrow(cost_arrow) ) self.play(C0.shift, MED_SMALL_BUFF*UP, rate_func = wiggle) - self.dither() + self.wait() self.play(*map(FadeOut, [decimals, non_numbers])) self.set_variables_as_attrs( @@ -2458,13 +2458,13 @@ class SimplestNetworkExample(PreviewLearning): self.play(ReplacementTransform( edge.copy(), wL )) - self.dither() + self.wait() self.play(ReplacementTransform(pre_aLm1, aLm1)) - self.dither() + self.wait() self.play(Write(VGroup(plus, bL), run_time = 1)) - self.dither() + self.wait() self.play(sigma_group.restore) - self.dither() + self.wait() weighted_sum_terms = VGroup(wL, aLm1, plus, bL) self.set_variables_as_attrs( @@ -2506,7 +2506,7 @@ class SimplestNetworkExample(PreviewLearning): MoveToTarget(aL_start), MoveToTarget(rp), ) - self.dither() + self.wait() zL_formula = VGroup(z_label, equals, *terms) aL_formula = VGroup(*list(aL_start) + [z_label2, rp]) @@ -2559,27 +2559,27 @@ class SimplestNetworkExample(PreviewLearning): mob.flash = ShowCreationThenDestruction(yellow_copy) self.play(MoveToTarget(top_terms)) - self.dither() + self.wait() self.play(MoveToTarget(zL)) self.play( ShowCreation(top_lines, submobject_mode = "all_at_once"), top_lines.flash ) - self.dither() + self.wait() self.play(MoveToTarget(aL)) self.play( network_early_layers.fade, 1, ShowCreation(z_to_a_line), z_to_a_line.flash ) - self.dither() + self.wait() self.play(MoveToTarget(y)) self.play(MoveToTarget(C0)) self.play(*it.chain(*[ [ShowCreation(line), line.flash] for line in a_to_c_line, y_to_c_line ])) - self.dither(2) + self.wait(2) comp_graph = VGroup() comp_graph.wL, comp_graph.aLm1, comp_graph.bL = top_terms @@ -2646,7 +2646,7 @@ class SimplestNetworkExample(PreviewLearning): MoveToTarget(comp_graph), rect.shift, shift_vect ) - self.dither(2) + self.wait(2) self.play( FadeOut(new_subgraph), FadeOut(prev_neuron), @@ -2657,7 +2657,7 @@ class SimplestNetworkExample(PreviewLearning): ) VGroup(prev_neuron, prev_edge).fade(1) self.remove(rect) - self.dither() + self.wait() self.prev_comp_subgraph = new_subgraph @@ -2726,7 +2726,7 @@ class SimplestNetworkExample(PreviewLearning): path_arc = path_arc ) ) - self.dither() + self.wait() def ask_about_w_sensitivity(self): wL, aLm1, bL, zL, aL, C0 = [ @@ -2788,7 +2788,7 @@ class SimplestNetworkExample(PreviewLearning): Write(sym, run_time = 1) ) shake_dot() - self.dither() + self.wait() self.set_variables_as_attrs( shake_dot, del_wL, del_C0, @@ -2831,7 +2831,7 @@ class SimplestNetworkExample(PreviewLearning): ShowCreation(full_rect), Write(words, run_time = 1), ) - self.dither(2) + self.wait(2) self.play( FadeOut(words), ReplacementTransform(full_rect, denom_rect) @@ -2841,10 +2841,10 @@ class SimplestNetworkExample(PreviewLearning): self.play(ReplacementTransform(denom_rect, numer_rect)) self.play(Transform(dC_dw[0].copy(), del_C0, remover = True)) shake_dot() - self.dither() + self.wait() self.play(ReplacementTransform(numer_rect, full_rect_copy)) self.play(FadeOut(full_rect_copy)) - self.dither() + self.wait() self.dC_dw = dC_dw @@ -2886,8 +2886,8 @@ class SimplestNetworkExample(PreviewLearning): ReplacementTransform(s1.brace.copy(), s2.brace), ) self.shake_dot(run_time = 1.5) - self.dither(0.5) - self.dither() + self.wait(0.5) + self.wait() self.set_variables_as_attrs(del_zL, del_aL) @@ -2931,9 +2931,9 @@ class SimplestNetworkExample(PreviewLearning): self.play(ReplacementTransform( bot_sym.copy(), frac[2] )) - self.dither() + self.wait() self.shake_dot() - self.dither() + self.wait() self.chain_rule_equation = VGroup(dC_dw, *group) @@ -2954,7 +2954,7 @@ class SimplestNetworkExample(PreviewLearning): Write(words, run_time = 1), graph_parts.scale, 0.7, graph_parts.get_bottom() ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [rect, words])) def indicate_everything_on_screen(self): @@ -2969,7 +2969,7 @@ class SimplestNetworkExample(PreviewLearning): lag_ratio = 0.2, run_time = 5 )) - self.dither() + self.wait() def prepare_for_derivatives(self): zL_formula = self.zL_formula @@ -3038,14 +3038,14 @@ class SimplestNetworkExample(PreviewLearning): cost_equation.next_to, dC_da.rhs, DOWN, MED_LARGE_BUFF, LEFT ) - self.dither() + self.wait() self.play(ReplacementTransform( cost_rhs.copy(), dC_da.rhs, path_arc = np.pi/2, )) - self.dither() + self.wait() self.play(cost_equation.restore) - self.dither() + self.wait() #show_difference neuron = self.last_neurons[0] @@ -3079,11 +3079,11 @@ class SimplestNetworkExample(PreviewLearning): self.play(ReplacementTransform( dC_da.rhs.copy(), double_arrow )) - self.dither() + self.wait() self.play(MoveToTarget(moving_decimals)) opacity = neuron.get_fill_opacity() for target_o in 0, opacity: - self.dither(2) + self.wait(2) self.play( neuron.set_fill, None, target_o, *[ @@ -3111,13 +3111,13 @@ class SimplestNetworkExample(PreviewLearning): aL_formula.next_to, da_dz.rhs, DOWN, MED_LARGE_BUFF, LEFT ) - self.dither() + self.wait() self.play(ReplacementTransform( a_rhs.copy(), da_dz.rhs, )) - self.dither() + self.wait() self.play(aL_formula.restore) - self.dither() + self.wait() #dz_dw self.play( @@ -3133,16 +3133,16 @@ class SimplestNetworkExample(PreviewLearning): zL_formula.next_to, dz_dw.rhs, DOWN, MED_LARGE_BUFF, LEFT, ) - self.dither() + self.wait() rect = SurroundingRectangle(VGroup(*zL_formula[2:4])) self.play(ShowCreation(rect)) self.play(FadeOut(rect)) self.play(ReplacementTransform( z_rhs[1].copy(), dz_dw.rhs, )) - self.dither() + self.wait() self.play(zL_formula.restore) - self.dither() + self.wait() self.derivative_equations = VGroup(dC_da, da_dz, dz_dw) @@ -3192,7 +3192,7 @@ class SimplestNetworkExample(PreviewLearning): rate_func = wiggle, run_time = 3, ) - self.dither() + self.wait() self.play(rhs.shift, MED_LARGE_BUFF*UP, rate_func = wiggle) self.play( rhs_copy.move_to, neuron, @@ -3205,7 +3205,7 @@ class SimplestNetworkExample(PreviewLearning): run_time = 3, rate_func = there_and_back ) - self.dither() + self.wait() #Fire together wire together opacity = neuron.get_fill_opacity() @@ -3219,7 +3219,7 @@ class SimplestNetworkExample(PreviewLearning): *get_decimal_anims() ) self.play(edge.restore, FadeOut(del_wL)) - self.dither(3) + self.wait(3) def organize_chain_rule_rhs(self): fracs = self.derivative_equations @@ -3252,7 +3252,7 @@ class SimplestNetworkExample(PreviewLearning): FadeOut(equals_group), right_group.to_corner, DOWN+RIGHT ) - self.dither() + self.wait() rhs_group.add(equals) self.chain_rule_rhs = rhs_group @@ -3290,7 +3290,7 @@ class SimplestNetworkExample(PreviewLearning): GrowFromCenter(brace), Write(text, run_time = 2), ) - self.dither(2) + self.wait(2) self.cycle_through_altnernate_training_examples() self.play(*map(FadeOut, [ VGroup(*full_derivative[3:]), @@ -3319,7 +3319,7 @@ class SimplestNetworkExample(PreviewLearning): Transform( d, self.get_neuron_activation_decimal(n) ).update(1) - self.dither(0.2) + self.wait(0.2) self.play(group.restore, run_time = 0.2) def show_gradient(self): @@ -3359,7 +3359,7 @@ class SimplestNetworkExample(PreviewLearning): ) terms.add(dC_dw) self.play(Write(lhs)) - self.dither(2) + self.wait(2) self.play(FadeOut(VGroup(lhs, vect))) def transition_to_derivative_wrt_b(self): @@ -3389,7 +3389,7 @@ class SimplestNetworkExample(PreviewLearning): run_time = 1.5, lag_ratio = 0.7, )) - self.dither() + self.wait() def show_derivative_wrt_b(self): comp_graph = self.comp_graph @@ -3455,11 +3455,11 @@ class SimplestNetworkExample(PreviewLearning): self.play(Transform(del_w, del_b)) self.play(FadeIn(dz_db)) self.play(get_path_animation()) - self.dither() + self.wait() self.play(ShowCreation(z_formula_rect)) - self.dither() + self.wait() self.play(ReplacementTransform(z_formula_rect, b_in_z_rect)) - self.dither() + self.wait() self.play( ReplacementTransform(b_in_z_formula.copy(), one), FadeOut(b_in_z_rect) @@ -3471,7 +3471,7 @@ class SimplestNetworkExample(PreviewLearning): path_arc = arrow.path_arc ) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [dz_db, arrow, one])) self.dz_db = dz_db @@ -3528,13 +3528,13 @@ class SimplestNetworkExample(PreviewLearning): FadeIn(dz_daLm1), VGroup(*self.chain_rule_equation[-2:]).shift, SMALL_BUFF*RIGHT, ) - self.dither() + self.wait() self.play(ShowCreation(dz_daLm1_rect)) - self.dither() + self.wait() self.play(ReplacementTransform( dz_daLm1_rect, z_formula_rect )) - self.dither() + self.wait() self.play(ReplacementTransform(z_formula_rect, a_in_z_rect)) self.play( ReplacementTransform(wL_in_z.copy(), wL), @@ -3547,7 +3547,7 @@ class SimplestNetworkExample(PreviewLearning): path_arc = arrow.path_arc ) ) - self.dither(2) + self.wait(2) self.chain_rule_rhs.add(wL, arrow) self.chain_rule_equation.add(dz_daLm1) @@ -3607,7 +3607,7 @@ class SimplestNetworkExample(PreviewLearning): run_time = 1.5, lag_ratio = 0.4, )) - self.dither(2) + self.wait(2) ### @@ -3644,13 +3644,13 @@ class IsntThatOverSimplified(TeacherStudentsScene): self.change_student_modes( "pondering", "raise_right_hand", "pondering" ) - self.dither() + self.wait() self.teacher_says( "Not that much, actually!", run_time = 1, target_mode = "hooray" ) - self.dither(2) + self.wait(2) class GeneralFormulas(SimplestNetworkExample): CONFIG = { @@ -3737,7 +3737,7 @@ class GeneralFormulas(SimplestNetworkExample): map(Write, start_labels), [GrowArrow(a[0]) for a in start_arrows] )) - self.dither() + self.wait() self.play( ReplacementTransform(start_labels, all_labels), ReplacementTransform(start_arrows, all_arrows), @@ -3747,7 +3747,7 @@ class GeneralFormulas(SimplestNetworkExample): VGroup(*all_subscript_rects.family_members_with_points()), lag_ratio = 0.7 )) - self.dither() + self.wait() self.set_variables_as_attrs( L_neurons, Lm1_neurons, @@ -3788,8 +3788,8 @@ class GeneralFormulas(SimplestNetworkExample): ShowCreation(rect) ) self.play(FadeOut(rect)) - self.dither() - self.dither() + self.wait() + self.wait() def add_desired_output(self): layer = self.network_mob.layers[-1] @@ -3826,7 +3826,7 @@ class GeneralFormulas(SimplestNetworkExample): for n1, n2 in zip(layer.neurons, desired_output.neurons) ] + map(GrowArrow, arrows) ) - self.dither() + self.wait() self.set_variables_as_attrs( desired_output, @@ -3859,15 +3859,15 @@ class GeneralFormulas(SimplestNetworkExample): for mob in aj, yj ]) self.play(LaggedStart(FadeIn, to_fade_in)) - self.dither(2) + self.wait(2) self.play(LaggedStart( Indicate, sum_part, rate_func = wiggle, )) - self.dither() + self.wait() for mob in aj.target, yj.target, cost_equation[-1]: self.play(Indicate(mob)) - self.dither() + self.wait() self.set_variables_as_attrs(cost_equation) @@ -3913,11 +3913,11 @@ class GeneralFormulas(SimplestNetworkExample): for neuron in self.chosen_neurons: self.play(Indicate(neuron), Animation(neuron.decimal)) self.play(Write(w_label)) - self.dither() + self.wait() self.play(Indicate(subscripts)) for x in range(2): self.play(Swap(*subscripts)) - self.dither() + self.wait() self.set_variables_as_attrs(faded_edges, w_label) @@ -3978,7 +3978,7 @@ class GeneralFormulas(SimplestNetworkExample): lambda m : m not in [w_part, aLm1_part], z_formula )))) - self.dither() + self.wait() self.play(ReplacementTransform( self.chosen_neurons[1].label.copy(), aL_part @@ -3990,7 +3990,7 @@ class GeneralFormulas(SimplestNetworkExample): a_formula.get_part_by_tex("z^") ) ) - self.dither() + self.wait() self.set_variables_as_attrs(z_formula, compact_z_formula, a_formula) @@ -4016,13 +4016,13 @@ class GeneralFormulas(SimplestNetworkExample): self.z_formula, self.compact_z_formula )) self.play(Write(chain_rule)) - self.dither() + self.wait() self.play(LaggedStart( ShowCreationThenDestruction, rects, lag_ratio = 0.7, run_time = 3 )) - self.dither() + self.wait() self.set_variables_as_attrs(chain_rule) @@ -4042,7 +4042,7 @@ class GeneralFormulas(SimplestNetworkExample): self.chain_rule, VGroup(*chain_rule[:n] + chain_rule[n+1:]) )) self.play(Write(chain_rule[n], run_time = 1)) - self.dither() + self.wait() self.set_variables_as_attrs(chain_rule) @@ -4111,7 +4111,7 @@ class GeneralFormulas(SimplestNetworkExample): GrowFromCenter(brace) ] self.play(*anims) - self.dither() + self.wait() for path, path_line in zip(paths, path_lines): label = path[-1] self.play( @@ -4123,14 +4123,14 @@ class GeneralFormulas(SimplestNetworkExample): ShowCreation(path_line), Animation(label) ) - self.dither() + self.wait() group = VGroup(label, cost_aL) self.play( group.shift, MED_SMALL_BUFF*UP, rate_func = wiggle ) self.play(FadeOut(path_line)) - self.dither() + self.wait() def show_previous_layer(self): mid_neurons = self.network_mob.layers[1].neurons @@ -4193,7 +4193,7 @@ class GeneralFormulas(SimplestNetworkExample): for x in range(3): for edges_out in all_edges_out: self.play(ShowCreationThenDestruction(edges_out)) - self.dither() + self.wait() #### @@ -4223,7 +4223,7 @@ class ThatsPrettyMuchIt(TeacherStudentsScene): target_mode = "hooray", run_time = 1, ) - self.dither(2) + self.wait(2) class PatYourselfOnTheBack(TeacherStudentsScene): def construct(self): @@ -4232,7 +4232,7 @@ class PatYourselfOnTheBack(TeacherStudentsScene): target_mode = "hooray" ) self.change_student_modes(*["hooray"]*3) - self.dither(3) + self.wait(3) class ThatsALotToThinkAbout(TeacherStudentsScene): def construct(self): @@ -4241,7 +4241,7 @@ class ThatsALotToThinkAbout(TeacherStudentsScene): target_mode = "surprised" ) self.change_student_modes(*["thinking"]*3) - self.dither(4) + self.wait(4) class LayersOfComplexity(Scene): def construct(self): @@ -4260,7 +4260,7 @@ class LayersOfComplexity(Scene): self.play(GrowFromCenter(brace)) self.play(GrowArrow(arrow)) self.play(Write(gradient)) - self.dither() + self.wait() def get_chain_rule_equations(self): @@ -4330,7 +4330,7 @@ class SponsorFrame(PiCreatureScene): morty.change, "hooray", t_shirt_words, Write(t_shirt_words, run_time = 2) ) - self.dither() + self.wait() self.play( morty.change, "raise_right_hand", screen, ShowCreation(screen) @@ -4341,13 +4341,13 @@ class SponsorFrame(PiCreatureScene): ) self.play(Write(url)) self.play(GrowArrow(arrow)) - self.dither(2) + self.wait(2) self.play(morty.change, "thinking", url) - self.dither(3) + self.wait(3) self.play(Write(human_in_the_loop)) self.play(morty.change, "happy", url) self.play(morty.look_at, screen) - self.dither(7) + self.wait(7) t_shirt_words_outline = t_shirt_words.copy() t_shirt_words_outline.set_fill(opacity = 0) t_shirt_words_outline.set_stroke(GREEN, 3) @@ -4362,7 +4362,7 @@ class SponsorFrame(PiCreatureScene): color = PINK, run_time = 3 )) - self.dither(3) + self.wait(3) class NN3PatreonThanks(PatreonThanks): CONFIG = { diff --git a/old_projects/256.py b/old_projects/256.py index 243ebb37..2ba199cf 100644 --- a/old_projects/256.py +++ b/old_projects/256.py @@ -53,7 +53,7 @@ class LastVideo(Scene): self.add(title) self.play(ShowCreation(screen_rect)) - self.dither() + self.wait() class BreakUp2To256(PiCreatureScene): def construct(self): @@ -92,17 +92,17 @@ class BreakUp2To256(PiCreatureScene): GrowFromCenter(brace), Write(expression, run_time = 1) ) - self.dither() + self.wait() self.play( self.pi_creature.change, "maybe", Write(words) ) - self.dither(2) + self.wait(2) self.play( self.pi_creature.change, "happy", FadeOut(words) ) - self.dither() + self.wait() self.expression = expression self.bits_brace = brace @@ -133,7 +133,7 @@ class BreakUp2To256(PiCreatureScene): MoveToTarget(bits) ) self.play(self.pi_creature.change, "pondering") - self.dither() + self.wait() self.subexpressions = subexpressions @@ -156,7 +156,7 @@ class BreakUp2To256(PiCreatureScene): ), FadeOut(self.pi_creature) ) - self.dither(3) + self.wait(3) def reorganize_four_billions(self): target = VGroup(*[ @@ -185,11 +185,11 @@ class BreakUp2To256(PiCreatureScene): LaggedStart(FadeIn, parens), FadeOut(to_fade) ) - self.dither() + self.wait() ###### - def dither(self, time = 1): + def wait(self, time = 1): self.play(Animation(self.bits, run_time = time)) def update_frame(self, *args, **kwargs): @@ -211,7 +211,7 @@ class ShowTwoTo32(Scene): mob = TexMobject("2^{32} = 4{,}294{,}967{,}296") mob.scale(1.5) self.add(mob) - self.dither() + self.wait() class MainBreakdown(Scene): CONFIG = { @@ -357,7 +357,7 @@ class MainBreakdown(Scene): ), Transform(rate_words, new_rate_words) ) - self.dither() + self.wait() self.play( LaggedStart( ApplyFunction, gpus, @@ -368,7 +368,7 @@ class MainBreakdown(Scene): remover = True ) ) - self.dither() + self.wait() self.play( Transform( rate_words[0], four_billion.copy().highlight(BLUE), @@ -381,7 +381,7 @@ class MainBreakdown(Scene): Transform(laptop, target_laptop), ShowCreation(h_line), ) - self.dither() + self.wait() def kilo_google(self): self.create_four_billion_copies(1, Laptop()) @@ -409,9 +409,9 @@ class MainBreakdown(Scene): self.revert_to_original_skipping_status() self.play(DrawBorderThenFill(google)) - self.dither(2) + self.wait(2) self.play(Write(millions)) - self.dither(2) + self.wait(2) self.play(LaggedStart( Indicate, self.group_of_four_billion_things, run_time = 4, @@ -420,7 +420,7 @@ class MainBreakdown(Scene): )) self.play(FadeOut(millions), FadeIn(plus_plus)) self.play(Write(kilo)) - self.dither() + self.wait() self.play( four_billion.restore, FadeOut(self.group_of_four_billion_things) @@ -430,7 +430,7 @@ class MainBreakdown(Scene): FadeIn(laptop), FadeIn(h_line), ) - self.dither() + self.wait() def half_all_people_on_earth(self): earth = self.get_earth() @@ -448,9 +448,9 @@ class MainBreakdown(Scene): GrowFromCenter(earth), Write(people) ) - self.dither() + self.wait() self.create_four_billion_copies(2, self.get_kilogoogle()) - self.dither() + self.wait() self.play( self.four_billions[2].restore, Transform(earth, target_earth), @@ -459,7 +459,7 @@ class MainBreakdown(Scene): FadeOut(self.group_of_four_billion_things), FadeOut(people) ) - self.dither() + self.wait() def four_billion_earths(self): self.create_four_billion_copies( @@ -481,14 +481,14 @@ class MainBreakdown(Scene): self.revert_to_original_skipping_status() self.play(FadeIn(milky_way)) self.play(Write(n_stars_estimate)) - self.dither() + self.wait() self.play(LaggedStart( Indicate, self.group_of_four_billion_things, rate_func = there_and_back, lag_ratio = 0.2, run_time = 3, )) - self.dither() + self.wait() self.play( ReplacementTransform( self.group_of_four_billion_things, @@ -500,7 +500,7 @@ class MainBreakdown(Scene): FadeOut(milky_way), FadeOut(n_stars_estimate), ) - self.dither() + self.wait() def four_billion_galxies(self): self.create_four_billion_copies(4, self.get_galaxy()) @@ -517,7 +517,7 @@ class MainBreakdown(Scene): name.next_to(self.group_of_four_billion_things, UP) self.play(Write(name)) - self.dither() + self.wait() self.play( self.four_billions[4].restore, ReplacementTransform( @@ -530,7 +530,7 @@ class MainBreakdown(Scene): name, denom ), ) - self.dither() + self.wait() def show_time_scale(self): fb1, fb2 = self.four_billions[5:7] @@ -556,9 +556,9 @@ class MainBreakdown(Scene): fb.highlight, BLUE, Write(words) ) - self.dither() + self.wait() self.play(Write(universe_lifetimes)) - self.dither() + self.wait() def show_probability(self): four_billion = self.four_billions[7] @@ -574,7 +574,7 @@ class MainBreakdown(Scene): Write(VGroup(*words[::2])), Transform(four_billion, words[1]) ) - self.dither() + self.wait() ############ @@ -614,7 +614,7 @@ class MainBreakdown(Scene): lag_ratio = 0.2 ) ) - self.dither() + self.wait() group.add_to_back(brace) self.group_of_four_billion_things = group @@ -683,7 +683,7 @@ class WriteTWoTo160(Scene): mob[0].highlight(BLUE) mob.scale(2) self.play(Write(mob)) - self.dither() + self.wait() class StateOfBitcoin(TeacherStudentsScene): def construct(self): @@ -761,7 +761,7 @@ class StateOfBitcoin(TeacherStudentsScene): self.change_student_modes(*["pondering"]*3) self.play(LaggedStart(FadeIn, kilogoogle)) self.change_student_modes(*["surprised"]*3) - self.dither() + self.wait() self.change_student_modes( *["plain"]*3, added_anims = [ @@ -775,7 +775,7 @@ class StateOfBitcoin(TeacherStudentsScene): DrawBorderThenFill(gpu) ) self.play(ShowCreation(cross)) - self.dither() + self.wait() self.play( Write(asic), gpu_group.to_edge, DOWN, @@ -791,7 +791,7 @@ class StateOfBitcoin(TeacherStudentsScene): run_time = 3, lag_ratio = 0.2, )) - self.dither() + self.wait() class QAndA(PiCreatureScene): def construct(self): @@ -819,19 +819,19 @@ class QAndA(PiCreatureScene): self.play(Write(num_subscriber_words)) self.play(self.pi_creature.change, "gracious", num_subscriber_words) - self.dither() + self.wait() self.play( q_and_a.restore, self.pi_creature.change, "raise_right_hand", ) - self.dither() + self.wait() self.play(Write(reddit)) - self.dither() + self.wait() self.play( FadeIn(twitter), self.pi_creature.change_mode, "shruggie" ) - self.dither(2) + self.wait(2) def show_powers_of_two(self): rows = 16 @@ -872,7 +872,7 @@ class QAndA(PiCreatureScene): rate_func = squish_rate_func(smooth, 0, 0.5) ) ) - self.dither() + self.wait() self.play( FadeOut(dots), FadeOut(powers_of_two) diff --git a/old_projects/bell.py b/old_projects/bell.py index 283dc593..5ab94e62 100644 --- a/old_projects/bell.py +++ b/old_projects/bell.py @@ -125,7 +125,7 @@ class PhotonPassesCompletelyOrNotAtAll(DirectionOfPolarizationScene): green_flash, red_flash, ) - self.dither() + self.wait() class PhotonPassesCompletelyOrNotAtAllForWavesVideo(PhotonPassesCompletelyOrNotAtAll): CONFIG = { @@ -145,7 +145,7 @@ class DirectionOfPolarization(DirectionOfPolarizationScene): em_wave = self.em_wave self.add(em_wave) - self.dither(2) + self.wait(2) self.move_camera( phi = self.target_phi, theta = self.target_theta @@ -153,8 +153,8 @@ class DirectionOfPolarization(DirectionOfPolarizationScene): self.play(Write(words, run_time = 1)) for angle in 2*np.pi/3, -np.pi/3, np.pi/4: self.change_polarization_direction(angle) - self.dither() - self.dither(2) + self.wait() + self.wait(2) class PhotonsThroughPerpendicularFilters(PhotonPassesCompletelyOrNotAtAll): CONFIG = { @@ -282,7 +282,7 @@ class MoreFiltersMoreLight(FilterScene): pfs[2].shift, 3*OUT, Animation(pfs[4]), ) - self.dither() + self.wait() self.play( Animation(pfs[0]), pfs[2].shift, 3*IN, @@ -296,7 +296,7 @@ class MoreFiltersMoreLight(FilterScene): Animation(VGroup(pfs[2], pfs[4])), run_time = 2 ) - self.dither() + self.wait() pfs[3].shift(8*OUT) self.play( @@ -305,7 +305,7 @@ class MoreFiltersMoreLight(FilterScene): Animation(VGroup(*pfs[4:])), run_time = 2 ) - self.dither() + self.wait() def color_filters(self, pfs): colors = [RED, GREEN, BLUE, MAROON_B, PURPLE_C] @@ -375,9 +375,9 @@ class ConfusedPiCreature(Scene): randy.change, "confused", 3*(UP+RIGHT), ) self.play(Blink(randy)) - self.dither(2) + self.wait(2) self.play(Blink(randy)) - self.dither(2) + self.wait(2) class AngryPiCreature(PiCreatureScene): def construct(self): @@ -387,7 +387,7 @@ class AngryPiCreature(PiCreatureScene): look_at_arg = 2*RIGHT, run_time = 1 ) - self.dither(3) + self.wait(3) def create_pi_creature(self): return Randolph().shift(DOWN+3*LEFT) @@ -430,7 +430,7 @@ class ShowALittleMath(TeacherStudentsScene): *["pondering"]*3, look_at_arg = exp2 ) - self.dither(2) + self.wait(2) class SecondVideoWrapper(Scene): def construct(self): @@ -441,7 +441,7 @@ class SecondVideoWrapper(Scene): screen_rect = ScreenRectangle(height = 6) screen_rect.next_to(title, DOWN) self.play(ShowCreation(screen_rect)) - self.dither(3) + self.wait(3) class BasicsOfPolarization(DirectionOfPolarizationScene): CONFIG = { @@ -465,13 +465,13 @@ class BasicsOfPolarization(DirectionOfPolarizationScene): words.rotate(np.pi/2, RIGHT) self.play(Write(title)) - self.dither(2) + self.wait(2) self.play( Write(subtitle, run_time = 2), FadeIn(self.rectangles) ) self.change_polarization_direction(np.pi/2, run_time = 3) - self.dither() + self.wait() self.change_polarization_direction(-np.pi/12, run_time = 2) self.move_camera(theta = -0.95*np.pi) self.change_polarization_direction(-np.pi/6, run_time = 2) @@ -610,7 +610,7 @@ class AngleToProbabilityChart(Scene): explanation = TextMobject("Based on $\\cos(\\theta)^2$") explanation.next_to(prob_mobs, RIGHT, LARGE_BUFF) self.play(Write(explanation, run_time = 2)) - self.dither() + self.wait() class ShowVariousFilterPairsWithPhotonsOverTime(PhotonsThroughPerpendicularFilters): CONFIG = { @@ -639,7 +639,7 @@ class ShowVariousFilterPairsWithPhotonsOverTime(PhotonsThroughPerpendicularFilte def add_filters(self): self.remove(*self.pol_filters[1:]) - self.dither() + self.wait() self.play(ReplacementTransform( self.pol_filters[0].copy().set_fill(BLACK, 1), self.pol_filters[1] @@ -703,7 +703,7 @@ class ShowVariousFilterPairsWithPhotonsOverTime(PhotonsThroughPerpendicularFilte photon, *added_anims ) - self.dither() + self.wait() def change_to_new_filter(self, pol_filter, added_anims = None): if added_anims is None: @@ -829,7 +829,7 @@ class ShowVariousFilterPairs(ShowVariousFilterPairsWithPhotonsOverTime): #Write probability prob_text = self.get_probability_text(pf2) self.play(Write(prob_text, run_time = 1)) - self.dither() + self.wait() self.prob_texts.add(prob_text) @@ -914,9 +914,9 @@ class ShowVariousFilterPairsFrom0To45(ShowVariousFilterPairs): cos.next_to(rect, OUT, SMALL_BUFF) self.play(LaggedStart(ShowCreation, rects)) - self.dither() + self.wait() self.play(*map(Write, cosines), run_time = 2) - self.dither() + self.wait() class ForgetPreviousActions(ShowVariousFilterPairs): CONFIG = { @@ -1071,7 +1071,7 @@ class IntroduceLabeledFilters(ShowVariousFilterPairs): pf.shift(4*OUT) pf.fade(1) self.play(pf.restore) - self.dither() + self.wait() def reposition_camera(self): self.move_camera( @@ -1098,7 +1098,7 @@ class IntroduceLabeledFilters(ShowVariousFilterPairs): self.lower_pol_filters.shift, 3*IN, self.pol_filters.shift, 1.5*OUT, ) - self.dither() + self.wait() def show_bottom_lines(self): A, C = self.lower_pol_filters @@ -1153,7 +1153,7 @@ class IntroduceLabeledFilters(ShowVariousFilterPairs): Write(words, run_time = 2), ShowCreation(arrow) ) - self.dither(2) + self.wait(2) self.blocked_at_C_words = words self.blocked_at_C_label_group = VGroup(arrow, words) @@ -1238,17 +1238,17 @@ class IntroduceLabeledFilters(ShowVariousFilterPairs): ShowCreation(arrow0), Write(words0, run_time = 1) ) - self.dither() + self.wait() self.play( ReplacementTransform(words0, words1), ReplacementTransform(arrow0, arrow1), ) - self.dither() + self.wait() self.play( ShowCreation(arrow2), Write(words2) ) - self.dither(2) + self.wait(2) self.fifteens = VGroup(words1, words2) self.blocked_at_B_label_group = VGroup( @@ -1293,7 +1293,7 @@ class IntroduceLabeledFilters(ShowVariousFilterPairs): randy, blinked, rate_func = squish_rate_func(there_and_back) )) - self.dither(3) + self.wait(3) class IntroduceLabeledFiltersNoRotation(IntroduceLabeledFilters): CONFIG = { @@ -1347,7 +1347,7 @@ class RemoveBFromLabeledFilters(IntroduceLabeledFiltersNoRotation): mover.restore, mover.shift, 2.5*IN, ) - self.dither() + self.wait() self.play( ApplyMethod(sB.shift, 4*IN, rate_func = running_start), FadeOut(sl1), @@ -1360,14 +1360,14 @@ class RemoveBFromLabeledFilters(IntroduceLabeledFiltersNoRotation): Animation(sC), Animation(tl2), ) - self.dither() + self.wait() def fade_in_labels(self): self.play(*map(FadeIn, [ self.blocked_at_B_label_group, self.blocked_at_C_label_group, ])) - self.dither() + self.wait() class NumbersSuggestHiddenVariablesAreImpossible(TeacherStudentsScene): def construct(self): @@ -1376,7 +1376,7 @@ class NumbersSuggestHiddenVariablesAreImpossible(TeacherStudentsScene): "no hidden variables" ) self.change_student_modes("erm", "sassy", "confused") - self.dither(3) + self.wait(3) class VennDiagramProofByContradiction(Scene): CONFIG = { @@ -1450,7 +1450,7 @@ class VennDiagramProofByContradiction(Scene): ) last_circle = circle self.play(MoveToTarget(last_circle.label)) - self.dither() + self.wait() if hasattr(self, "A_segments"): A.add(self.A_segments) @@ -1546,7 +1546,7 @@ class VennDiagramProofByContradiction(Scene): group.to_corner, DOWN + RIGHT, ) self.play(photon.eyes.blink_anim()) - self.dither() + self.wait() self.play( FadeOut(bubble_group), photon.restore, @@ -1585,7 +1585,7 @@ class VennDiagramProofByContradiction(Scene): self.photons.space_out_submobjects, 0.8, self.photons.move_to, A.target, ) - self.dither() + self.wait() self.A_group = A_group self.B_group = B_group @@ -1646,7 +1646,7 @@ class VennDiagramProofByContradiction(Scene): self.in_A_in_B.set_fill, GREEN, 0.5, Animation(in_B), ) - self.dither() + self.wait() self.play( ReplacementTransform(words1, words2), ReplacementTransform(arrow1, arrow2), @@ -1655,14 +1655,14 @@ class VennDiagramProofByContradiction(Scene): self.in_A_out_B.set_fill, RED, 0.5, Animation(out_of_B) ) - self.dither() + self.wait() self.play(ApplyMethod( VGroup(self.in_A_out_B, out_of_B).shift, MED_LARGE_BUFF*UP, rate_func = wiggle, run_time = 1.5, )) - self.dither(0.5) + self.wait(0.5) self.in_B = in_B self.out_of_B = out_of_B @@ -1740,15 +1740,15 @@ class VennDiagramProofByContradiction(Scene): MED_LARGE_BUFF*UP, rate_func = wiggle )) - self.dither() + self.wait() C.save_state() self.play(C.set_fill, BLACK, 1) - self.dither() + self.wait() self.play(C.restore) - self.dither(2) + self.wait(2) self.play(Transform(percent, pound)) self.play(Write(less_than_15, run_time = 1)) - self.dither() + self.wait() self.in_C = in_C self.out_of_C = out_of_C @@ -1840,7 +1840,7 @@ class VennDiagramProofByContradiction(Scene): self.play(faders.fade, 1) self.play(Write(terms[0]), run_time = 1) - self.dither() + self.wait() self.photon_thinks_in_A_out_C() regions[0].set_stroke(YELLOW, width = 8) regions[0].set_fill(YELLOW, opacity = 0.25) @@ -1849,13 +1849,13 @@ class VennDiagramProofByContradiction(Scene): run_time = 1.5, rate_func = wiggle, ) - self.dither(2) + self.wait(2) #Photons jump self.photons.save_state() self.play(Write(should_be_50[0], run_time = 1)) self.photons_jump_to_A_not_C_region() - self.dither() + self.wait() self.play( faders.restore, self.photons.restore, @@ -1883,7 +1883,7 @@ class VennDiagramProofByContradiction(Scene): *map(Write, braces), run_time = 1 ) - self.dither() + self.wait() self.play( FadeIn(less_than), *map(FadeOut, [funny_business, braces]) @@ -1892,7 +1892,7 @@ class VennDiagramProofByContradiction(Scene): for term, group, region, num in zip(terms, photon_groups, regions, nums)[1:]: group.set_stroke(WHITE) self.play(Write(term, run_time = 1)) - self.dither() + self.wait() self.play( ApplyMethod( VGroup(region, group).shift, 0.5*UP, @@ -1901,8 +1901,8 @@ class VennDiagramProofByContradiction(Scene): ), ) self.play(MoveToTarget(num)) - self.dither() - self.dither() + self.wait() + self.wait() self.play(ShowCreation(rects[0])) self.play( @@ -1910,7 +1910,7 @@ class VennDiagramProofByContradiction(Scene): run_time = 1.5, rate_func = wiggle, ) - self.dither() + self.wait() self.play(Transform(rects[0], last_rects)) self.in_A_out_B.save_state() self.in_A_in_B_out_C.save_state() @@ -1919,7 +1919,7 @@ class VennDiagramProofByContradiction(Scene): self.in_A_in_B_out_C.set_fill, YELLOW, 0.5, Animation(self.photons) ) - self.dither() + self.wait() self.play( FadeOut(rects[0]), self.in_A_out_B.restore, @@ -1927,7 +1927,7 @@ class VennDiagramProofByContradiction(Scene): Animation(self.in_A_out_C), Animation(self.photons) ) - self.dither() + self.wait() self.play( FadeIn(should_be_50[1]), ShowCreation(cross) @@ -1945,7 +1945,7 @@ class VennDiagramProofByContradiction(Scene): Write(contradiction, run_time = 1) ) self.play(Blink(morty)) - self.dither() + self.wait() def photons_jump_to_A_not_C_region(self): in_C = self.in_C @@ -2051,9 +2051,9 @@ class PonderingPiCreature(Scene): randy.to_edge(DOWN).shift(3*LEFT) self.play(randy.change, "pondering", UP+RIGHT) self.play(Blink(randy)) - self.dither(2) + self.wait(2) self.play(Blink(randy)) - self.dither(2) + self.wait(2) class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): def construct(self): @@ -2114,7 +2114,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): FadeIn(words, submobject_mode = "lagged_start"), ShowCreation(arrow) ) - self.dither() + self.wait() vect = 0.6*(A.get_center() - B.get_center()) self.play( B0.shift, vect, @@ -2124,7 +2124,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): rate_func = running_start, ) B1.shift(vect) - self.dither() + self.wait() self.in_A_out_B_words = words self.in_A_out_B_arrow = arrow @@ -2157,7 +2157,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): ShowCreation(arrow) ) self.play(FadeIn(C0)) - self.dither(2) + self.wait(2) vect = 0.5*(B.get_center() - C.get_center()) self.play( C0.shift, vect, @@ -2167,7 +2167,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): rate_func = running_start, ) C1.shift(vect) - self.dither() + self.wait() for mob in words, arrow: mob.save_state() @@ -2188,7 +2188,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): FadeIn(A1_yellow_copy) ) self.play(FadeIn(C0)) - self.dither() + self.wait() self.A1_yellow_copy = A1_yellow_copy def shorten_labels(self): @@ -2266,7 +2266,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): Write(inequality[0], run_time = 1), FadeIn(big_le), ) - self.dither() + self.wait() self.play(FadeIn(groups[1])) self.play( groups[1].restore, @@ -2280,7 +2280,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): FadeIn(inequality[2]), FadeIn(self.in_A_out_B_words), ) - self.dither(2) + self.wait(2) self.groups = groups self.inequality = inequality @@ -2316,7 +2316,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): Animation(foreground), run_time = 2 ) - self.dither() + self.wait() def write_50_percent(self): words = TextMobject( @@ -2328,7 +2328,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): words.move_to(5*LEFT + 2*UP) self.play(Write(words)) - self.dither() + self.wait() def write_assumption(self): words = TextMobject("Assume circles have the same size$^*$") @@ -2397,7 +2397,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction): new_B_to_C = rotate_vector(B_to_C, self.time*C_freq) A_group.shift(B_center + new_B_to_A - center_of_mass(A_ref)) C_group.shift(B_center + new_B_to_C - center_of_mass(C_ref)) - self.dither(self.frame_duration) + self.wait(self.frame_duration) move_around(3) self.add(self.footnote) @@ -2478,7 +2478,7 @@ class NoFirstMeasurementPreferenceBasedOnDirection(ShowVariousFilterPairs): Animation(all_pre_lines), ) self.add_foreground_mobject(all_pre_lines) - self.dither(7) + self.wait(7) diff --git a/old_projects/borsuk.py b/old_projects/borsuk.py index cd4b5a05..218cb38d 100644 --- a/old_projects/borsuk.py +++ b/old_projects/borsuk.py @@ -101,7 +101,7 @@ class FromPreviousTopologyVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class CheckOutMathologer(PiCreatureScene): CONFIG = { @@ -129,9 +129,9 @@ class CheckOutMathologer(PiCreatureScene): ShowCreation(rect), Write(name) ) - self.dither(2) + self.wait(2) self.change_mode("happy") - self.dither(2) + self.wait(2) def get_logo(self): logo = ImageMobject(self.logo_file) @@ -230,7 +230,7 @@ class IntroduceStolenNecklaceProblem(ThreeDScene): jewel_type.shift, 0.2*UP, rate_func = wiggle ) - self.dither() + self.wait() for x in range(self.num_shuffles): self.shuffle_jewels(jewels) self.play(FadeOut(self.title)) @@ -284,7 +284,7 @@ class IntroduceStolenNecklaceProblem(ThreeDScene): half_labels )) self.play(*[ApplyMethod(pi.change_mode, "pondering") for pi in thieves]) - self.dither() + self.wait() for type_index, jewel_type in enumerate(jewel_types): jewel_type.save_state() @@ -312,7 +312,7 @@ class IntroduceStolenNecklaceProblem(ThreeDScene): [thief.change_mode, "happy", thief.look_at, necklace] for thief in thieves ])) - self.dither() + self.wait() self.play(*[ jewel_type.restore for jewel_type in jewel_types @@ -375,7 +375,7 @@ class IntroduceStolenNecklaceProblem(ThreeDScene): ])) self.play(Blink(self.thieves[1])) else: - self.dither() + self.wait() if highlight_groups: for group in strand_groups: @@ -388,10 +388,10 @@ class IntroduceStolenNecklaceProblem(ThreeDScene): ) box.move_to(group) self.play(FadeIn(box)) - self.dither() + self.wait() self.play(FadeOut(box)) - self.dither() + self.wait() if show_matching_after_divvying: for jewel_type in jewel_types: self.play( @@ -402,7 +402,7 @@ class IntroduceStolenNecklaceProblem(ThreeDScene): rate_func = there_and_back, run_time = 2 ) - self.dither() + self.wait() self.play( FadeOut(v_lines), FadeIn(necklace.chain), @@ -505,7 +505,7 @@ class ThingToProve(PiCreatureScene): Write(bottom_words, run_time = 2), self.pi_creature.change_mode, "pondering" ) - self.dither(3) + self.wait(3) class FiveJewelCase(IntroduceStolenNecklaceProblem): CONFIG = { @@ -548,7 +548,7 @@ class DiscussApplicability(TeacherStudentsScene): allocate resources evenly """) self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) class ThreeJewelCase(FiveJewelCase): CONFIG = { @@ -583,7 +583,7 @@ class NowForTheTopology(TeacherStudentsScene): def construct(self): self.teacher_says("Now for the \\\\ topology") self.change_student_modes(*["hooray"]*3) - self.dither(3) + self.wait(3) class ExternallyAnimatedScene(Scene): def construct(self): @@ -606,7 +606,7 @@ class WriteWords(Scene): words.scale_to_fit_width(2*SPACE_WIDTH-1) words.to_edge(DOWN) self.play(Write(words)) - self.dither(2) + self.wait(2) class WriteNotAllowed(WriteWords): CONFIG = { @@ -650,7 +650,7 @@ class ClassicExample(TeacherStudentsScene): def construct(self): self.teacher_says("The classic example...") self.change_student_modes(*["happy"]*3) - self.dither(2) + self.wait(2) class AntipodalEarthPoints(ExternallyAnimatedScene): pass @@ -697,7 +697,7 @@ class TemperaturePressurePlane(GraphScene): self.play(ShowCreation(dot)) self.play(Write(tex)) - self.dither() + self.wait() self.play(FadeOut(tex)) def wander_continuously(self): @@ -712,7 +712,7 @@ class TemperaturePressurePlane(GraphScene): path.highlight(GREEN) self.play(ShowCreation(path, run_time = 10, rate_func = None)) - self.dither() + self.wait() class AlternateSphereSquishing(ExternallyAnimatedScene): pass @@ -725,7 +725,7 @@ class AskWhy(TeacherStudentsScene): self.student_says("But...why?") self.change_student_modes("pondering", None, "thinking") self.play(self.get_teacher().change_mode, "happy") - self.dither(3) + self.wait(3) class PointOutVSauce(CheckOutMathologer): CONFIG = { @@ -802,7 +802,7 @@ class WalkEquatorPostTransform(GraphScene): v_line = DashedLine(SPACE_HEIGHT*UP, SPACE_HEIGHT*DOWN) v_line.shift(dots.get_center()[0]*RIGHT) self.play(ShowCreation(v_line)) - self.dither() + self.wait() self.play(FadeOut(v_line)) dots.save_state() @@ -824,7 +824,7 @@ class WalkEquatorPostTransform(GraphScene): dot_movement.update(0) self.play(ReplacementTransform(equator.copy(), tilted_eq)) - self.dither() + self.wait() self.play(FadeIn(dots)) self.play(dot_movement) @@ -836,7 +836,7 @@ class WalkEquatorPostTransform(GraphScene): v_line = DashedLine(SPACE_HEIGHT*UP, SPACE_HEIGHT*DOWN) v_line.shift(dots.get_center()[0]*RIGHT) self.play(ShowCreation(v_line)) - self.dither() + self.wait() self.play(FadeOut(v_line)) self.play(*map(FadeOut, [tilted_eq, dots])) @@ -880,7 +880,7 @@ class WalkEquatorPostTransform(GraphScene): run_time = 10, rate_func = None, ) - self.dither(2) + self.wait(2) def walk_transverse_curve(self): transverse_curve = self.get_transverse_curve(self.great_arc_images) @@ -906,7 +906,7 @@ class WalkEquatorPostTransform(GraphScene): dots.scale_in_place, 1.2, rate_func = there_and_back ) - self.dither() + self.wait() ####### @@ -1022,13 +1022,13 @@ class MentionGenerality(TeacherStudentsScene, ThreeDScene): ] ) self.change_student_modes("pondering", "erm", "confused") - self.dither() + self.wait() self.play(*[ ApplyMethod(pi.look_at, arrow) for pi in self.get_pi_creatures() ]) self.play(Write(formula)) - self.dither(3) + self.wait(3) class SimpleSphere(ExternallyAnimatedScene): pass @@ -1068,12 +1068,12 @@ class PointsIn3D(Scene): self.play(Write(sphere_def[1])) self.play(ShowCreation(arrow)) self.play(Write(point_ex)) - self.dither() + self.wait() self.play( Animation(sphere_def[1].copy(), remover = True), Write(sphere_def), ) - self.dither() + self.wait() class AntipodalPairToBeGivenCoordinates(ExternallyAnimatedScene): pass @@ -1106,7 +1106,7 @@ class WritePointCoordinates(Scene): self.play(FadeIn(coords)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() def get_coords(self): coords = TexMobject( @@ -1161,19 +1161,19 @@ class GeneralizeBorsukUlam(Scene): rhs = VGroup(*equation[3:]) self.play(FadeIn(sphere_set)) - self.dither() + self.wait() self.play( ShowCreation(arrow), Write(f) ) self.play(Write(output_space)) - self.dither() + self.wait() self.play(FadeIn(lhs)) self.play( ReplacementTransform(lhs.copy(), rhs), Write(eq) ) - self.dither() + self.wait() def get_condition(self): squares = map(TexMobject, [ @@ -1266,7 +1266,7 @@ class MentionMakingNecklaceProblemContinuous(TeacherStudentsScene): a continuous problem. """) self.change_student_modes("confused", "pondering", "erm") - self.dither(3) + self.wait(3) class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): CONFIG = { @@ -1304,9 +1304,9 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): jewel_types = self.get_jewels_organized_by_type( self.necklace.jewels ) - self.dither() + self.wait() self.count_jewel_types(jewel_types) - self.dither() + self.wait() self.jewel_types = jewel_types @@ -1360,11 +1360,11 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): GrowFromCenter(brace), Write(brace_text) ) - self.dither() + self.wait() self.play( ShowCreation(interval.tick_marks), ) - self.dither() + self.wait() self.tick_marks = interval.tick_marks self.length_brace = VGroup(brace, brace_text) @@ -1408,7 +1408,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): group.shift, UP, Write(length_tex, run_time = 1), ) - self.dither() + self.wait() self.play( group.shift, DOWN, FadeOut(length_tex) @@ -1442,7 +1442,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): submobject_mode = "lagged_start", run_time = 2 )) - self.dither() + self.wait() return segments def find_continuous_fair_division(self): @@ -1471,13 +1471,13 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): line.move_to(point) self.play(ShowCreation(v_lines)) - self.dither() + self.wait() for target_points in cut_points[1:]: self.play(*[ ApplyMethod(line.move_to, point) for line, point in zip(v_lines, target_points) ]) - self.dither() + self.wait() self.slice_indices = slice_indices self.v_lines = v_lines @@ -1499,7 +1499,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): ApplyMethod(group.shift, 0.5*vect) for group, vect in zip(groups, vects) ]) - self.dither() + self.wait() self.groups = groups @@ -1532,7 +1532,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): self.play(FadeIn(boxes)) self.play(Write(weight_description)) - self.dither() + self.wait() self.highlight_box = boxes self.weight_description = weight_description @@ -1553,7 +1553,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): } )) self.play(Blink(morty)) - self.dither() + self.wait() self.play(*map(FadeOut, [ morty, morty.bubble, morty.bubble.content ])) @@ -1603,7 +1603,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): (right_tick, DOWN), ] ]) - self.dither() + self.wait() words = TextMobject("Cut part way through segment") words.to_edge(RIGHT) @@ -1613,7 +1613,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): VGroup(words, arrow1, arrow2).highlight(RED) self.play(Write(words), ShowCreation(arrow1)) - self.dither() + self.wait() emerald_segments.save_state() emerald_segments.generate_target() @@ -1628,7 +1628,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): self.play(MoveToTarget(emerald_segments)) self.play(GrowFromCenter(brace)) self.play(Write(label)) - self.dither() + self.wait() broken_pair = VGroup(*emerald_segments[2:4]) broken_pair.save_state() self.play(broken_pair.shift, 0.5*UP) @@ -1637,18 +1637,18 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem): broken_pair[0].shift, -vect/2, broken_pair[1].shift, vect/2, ) - self.dither() + self.wait() self.play(broken_pair.space_out_submobjects) self.play(broken_pair.restore) - self.dither() + self.wait() self.play( emerald_segments.restore, *map(FadeOut, [brace, label]) ) - self.dither() + self.wait() self.play(ShowCreation(arrow2)) - self.dither() + self.wait() self.play(*map(FadeOut, [words, arrow1, arrow2])) for line in v_lines: @@ -1667,7 +1667,7 @@ class ThinkAboutTheChoices(TeacherStudentsScene): *["pondering"]*3, look_at_arg = SPACE_WIDTH*RIGHT+SPACE_HEIGHT*DOWN ) - self.dither(3) + self.wait(3) class ChoicesInNecklaceCutting(ReconfigurableScene): CONFIG = { @@ -1737,12 +1737,12 @@ class ChoicesInNecklaceCutting(ReconfigurableScene): line.move_to(point) self.play(ShowCreation(v_lines)) for point_pair in point_pairs[1:]: - self.dither() + self.wait() self.play(*[ ApplyMethod(line.move_to, point) for line, point in zip(v_lines, point_pair) ]) - self.dither() + self.wait() self.division_points = list(it.chain( [self.interval.get_left()], @@ -1778,16 +1778,16 @@ class ChoicesInNecklaceCutting(ReconfigurableScene): for brace in braces ])) self.play(Write(words)) - self.dither(2) + self.wait(2) self.play(*[ ReplacementTransform(brace.label, brace.concrete_label) for brace in braces ]) - self.dither() + self.wait() self.wiggle_v_lines() - self.dither() + self.wait() self.transition_to_alt_config(denoms = [3, 3, 3]) - self.dither() + self.wait() self.play(*map(FadeOut, list(braces) + [ brace.concrete_label for brace in braces ])) @@ -1820,7 +1820,7 @@ class ChoicesInNecklaceCutting(ReconfigurableScene): curr_arrows, arrow_pairs, binary_choices ) ]) - self.dither() + self.wait() ###### @@ -1909,7 +1909,7 @@ class CompareThisToSphereChoice(TeacherStudentsScene): *["pondering"]*3, look_at_arg = SPACE_WIDTH*RIGHT+SPACE_HEIGHT*DOWN ) - self.dither(3) + self.wait(3) class SimpleRotatingSphereWithPoint(ExternallyAnimatedScene): pass @@ -1919,7 +1919,7 @@ class ChoicesForSpherePoint(GeneralizeBorsukUlam): self.add_sphere_set() self.initialize_words() self.play(Write(self.choice_one_words)) - self.dither() + self.wait() self.show_example_choices() self.show_binary_choices() @@ -1989,7 +1989,7 @@ class ChoicesForSpherePoint(GeneralizeBorsukUlam): run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.choices = choices @@ -2022,7 +2022,7 @@ class ChoicesForSpherePoint(GeneralizeBorsukUlam): self.play(ShowCreation(arrows)) self.play(FadeIn(sqrts, submobject_mode = "lagged_start")) self.play(Write(self.choice_two_words)) - self.dither() + self.wait() class NecklaceDivisionSphereAssociation(ChoicesInNecklaceCutting): CONFIG = { @@ -2089,14 +2089,14 @@ class NecklaceDivisionSphereAssociation(ChoicesInNecklaceCutting): map(GrowFromCenter, braces), [Write(brace.label) for brace in braces] )) - self.dither() + self.wait() self.braces = braces def add_boxes_and_labels(self): boxes, labels = self.get_boxes_and_labels() self.play(*map(FadeIn, [boxes, labels])) - self.dither() + self.wait() def show_binary_choice_association(self): groups = self.get_groups() @@ -2127,12 +2127,12 @@ class NecklaceDivisionSphereAssociation(ChoicesInNecklaceCutting): ), group.move_to, group.target_points[0] ) - self.dither() + self.wait() self.play( Transform(*choices), group.move_to, group.target_points[1] ) - self.dither() + self.wait() if final_choice == 0: self.play( Transform(choices[0], original_choices[0]), @@ -2154,13 +2154,13 @@ class NecklaceDivisionSphereAssociation(ChoicesInNecklaceCutting): self.play(FadeOut(self.sphere_point_label)) self.play(FadeIn(question)) - self.dither() + self.wait() self.play(Write(antipodal_tex)) - self.dither() + self.wait() self.wiggle_v_lines() - self.dither() + self.wait() self.play(*self.swapping_anims) - self.dither() + self.wait() class SimpleRotatingSphereWithAntipodes(ExternallyAnimatedScene): pass @@ -2199,12 +2199,12 @@ class TotalLengthOfEachJewelEquals(NecklaceDivisionSphereAssociation, ThreeDScen ApplyMethod(line.move_to, segments[index].get_right()) for line, index in zip(v_lines, indices) ]) - self.dither() + self.wait() self.play(*[ ApplyMethod(group.move_to, group.target_points[choice]) for group, choice in zip(groups, binary_choice) ]) - self.dither() + self.wait() self.groups = groups self.v_lines = v_lines @@ -2270,12 +2270,12 @@ class TotalLengthOfEachJewelEquals(NecklaceDivisionSphereAssociation, ThreeDScen MoveToTarget(group), FadeIn(label), ) - self.dither() + self.wait() self.play( FadeOut(labels), *[group.restore for group in monochrome_groups] ) - self.dither() + self.wait() def perform_antipodal_swap(self): binary_choices_list = [(1, 0, 1), (0, 1, 0)] @@ -2287,7 +2287,7 @@ class TotalLengthOfEachJewelEquals(NecklaceDivisionSphereAssociation, ThreeDScen ) for group, choice in zip(self.groups, binary_choices) ]) - self.dither() + self.wait() class ExclaimBorsukUlam(TeacherStudentsScene): def construct(self): @@ -2299,7 +2299,7 @@ class ExclaimBorsukUlam(TeacherStudentsScene): ApplyMethod(pi.change_mode, "hooray") for pi in self.get_pi_creatures() ]) - self.dither(3) + self.wait(3) class ShowFunctionDiagram(TotalLengthOfEachJewelEquals, ReconfigurableScene): CONFIG = { @@ -2348,25 +2348,25 @@ class ShowFunctionDiagram(TotalLengthOfEachJewelEquals, ReconfigurableScene): self.play(ShowCreation(arrow)) self.play(Write(t1_plane), Animation(arrow)) - self.dither() + self.wait() clean_state = VGroup(*self.mobjects).family_members_with_points() self.clear() self.add(*clean_state) self.transition_to_alt_config( make_up_fair_division_indices = True ) - self.dither() + self.wait() t1_plane.save_state() self.play( Transform(*planes, path_arc = np.pi), Animation(arrow) ) - self.dither(2) + self.wait(2) self.play( ApplyMethod(t1_plane.restore, path_arc = np.pi), Animation(arrow) ) - self.dither() + self.wait() def swap_necklace_allocation(self): for choices in [(1, 0, 1), (0, 1, 0)]: @@ -2374,7 +2374,7 @@ class ShowFunctionDiagram(TotalLengthOfEachJewelEquals, ReconfigurableScene): ApplyMethod(group.move_to, group.target_points[i]) for group, i in zip(self.groups, choices) ]) - self.dither() + self.wait() def add_sphere_arrow(self): up_down_arrow = TexMobject("\\updownarrow") @@ -2389,9 +2389,9 @@ class ShowFunctionDiagram(TotalLengthOfEachJewelEquals, ReconfigurableScene): ) self.play(Write(up_down_arrow)) - self.dither() + self.wait() self.play(ShowCreation(to_plane_arrow)) - self.dither() + self.wait() def get_fair_division_indices(self, *args): if self.make_up_fair_division_indices: @@ -2436,7 +2436,7 @@ class WhatThisMappingActuallyLooksLikeWords(Scene): words.to_edge(DOWN) self.play(Write(words)) - self.dither() + self.wait() class WhatAboutGeneralCase(TeacherStudentsScene): def construct(self): @@ -2445,16 +2445,16 @@ class WhatAboutGeneralCase(TeacherStudentsScene): there's more than 2 jewels? """) self.change_student_modes("confused", None, "sassy") - self.dither() + self.wait() self.play(self.get_teacher().change_mode, "thinking") - self.dither() + self.wait() self.teacher_says( """Use Borsuk-Ulam for higher-dimensional spheres """, target_mode = "hooray" ) self.change_student_modes(*["confused"]*3) - self.dither(2) + self.wait(2) class Simple3DSpace(ExternallyAnimatedScene): pass @@ -2493,24 +2493,24 @@ class FourDBorsukUlam(GeneralizeBorsukUlam, PiCreatureScene): self.play(FadeIn(sphere_set)) self.change_mode("confused") - self.dither() + self.wait() self.play( ShowCreation(arrow), Write(f) ) self.play(Write(output_space)) - self.dither() + self.wait() self.change_mode("maybe") - self.dither(2) + self.wait(2) self.change_mode("pondering") - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(brace_text) ) - self.dither() + self.wait() self.play(*map(FadeOut, [brace, brace_text])) - self.dither() + self.wait() self.play( FadeIn(lhs), self.pi_creature.change_mode, "raise_right_hand" @@ -2519,7 +2519,7 @@ class FourDBorsukUlam(GeneralizeBorsukUlam, PiCreatureScene): ReplacementTransform(lhs.copy(), rhs), Write(eq) ) - self.dither(2) + self.wait(2) def get_sphere_set(self): sphere_set = GeneralizeBorsukUlam.get_sphere_set(self) @@ -2558,9 +2558,9 @@ class CircleToSphereToQMarks(Scene): pi_groups.arrange_submobjects(buff = -1) for mob in pi_groups: self.play(FadeIn(mob)) - self.dither(2) + self.wait(2) self.play(pi_groups[-1][0].change_mode, "thinking") - self.dither(2) + self.wait(2) class BorsukPatreonThanks(PatreonThanks): CONFIG = { @@ -2617,19 +2617,19 @@ class MortyLookingAtRectangle(Scene): ) self.play(Write(url)) self.play(Blink(morty)) - self.dither() + self.wait() self.play( url.restore, morty.change_mode, "happy" ) self.play(ShowCreation(rect)) - self.dither() + self.wait() self.play(Blink(morty)) for mode in ["pondering", "hooray", "happy", "pondering", "happy"]: self.play(morty.change_mode, mode) - self.dither(2) + self.wait(2) self.play(Blink(morty)) - self.dither(2) + self.wait(2) class RotatingThreeDSphereProjection(Scene): CONFIG = { diff --git a/old_projects/brachistochrone/curves.py b/old_projects/brachistochrone/curves.py index 6eb00db7..d51f4d74 100644 --- a/old_projects/brachistochrone/curves.py +++ b/old_projects/brachistochrone/curves.py @@ -128,7 +128,7 @@ class BrachistochroneWordSliding(Scene): anim.path.gradient_highlight(WHITE, BLUE_E) self.play(ShowCreation(anim.path)) self.play(anim) - self.dither() + self.wait() self.play( FadeOut(anim.path), ApplyMethod(anim.mobject.center) @@ -140,7 +140,7 @@ class PathSlidingScene(Scene): CONFIG = { "gravity" : 3, "delta_t" : 0.05, - "dither_and_add" : True, + "wait_and_add" : True, "show_time" : True, } def slide(self, mobject, path, roll = False, ceiling = None): @@ -166,7 +166,7 @@ class PathSlidingScene(Scene): self.add(self.slider) if self.show_time: self.write_time(curr_t) - self.dither(self.frame_duration) + self.wait(self.frame_duration) self.remove(self.slider) curr_t += self.delta_t last_index = curr_index @@ -174,9 +174,9 @@ class PathSlidingScene(Scene): curr_index += 1 if curr_index == len(points): break - if self.dither_and_add: + if self.wait_and_add: self.add(self.slider) - self.dither() + self.wait() else: return self.slider @@ -248,7 +248,7 @@ class TryManyPaths(PathSlidingScene): for point, tex in [(point_a, A), (point_b, B)]: self.play(ShowCreation(point)) self.play(ShimmerIn(tex)) - self.dither() + self.wait() curr_path = None for path in paths: new_slider = self.adjust_mobject_to_index( @@ -260,7 +260,7 @@ class TryManyPaths(PathSlidingScene): else: self.play(Transform(curr_path, path)) self.play(Transform(self.slider, new_slider)) - self.dither() + self.wait() self.remove(self.slider) self.slide(randy, curr_path) self.clear() @@ -361,7 +361,7 @@ class NotTheCircle(PathSlidingScene): self.remove(randy_copy) self.slide(randy, path) self.play(ShimmerIn(words)) - self.dither() + self.wait() class TransitionAwayFromSlide(PathSlidingScene): @@ -449,14 +449,14 @@ class MinimalPotentialEnergy(Scene): ShowCreation(arrow), ShowCreation(min_point) ) - self.dither() + self.wait() self.play( FadeOut(top_words[0]), FadeOut(last_side_words[0]), GrowFromCenter(top_words[1]), GrowFromCenter(last_side_words[1]) ) - self.dither(3) + self.wait(3) @@ -464,7 +464,7 @@ class MinimalPotentialEnergy(Scene): class WhatGovernsSpeed(PathSlidingScene): CONFIG = { "num_pieces" : 6, - "dither_and_add" : False, + "wait_and_add" : False, "show_time" : False, } def construct(self): @@ -497,9 +497,9 @@ class WhatGovernsSpeed(PathSlidingScene): self.add(slider, vector) sliders.append(slider) vectors.append(vector) - self.dither() + self.wait() self.play(ShimmerIn(words)) - self.dither(3) + self.wait(3) slider = sliders.pop(1) vector = vectors.pop(1) faders = sliders+vectors+[words] @@ -539,7 +539,7 @@ class WhatGovernsSpeed(PathSlidingScene): GrowFromCenter(vect_brace), ShimmerIn(sqrt_y) ) - self.dither(3) + self.wait(3) self.solve_energy() def solve_energy(self): @@ -573,19 +573,19 @@ class WhatGovernsSpeed(PathSlidingScene): ), *map(GrowFromCenter, potential.split()) ) - self.dither(2) + self.wait(2) self.play( FadeOut(loss_in_potential), GrowFromCenter(kinetic) ) - self.dither(2) + self.wait(2) self.play(ApplyMethod(ms.shift, 5*UP)) - self.dither() + self.wait() self.play(Transform( half, two, path_func = counterclockwise_path() )) - self.dither() + self.wait() self.play( Transform( squared, sqrt, @@ -593,7 +593,7 @@ class WhatGovernsSpeed(PathSlidingScene): ), Transform(equals, new_eq) ) - self.dither(2) + self.wait(2) @@ -622,7 +622,7 @@ class ThetaTInsteadOfXY(Scene): self.play(ShowCreation(cycloid)) self.play(ShowCreation(dot)) self.play(ShimmerIn(xy)) - self.dither() + self.wait() self.play( FadeOut(xy), ShowCreation(vect_mob) @@ -632,7 +632,7 @@ class ThetaTInsteadOfXY(Scene): ShowCreation(vert_line), ShimmerIn(theta) ) - self.dither() + self.wait() class DefineCurveWithKnob(PathSlidingScene): @@ -658,11 +658,11 @@ class DefineCurveWithKnob(PathSlidingScene): self.play(ShimmerIn(words)) self.play(ShowCreation(arrow)) self.play(ShowCreation(self.knob)) - self.dither() + self.wait() self.add(self.path) self.slide(randy, self.path) - self.dither() + self.wait() def get_path(self): diff --git a/old_projects/brachistochrone/cycloid.py b/old_projects/brachistochrone/cycloid.py index 4ac964fe..695a1c0d 100644 --- a/old_projects/brachistochrone/cycloid.py +++ b/old_projects/brachistochrone/cycloid.py @@ -127,17 +127,17 @@ class IntroduceCycloid(CycloidScene): q_mark = TextMobject("?") self.play(*map(ShimmerIn, equation.split())) - self.dither() + self.wait() self.play( ApplyMethod(equation.shift, 2.2*UP), ShowCreation(arrow) ) q_mark.next_to(sin_sqrt) self.play(ShimmerIn(cycloid_word)) - self.dither() + self.wait() self.grow_parts() self.draw_cycloid() - self.dither() + self.wait() extra_terms = [const, arrow, cycloid_word] self.play(*[ Transform(mob, q_mark) @@ -150,7 +150,7 @@ class IntroduceCycloid(CycloidScene): ShowCreation(q_marks), ShowCreation(arrows) ) - self.dither() + self.wait() def get_q_marks_and_arrows(self, mob, n_marks = 10): circle = Circle().replace(mob) @@ -194,7 +194,7 @@ class LeviSolution(CycloidScene): ] for method in methods: method() - self.dither() + self.wait() def generate_points(self): @@ -224,7 +224,7 @@ class LeviSolution(CycloidScene): self.remove(radial_line) self.add(self.p_dot) self.play(ShimmerIn(self.p_label)) - self.dither() + self.wait() self.play(Transform(self.ceiling.copy(), self.c_dot)) self.play(ShimmerIn(self.c_label)) @@ -250,7 +250,7 @@ class LeviSolution(CycloidScene): self.play(ShowCreation(line)) self.play(ShimmerIn(words)) - self.dither() + self.wait() pairs = [ (line_angle, arc_angle/2), (line_angle+arc_angle/2, -arc_angle), @@ -275,11 +275,11 @@ class LeviSolution(CycloidScene): run_time = 2 ) arcs.append(arc) - self.dither() + self.wait() self.play(Transform(arcs[1], tangent_line)) self.add(tangent_line) self.play(ShowCreation(right_angle_symbol)) - self.dither() + self.wait() self.tangent_line = tangent_line self.right_angle_symbol = right_angle_symbol @@ -309,11 +309,11 @@ class LeviSolution(CycloidScene): self.remove(*everything) self.play(Transform(everything_copy, dark_everything)) - self.dither() + self.wait() self.play(ShowCreation(diameter)) self.play(GrowFromCenter(brace)) self.play(ShimmerIn(diameter_word)) - self.dither() + self.wait() self.play(*[ Transform(mob, d_mob) for mob in brace, diameter_word @@ -377,12 +377,12 @@ class LeviSolution(CycloidScene): Transform(self.theta.copy(), new_theta), run_time = 3 ) - self.dither() + self.wait() self.play(FadeIn(triangle1)) - self.dither() + self.wait() self.play(Transform(triangle1, triangle2)) self.play(ApplyMethod(triangle1.highlight, MAROON)) - self.dither() + self.wait() self.remove(triangle1) self.add(y_line) @@ -409,7 +409,7 @@ class LeviSolution(CycloidScene): self.play(Transform(mob, trig_mob)) self.add(trig_mob) - self.dither() + self.wait() self.remove(mob) self.d_sin_squared_theta = trig_mob @@ -456,7 +456,7 @@ class LeviSolution(CycloidScene): ApplyMethod(squared.shift, 4*UP), ApplyMethod(theta.shift, 1.5* squared.get_width()*LEFT) ) - self.dither() + self.wait() y_sqrt.add(y) d_sqrt.add(d) sin.add(theta) @@ -485,7 +485,7 @@ class LeviSolution(CycloidScene): ), run_time = 2 ) - self.dither() + self.wait() brace = Brace(d_sqrt, DOWN) constant = TextMobject("Constant") @@ -514,12 +514,12 @@ class EquationsForCycloid(CycloidScene): self.play(ShimmerIn(equations)) self.grow_parts() self.draw_cycloid(rate_func = None, run_time = 5) - self.dither() + self.wait() class SlidingObject(CycloidScene, PathSlidingScene): CONFIG = { "show_time" : False, - "dither_and_add" : False + "wait_and_add" : False } args_list = [(True,), (False,)] @@ -557,17 +557,17 @@ class SlidingObject(CycloidScene, PathSlidingScene): self.play(ShowCreation(self.cycloid.copy())) self.slide(randy, self.cycloid) self.add(self.slider) - self.dither() + self.wait() self.grow_parts() self.draw_cycloid() - self.dither() + self.wait() self.play(Transform(self.slider, start_randy)) - self.dither() + self.wait() self.roll_back() - self.dither() + self.wait() if with_words: self.play(*map(ShimmerIn, [words1, arrow, words2])) - self.dither() + self.wait() self.remove(self.circle) start_time = len(self.frames)*self.frame_duration self.remove(self.slider) @@ -584,7 +584,7 @@ class SlidingObject(CycloidScene, PathSlidingScene): ) ) self.add(self.circle, self.slider) - self.dither() + self.wait() diff --git a/old_projects/brachistochrone/drawing_images.py b/old_projects/brachistochrone/drawing_images.py index f30b61f6..ade0b6fc 100644 --- a/old_projects/brachistochrone/drawing_images.py +++ b/old_projects/brachistochrone/drawing_images.py @@ -170,7 +170,7 @@ class TracePicture(Scene): ) ) self.remove(edge_mobject) - self.dither() + self.wait() def get_edge_mobject(self, image_array): @@ -235,7 +235,7 @@ class JohannThinksHeIsBetter(Scene): lightbulb.next_to(upper_point, RIGHT) self.add(johann) - self.dither() + self.wait() self.play( Transform(johann, pensive_johann), Transform(point, bubble), @@ -249,7 +249,7 @@ class JohannThinksHeIsBetter(Scene): ShowCreation(greater_than), FadeIn(weakling) ) - self.dither(2) + self.wait(2) for guy in guys[2:]: self.play(DelayByOrder(Transform( weakling, upper_point @@ -258,12 +258,12 @@ class JohannThinksHeIsBetter(Scene): FadeIn(guy), ShimmerIn(guy.name_mob) ) - self.dither(3) + self.wait(3) self.remove(guy.name_mob) weakling = guy self.play(FadeOut(weakling), FadeOut(greater_than)) self.play(ShowCreation(lightbulb)) - self.dither() + self.wait() self.play(FadeOut(comparitive_johann), FadeOut(lightbulb)) self.play(ApplyMethod( Mobject(johann, bubble).scale, 10, @@ -290,7 +290,7 @@ class NewtonVsJohann(Scene): ApplyMethod(newton.replace, johann, **kwargs), ApplyMethod(johann.replace, newton, **kwargs), ) - self.dither() + self.wait() class JohannThinksOfFermat(Scene): @@ -310,9 +310,9 @@ class JohannThinksOfFermat(Scene): self.add(johann, bubble) - self.dither() + self.wait() self.play(FadeIn(fermat)) - self.dither() + self.wait() class MathematiciansOfEurope(Scene): @@ -359,7 +359,7 @@ class OldNewtonIsDispleased(Scene): self.play(ShimmerIn(words)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() class NewtonConsideredEveryoneBeneathHim(Scene): @@ -397,9 +397,9 @@ class NewtonConsideredEveryoneBeneathHim(Scene): Transform(newton, new_newton), GrowFromCenter(johann) ) - self.dither() + self.wait() self.play(FadeIn(Mobject(*mathematicians))) - self.dither() + self.wait() diff --git a/old_projects/brachistochrone/graveyard.py b/old_projects/brachistochrone/graveyard.py index 97cd9143..1e73d6ef 100644 --- a/old_projects/brachistochrone/graveyard.py +++ b/old_projects/brachistochrone/graveyard.py @@ -62,13 +62,13 @@ class MultilayeredGlass(PhotonScene, ZoomedScene): self.add(*self.layers) continuous = self.get_continuous_background() self.add(continuous) - self.dither() + self.wait() self.play(ShowCreation( continuous, rate_func = lambda t : smooth(1-t) )) self.remove(continuous) - self.dither() + self.wait() def get_continuous_background(self): glass = FilledRectangle( @@ -183,11 +183,11 @@ class MultilayeredGlass(PhotonScene, ZoomedScene): photon_run, run_time = time ) - self.dither() + self.wait() for start_y, brace in zip(start_ys, braces): self.add(start_y) self.play(GrowFromCenter(brace)) - self.dither() + self.wait() quads = zip(v_equations, start_ys, end_ys, braces) self.equations = [] for v_eq, start_y, end_y, brace in quads: @@ -242,7 +242,7 @@ class MultilayeredGlass(PhotonScene, ZoomedScene): run_time = 2 )) self.play(*map(ShowCreation, figure_marks)) - self.dither() + self.wait() equation_frame = little_square.copy() equation_frame.scale(0.5) equation_frame.shift( @@ -281,12 +281,12 @@ class MultilayeredGlass(PhotonScene, ZoomedScene): ] self.add(start) - self.dither(2) + self.wait(2) self.play(Transform( start, end, path_func = counterclockwise_path() )) - self.dither(2) + self.wait(2) self.remove(start, end) def show_main_equation(self): @@ -299,7 +299,7 @@ class MultilayeredGlass(PhotonScene, ZoomedScene): (self.layer_tops[0]-self.equation.get_top())*UP ) self.add(self.equation) - self.dither() + self.wait() def ask_continuous_question(self): continuous = self.get_continuous_background() @@ -340,5 +340,5 @@ class MultilayeredGlass(PhotonScene, ZoomedScene): theta.shift(point) theta.shift(0.15*vect) self.add(theta) - self.dither(self.frame_duration) + self.wait(self.frame_duration) self.remove(arc) \ No newline at end of file diff --git a/old_projects/brachistochrone/light.py b/old_projects/brachistochrone/light.py index 1e84cfd7..2ebc4545 100644 --- a/old_projects/brachistochrone/light.py +++ b/old_projects/brachistochrone/light.py @@ -80,7 +80,7 @@ class SimplePhoton(PhotonScene): self.play(self.photon_run_along_path( Cycloid(), rate_func = None )) - self.dither() + self.wait() class MultipathPhotonScene(PhotonScene): @@ -105,7 +105,7 @@ class MultipathPhotonScene(PhotonScene): ), **kwargs ) - self.dither() + self.wait() def generate_paths(self): raise Exception("Not Implemented") @@ -236,7 +236,7 @@ class ShowMultiplePathsScene(PhotonScene): self.remove(curr_path_copy) for path in paths[1:] + [paths[0]]: self.play(Transform(curr_path, path, run_time = 4)) - self.dither() + self.wait() self.path = curr_path.ingest_submobjects() def generate_start_and_end_points(self): @@ -320,21 +320,21 @@ class ShowMultiplePathsInWater(ShowMultiplePathsScene): self.add(glass) self.play(GrowFromCenter(air)) self.play(GrowFromCenter(water)) - self.dither() + self.wait() self.remove(air, water) ShowMultiplePathsScene.construct(self) self.play( Transform(self.path, straight) ) - self.dither() + self.wait() self.play(GrowFromCenter(slow)) - self.dither() + self.wait() self.remove(slow) self.leftmost.ingest_submobjects() self.play(Transform(self.path, self.leftmost, run_time = 3)) - self.dither() + self.wait() self.play(ShimmerIn(too_long)) - self.dither() + self.wait() def generate_start_and_end_points(self): @@ -375,7 +375,7 @@ class StraightLinesFastestInConstantMedium(PhotonScene): path_func = path_along_arc(np.pi) )) self.play(self.photon_run_along_path(line, rate_func = None)) - self.dither() + self.wait() def get_paths(self): @@ -418,13 +418,13 @@ class PhtonBendsInWater(PhotonScene, ZoomedScene): self.add(glass) self.play(ShowCreation(path1)) self.play(Transform(path1, path2)) - self.dither() + self.wait() # self.activate_zooming() - self.dither() + self.wait() self.play(ShowPassingFlash( wave, run_time = 3, rate_func = None )) - self.dither() + self.wait() self.play(ShowCreation(extension)) self.play( ShowCreation(arc), @@ -442,14 +442,14 @@ class LightIsFasterInAirThanWater(ShowMultiplePathsInWater): self.add(glass) self.play(ShimmerIn(equation)) - self.dither() + self.wait() photon_runs = [] photon_runs.append(self.photon_run_along_path( path1, rate_func = lambda t : min(1, 1.2*t) )) photon_runs.append(self.photon_run_along_path(path2)) self.play(*photon_runs, **{"run_time" : 2}) - self.dither() + self.wait() class GeometryOfGlassSituation(ShowMultiplePathsInWater): @@ -523,7 +523,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater): self.add(glass, point_a, point_b, A, B) line = Mobject(top_line, bottom_line).ingest_submobjects() self.play(ShowCreation(line)) - self.dither() + self.wait() self.play( GrowFromCenter(left_brace), GrowFromCenter(x_mob) @@ -536,7 +536,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater): self.play(ShowCreation(right_line), GrowFromCenter(h_2)) self.play(ShimmerIn(top_dist)) self.play(GrowFromCenter(bottom_dist)) - self.dither(3) + self.wait(3) self.clear() self.add(glass, point_a, point_b, A, B, top_line, bottom_line, left_brace, x_mob) @@ -553,7 +553,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater): (x_mob, end_x_mob) ] ]+[ShowCreation(graph, **kwargs)]) - self.dither() + self.wait() self.show_derivatives(graph) line = self.show_derivatives(new_graph) self.add(line) @@ -561,7 +561,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater): Transform(*pair, rate_func = lambda x : 0.3*smooth(x)) for pair in pairs_for_end_transform ]) - self.dither() + self.wait() def show_derivatives(self, graph, run_time = 2): step = self.frame_duration/run_time @@ -572,7 +572,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater): line.rotate(angle_of_vector(p2-p1)) line.shift(p1) self.add(line) - self.dither(self.frame_duration) + self.wait(self.frame_duration) self.remove(line) return line @@ -630,7 +630,7 @@ class SpringSetup(ShowMultiplePathsInWater): self.add_rod_and_ring(rod, ring) self.slide_ring(ring) - self.dither() + self.wait() self.add_springs() self.add_force_definitions() self.slide_system(ring) @@ -662,14 +662,14 @@ class SpringSetup(ShowMultiplePathsInWater): rod_word.next_to(Point(), UP) ring_word = TextMobject("Ring") ring_word.next_to(ring, UP) - self.dither() + self.wait() self.add(rod) self.play(ShimmerIn(rod_word)) - self.dither() + self.wait() self.remove(rod_word) self.play(ShowCreation(ring)) self.play(ShimmerIn(ring_word)) - self.dither() + self.wait() self.remove(ring_word) def slide_ring(self, ring): @@ -689,7 +689,7 @@ class SpringSetup(ShowMultiplePathsInWater): self.play(Transform(circle, spring)) self.remove(circle) self.add(spring) - self.dither() + self.wait() def add_force_definitions(self): top_force = TexMobject("F_1 = \\dfrac{1}{v_{\\text{air}}}") @@ -704,9 +704,9 @@ class SpringSetup(ShowMultiplePathsInWater): words.to_corner(UP+RIGHT) for force in top_force, bottom_force: self.play(GrowFromCenter(force)) - self.dither() + self.wait() self.play(ShimmerIn(words)) - self.dither(3) + self.wait(3) self.remove(top_force, bottom_force, words) def slide_system(self, ring): @@ -724,13 +724,13 @@ class SpringSetup(ShowMultiplePathsInWater): ) for kwargs in self.slide_kwargs, equilibrium_slide_kwargs: self.play(Transform(start, end, **kwargs)) - self.dither() + self.wait() def show_horizontal_component(self, ring): v_right = Vector(ring.get_top(), RIGHT) v_left = Vector(ring.get_bottom(), LEFT) self.play(*map(ShowCreation, [v_right, v_left])) - self.dither() + self.wait() self.remove(v_right, v_left) def show_angles(self, ring): @@ -769,7 +769,7 @@ class SpringSetup(ShowMultiplePathsInWater): GrowFromCenter(theta) ] self.play(*anims) - self.dither() + self.wait() def show_equation(self): equation = TexMobject([ @@ -813,7 +813,7 @@ class SpringSetup(ShowMultiplePathsInWater): for mob in f1, sin1, equals, f2, sin2_start: anims.append(ShimmerIn(mob)) self.play(*anims) - self.dither() + self.wait() for f, frac in (f1, frac1), (f2, frac2): target = frac.copy().ingest_submobjects() also = [] @@ -823,7 +823,7 @@ class SpringSetup(ShowMultiplePathsInWater): self.play(Transform(f, target), *also) self.remove(f) self.add(frac) - self.dither() + self.wait() self.play( FadeOut(frac1), FadeOut(frac2), @@ -832,16 +832,16 @@ class SpringSetup(ShowMultiplePathsInWater): ShowCreation(bars), Transform(equals, new_eq) ) - self.dither() + self.wait() frac1 = Mobject(sin1, bar1, v_air) frac2 = Mobject(sin2, bar2, v_water) for frac, vect in (frac1, LEFT), (frac2, RIGHT): self.play(ApplyMethod( frac.next_to, equals, vect )) - self.dither() + self.wait() self.play(ShimmerIn(snells)) - self.dither() + self.wait() class WhatGovernsTheSpeedOfLight(PhotonScene, PathSlidingScene): def construct(self): @@ -854,7 +854,7 @@ class WhatGovernsTheSpeedOfLight(PhotonScene, PathSlidingScene): self.slide(randy, self.cycloid) self.play(self.photon_run_along_path(self.cycloid)) - self.dither() + self.wait() class WhichPathWouldLightTake(PhotonScene, TryManyPaths): def construct(self): @@ -919,18 +919,18 @@ class StateSnellsLaw(PhotonScene): snells_law.to_edge(UP) self.play(ShimmerIn(snells_law)) - self.dither() + self.wait() self.play(ShowCreation(path)) self.play(self.photon_run_along_path(path)) - self.dither() + self.wait() self.play(ShowCreation(vert_line)) self.play(*map(ShowCreation, arcs)) self.play(*map(GrowFromCenter, thetas)) - self.dither() + self.wait() self.play(ShimmerIn(exp1)) - self.dither() + self.wait() self.play(*map(ShimmerIn, [equals, exp2])) - self.dither() + self.wait() diff --git a/old_projects/brachistochrone/misc.py b/old_projects/brachistochrone/misc.py index 13d07308..d3a2050f 100644 --- a/old_projects/brachistochrone/misc.py +++ b/old_projects/brachistochrone/misc.py @@ -52,7 +52,7 @@ class PhysicalIntuition(Scene): for term in terms.split(): self.play(ShimmerIn(term, run_time = 0.5)) - self.dither() + self.wait() self.play(ShowCreation(plane), ShowCreation(axes)) self.play(*[ Transform(*pair) @@ -100,7 +100,7 @@ class TimeLine(Scene): timeline.shift(-centers[0].get_center()) self.add(timeline) - self.dither() + self.wait() run_times = iter([3, 1]) for point, event in zip(centers[1:], dated_events): self.play(ApplyMethod( @@ -122,7 +122,7 @@ class TimeLine(Scene): ShimmerIn(date_mob) ) self.play(FadeIn(picture)) - self.dither(3) + self.wait(3) self.play(*map(FadeOut, [event_mob, date_mob, line, picture])) @@ -198,29 +198,29 @@ class StayedUpAllNight(Scene): Rotating(minute_hand, radians = -12*2*np.pi, **kwargs), run_time = 5 ) - self.dither() + self.wait() self.clear() self.add(newton) clock.ingest_submobjects() self.play(Transform(clock, solution)) self.remove(clock) self.add(solution) - self.dither() + self.wait() self.play( FadeIn(phil_trans), Transform(solution, new_solution) ) - self.dither() + self.wait() self.play(ShimmerIn(not_newton)) phil_trans.add(solution, not_newton) - self.dither() + self.wait() self.play(*map(ShimmerIn, newton_complaint.split())) - self.dither() + self.wait() self.play( ShimmerIn(dunned_def), ShowCreation(dunned_arrow) ) - self.dither() + self.wait() self.remove(dunned_def, dunned_arrow) self.play(FadeOut(newton_complaint)) self.remove(newton_complaint) @@ -229,9 +229,9 @@ class StayedUpAllNight(Scene): GrowFromCenter(johann) ) self.remove(newton) - self.dither() + self.wait() self.play(ShimmerIn(johann_quote)) - self.dither() + self.wait() class ThetaTGraph(Scene): @@ -270,14 +270,14 @@ class ThetaTGraph(Scene): ShimmerIn(q_mark), ShowCreation(graph) ) - self.dither() + self.wait() self.play( Transform(q_mark, stars), Transform(graph, line) ) - self.dither() + self.wait() self.play(Transform(graph, squiggle)) - self.dither() + self.wait() class SolutionsToTheBrachistochrone(Scene): @@ -318,7 +318,7 @@ class SolutionsToTheBrachistochrone(Scene): self.play(ShowCreation(x_axis), ShimmerIn(x_label)) self.play(ShowCreation(y_axis), ShimmerIn(y_label)) self.play(ShowCreation(cycloids)) - self.dither() + self.wait() self.play( Transform(cycloids, lines), Transform(x_axis, t_axis), @@ -326,9 +326,9 @@ class SolutionsToTheBrachistochrone(Scene): Transform(y_label, theta_label), run_time = 2 ) - self.dither() + self.wait() self.play(ShimmerIn(words)) - self.dither() + self.wait() class VideoLayout(Scene): @@ -376,10 +376,10 @@ class VideoLayout(Scene): self.play(ShowCreation(line)) for brace in left_brace, right_brace: self.play(GrowFromCenter(brace)) - self.dither() + self.wait() for word in brace.words: self.play(ShimmerIn(word)) - self.dither() + self.wait() @@ -416,7 +416,7 @@ class ShortestPathProblem(Scene): path, line, path_func = path_along_arc(np.pi) )) - self.dither() + self.wait() class MathBetterThanTalking(Scene): @@ -430,7 +430,7 @@ class MathBetterThanTalking(Scene): self.add(mathy) self.play(ShowCreation(bubble)) self.play(ShimmerIn(bubble.content)) - self.dither() + self.wait() self.play(ApplyMethod( mathy.blink, rate_func = squish_rate_func(there_and_back, 0.4, 0.6) @@ -447,7 +447,7 @@ class DetailsOfProofBox(Scene): ShowCreation(rect), ShimmerIn(words) ) - self.dither() + self.wait() @@ -479,7 +479,7 @@ class TalkedAboutSnellsLaw(Scene): talker.blink, rate_func = squish_rate_func(there_and_back) )) - self.dither() + self.wait() self.remove(talker.bubble, talker.bubble.content) @@ -493,7 +493,7 @@ class YetAnotherMarkLevi(Scene): self.add(levi) self.play(ShimmerIn(words)) - self.dither(2) + self.wait(2) diff --git a/old_projects/brachistochrone/multilayered.py b/old_projects/brachistochrone/multilayered.py index f25dbfb7..29075d30 100644 --- a/old_projects/brachistochrone/multilayered.py +++ b/old_projects/brachistochrone/multilayered.py @@ -92,7 +92,7 @@ class TwoToMany(MultilayeredScene): layers = self.get_layers() self.add(glass) - self.dither() + self.wait() self.play(*[ FadeIn( layer, @@ -102,7 +102,7 @@ class TwoToMany(MultilayeredScene): ]+[ Transform(glass, layers[0]) ]) - self.dither() + self.wait() def get_glass(self): return self.RectClass( @@ -147,13 +147,13 @@ class ShowDiscretePath(MultilayeredScene, PhotonScene): self.generate_discrete_path() self.play(ShowCreation(self.discrete_path)) - self.dither() + self.wait() self.play(self.photon_run_along_path( self.discrete_path, rate_func = rush_into, run_time = 3 )) - self.dither() + self.wait() def generate_discrete_path(self): @@ -198,7 +198,7 @@ class NLayers(MultilayeredScene): n_layers = TextMobject("$n$ layers") n_layers.next_to(brace) - self.dither() + self.wait() self.add(brace) self.show_frame() @@ -207,7 +207,7 @@ class NLayers(MultilayeredScene): GrowFromCenter(brace), GrowFromCenter(n_layers) ) - self.dither() + self.wait() class ShowLayerVariables(MultilayeredScene, PhotonScene): CONFIG = { @@ -260,7 +260,7 @@ class ShowLayerVariables(MultilayeredScene, PhotonScene): photon_run, run_time = time ) - self.dither() + self.wait() starts = [0, 0.3, 0.6] self.play(*it.chain(*[ @@ -273,7 +273,7 @@ class ShowLayerVariables(MultilayeredScene, PhotonScene): ] for mobs in start_ys, braces ])) - self.dither() + self.wait() triplets = zip(v_equations, start_ys, end_ys) anims = [] @@ -284,7 +284,7 @@ class ShowLayerVariables(MultilayeredScene, PhotonScene): Transform(start_y.copy(), end_y) ] self.play(*anims) - self.dither() + self.wait() class LimitingProcess(MultilayeredScene): @@ -312,16 +312,16 @@ class LimitingProcess(MultilayeredScene): curr_set = glass_sets[0] self.add(curr_set) for layer_set in glass_sets[1:]: - self.dither() + self.wait() self.play(Transform(curr_set, layer_set)) - self.dither() + self.wait() class ShowLightAndSlidingObject(MultilayeredScene, TryManyPaths, PhotonScene): CONFIG = { "show_time" : False, - "dither_and_add" : False, + "wait_and_add" : False, "RectClass" : FilledRectangle } def construct(self): @@ -347,12 +347,12 @@ class ShowLightAndSlidingObject(MultilayeredScene, TryManyPaths, PhotonScene): text = self.get_text().to_edge(UP, buff = 0.2) self.play(ShowCreation(loop)) - self.dither() + self.wait() self.play(photon_run) self.remove(photon_run.mobject) randy = self.slide(randy, loop) self.add(randy) - self.dither() + self.wait() self.remove(randy) self.play(ShimmerIn(text)) for path in paths: @@ -412,7 +412,7 @@ class ContinuouslyObeyingSnellsLaw(MultilayeredScene): Transform(snells, new_snells), Transform(rest, colon) ) - self.dither() + self.wait() return colon def get_marks(self, point1, point2): @@ -466,17 +466,17 @@ class ContinuouslyObeyingSnellsLaw(MultilayeredScene): ) self.play(ShowCreation(vert_line)) self.play(ShowCreation(tangent_line)) - self.dither() + self.wait() self.play( GrowFromCenter(sqrt_y), GrowFromCenter(brace), GrowFromCenter(y_mob) ) - self.dither() + self.wait() self.play(Transform( Point(const.get_left()), const )) - self.dither() + self.wait() diff --git a/old_projects/brachistochrone/wordplay.py b/old_projects/brachistochrone/wordplay.py index 821330fa..cff199da 100644 --- a/old_projects/brachistochrone/wordplay.py +++ b/old_projects/brachistochrone/wordplay.py @@ -37,7 +37,7 @@ class Intro(Scene): ShimmerIn(part) for part in new_text.split() ]) - self.dither() + self.wait() with_word, steve = new_text.split() steve_copy = steve.copy().center().to_edge(UP) # logo.sort_points(lambda p : -np.linalg.norm(p)) @@ -102,7 +102,7 @@ class IntroduceSteve(Scene): self.play(ShimmerIn(contributions)) for logo in logos: self.play(FadeIn(logo)) - self.dither() + self.wait() class ShowTweets(Scene): def construct(self): @@ -122,7 +122,7 @@ class ShowTweets(Scene): Transform(Point(tweets[x-1].get_center()), tweets[x]), Animation(tweets[x-1]) ) - self.dither() + self.wait() class LetsBeHonest(Scene): def construct(self): @@ -130,7 +130,7 @@ class LetsBeHonest(Scene): Let's be honest about who benefits from this collaboration... """))) - self.dither() + self.wait() class WhatIsTheBrachistochrone(Scene): @@ -138,7 +138,7 @@ class WhatIsTheBrachistochrone(Scene): self.play(ShimmerIn(TextMobject(""" So \\dots what is the Brachistochrone? """))) - self.dither() + self.wait() class DisectBrachistochroneWord(Scene): @@ -203,22 +203,22 @@ class DisectBrachistochroneWord(Scene): self.play(Transform(original_word, word), ShowCreation(dots)) self.play(ShimmerIn(pronunciation)) - self.dither() + self.wait() self.play( GrowFromCenter(overbrace1), GrowFromCenter(overbrace2) ) - self.dither() + self.wait() self.play(ShimmerIn(latin)) self.play(FadeIn(question_mark)) self.play(Transform( latin, greek, path_func = counterclockwise_path() )) - self.dither() + self.wait() self.play(Transform(question_mark, stars)) self.remove(stars) - self.dither() + self.wait() self.play(ShimmerIn(shortest)) self.play(ShimmerIn(time)) for ex, ar in [(chrono_example, chrono_arrow), (brachy_example, brachy_arrow)]: @@ -226,7 +226,7 @@ class DisectBrachistochroneWord(Scene): ShowCreation(ar), ShimmerIn(ex) ) - self.dither() + self.wait() class OneSolutionTwoInsights(Scene): def construct(self): @@ -242,10 +242,10 @@ class OneSolutionTwoInsights(Scene): name = TextMobject("Mark Levi").to_edge(UP) self.play(*map(ShimmerIn, one_solution.split())) - self.dither() + self.wait() for pair in zip(one_solution.split(), two_insights.split()): self.play(Transform(*pair, path_func = path_along_arc(np.pi))) - self.dither() + self.wait() self.clear() self.add(two, insights) for word, man in [(two, johann), (insights, mark)]: @@ -253,11 +253,11 @@ class OneSolutionTwoInsights(Scene): Transform(word, Point(word.get_left())), GrowFromCenter(man) ) - self.dither() + self.wait() self.clear() self.play(ApplyMethod(mark.center)) self.play(ShimmerIn(name)) - self.dither() + self.wait() class CircleOfIdeas(Scene): def construct(self): @@ -292,7 +292,7 @@ class CircleOfIdeas(Scene): ]+[ GrowFromCenter(brachistochrone) ]) - self.dither() + self.wait() def get_spinning_anims(self, words, angle = np.pi/6): anims = [] @@ -343,7 +343,7 @@ class FermatsPrincipleStatement(Scene): self.play( ApplyMethod(everything.highlight, WHITE), ) - self.dither() + self.wait() class VideoProgression(Scene): def construct(self): @@ -365,7 +365,7 @@ class VideoProgression(Scene): point = Point(DOWN) self.play(ShimmerIn(brachy)) - self.dither() + self.wait() self.play( ApplyMethod(brachy.shift, spacing), Transform(point, optics) @@ -373,13 +373,13 @@ class VideoProgression(Scene): optics = point arrow1 = Arrow(optics, brachy) self.play(ShowCreation(arrow1)) - self.dither() + self.wait() arrow2 = Arrow(light_in_two, optics) self.play( ShowCreation(arrow2), ShimmerIn(light_in_two) ) - self.dither() + self.wait() self.play( FadeOut(light_in_two), GrowFromCenter(snells), @@ -387,7 +387,7 @@ class VideoProgression(Scene): ApplyMethod(arrow2.highlight, BLUE_D) ) ) - self.dither() + self.wait() self.play( FadeOut(optics), GrowFromCenter(multi), @@ -395,7 +395,7 @@ class VideoProgression(Scene): ApplyMethod(arrow1.highlight, BLUE_D) ) ) - self.dither() + self.wait() @@ -442,19 +442,19 @@ class BalanceCompetingFactors(Scene): self.add(triangle, self.balancers) self.rotate(1) self.rotate(-2) - self.dither() + self.wait() self.play(Transform( factor1, real_factor1, path_func = path_along_arc(np.pi/4) )) self.rotate(2) - self.dither() + self.wait() self.play(Transform( factor2, real_factor2, path_func = path_along_arc(np.pi/4) )) self.rotate(-2) - self.dither() + self.wait() self.rotate(1) def rotate(self, factor): @@ -478,14 +478,14 @@ class Challenge(Scene): curves look like straight lines in $t$-$\\theta$ space? """)) - self.dither() + self.wait() class Section1(Scene): def construct(self): self.add(TextMobject("Section 1: Johann Bernoulli's insight")) - self.dither() + self.wait() class Section2(Scene): def construct(self): @@ -493,7 +493,7 @@ class Section2(Scene): "Section 2: Mark Levi's insight, and a challenge", size = "\\large" )) - self.dither() + self.wait() @@ -502,10 +502,10 @@ class NarratorInterjection(Scene): words1 = TexMobject("<\\text{Narrator interjection}>") words2 = TexMobject("<\\!/\\text{Narrator interjection}>") self.add(words1) - self.dither() + self.wait() self.clear() self.add(words2) - self.dither() + self.wait() class ThisCouldBeTheEnd(Scene): @@ -516,30 +516,30 @@ class ThisCouldBeTheEnd(Scene): ]) for part in words.split(): self.play(ShimmerIn(part)) - self.dither() + self.wait() class MyOwnChallenge(Scene): def construct(self): self.add(TextMobject("My own challenge:")) - self.dither() + self.wait() class WarmupChallenge(Scene): def construct(self): self.add(TextMobject("\\large Warm-up challenge: Confirm this for yourself")) - self.dither() + self.wait() class FindAnotherSolution(Scene): def construct(self): self.add(TextMobject("Find another brachistochrone solution\\dots")) - self.dither() + self.wait() class ProofOfSnellsLaw(Scene): def construct(self): self.add(TextMobject("Proof of Snell's law:")) - self.dither() + self.wait() class CondensedVersion(Scene): @@ -554,11 +554,11 @@ class CondensedVersion(Scene): condensed = TextMobject("condensed") self.add(snells) - self.dither() + self.wait() self.play(DelayByOrder( Transform(snells, condensed, run_time = 2) )) - self.dither() + self.wait() diff --git a/old_projects/complex_multiplication_article.py b/old_projects/complex_multiplication_article.py index f3144511..1b87836e 100644 --- a/old_projects/complex_multiplication_article.py +++ b/old_projects/complex_multiplication_article.py @@ -122,7 +122,7 @@ class ConjugateDivisionExample(ComplexMultiplication): self.multiplier = 1./(abs(num)**2) self.anim_config["path_func"] = straight_path self.apply_multiplication() - self.dither() + self.wait() class DrawSolutionsToZToTheNEqualsW(Scene): @staticmethod diff --git a/old_projects/counting_in_binary.py b/old_projects/counting_in_binary.py index 1a6acfb7..f777c1ac 100644 --- a/old_projects/counting_in_binary.py +++ b/old_projects/counting_in_binary.py @@ -234,9 +234,9 @@ class Introduction(Scene): mob.sort_points(lambda p : p[0]) self.add(words) - self.dither() + self.wait() self.play(DelayByOrder(Transform(words, hand))) - self.dither() + self.wait() class ShowReadingRule(Scene): @@ -253,16 +253,16 @@ class ShowReadingRule(Scene): for count in sample_counts: hand = Hand(count, small = True) self.add(hand) - self.dither() + self.wait() self.remove(hand) self.add(hand) - self.dither() + self.wait() self.remove(question) self.add(answer[0]) counts = map(finger_tip_power_of_2, range(5)) for count in counts: self.play(SpinInFromNothing(count, run_time = 0.3)) - self.dither() + self.wait() self.play(ShimmerIn(answer[1])) for count in sample_counts: self.clear() @@ -282,14 +282,14 @@ class ShowReadingRule(Scene): " + ".join([str(2**c) for c in counts]).split(" ") + ["=%d"%num] ).to_corner(UP+RIGHT).split() self.add(hand, *count_mobs) - self.dither() + self.wait() self.play(*[ Transform(count_mobs[n/2], sum_mobs[n]) if n%2 == 0 and n/2 < len(counts) else FadeIn(sum_mobs[n]) for n in range(len(sum_mobs)) ]) - self.dither(2.0) + self.wait(2.0) class ShowIncrementRule(Scene): @@ -326,7 +326,7 @@ class ShowIncrementRule(Scene): self.background = oh.frames[COUNT_TO_FRAME_NUM[start]] self.add(phrase) self.play(ShimmerIn(self.get_arrow_set(start))) - self.dither() + self.wait() self.clear() self.reset_background() self.frames += [ @@ -390,12 +390,12 @@ class MindFindsShortcuts(Scene): compound, seven ) - self.dither() + self.wait() self.play( Transform(compound, Arrow(hand, seven).highlight("yellow")), ShimmerIn(TextMobject("Directly recognize").shift(1.5*DOWN+2*RIGHT)) ) - self.dither() + self.wait() self.clear() hands = dict([ @@ -412,7 +412,7 @@ class MindFindsShortcuts(Scene): equals23 = TexMobject("=23").shift(DOWN + 5.5*RIGHT) self.add(words2, hands[23]) - self.dither() + self.wait() self.play( Transform( deepcopy(hands[16]).highlight("black").center().shift(hands[23].get_center()), @@ -426,9 +426,9 @@ class MindFindsShortcuts(Scene): FadeIn(equals), FadeIn(plus) ) - self.dither() + self.wait() self.play(ShimmerIn(equals23)) - self.dither() + self.wait() class CountingExampleSentence(ShowCounting): @@ -451,9 +451,9 @@ class FinishCountingExampleSentence(Scene): eightteen.sort_points() comp = Mobject(sixteen, two) self.add(hand, comp, words) - self.dither() + self.wait() self.play(Transform(comp, eightteen)) - self.dither() + self.wait() class Question(Scene): def construct(self): @@ -473,9 +473,9 @@ class WithToes(Scene): "you could count to 1,048,575" ]).split() self.add(words[0]) - self.dither() + self.wait() self.play(ShimmerIn(words[1])) - self.dither() + self.wait() if __name__ == "__main__": diff --git a/old_projects/crypto.py b/old_projects/crypto.py index 7d0da810..be3b5f0a 100644 --- a/old_projects/crypto.py +++ b/old_projects/crypto.py @@ -143,7 +143,7 @@ class AskQuestion(Scene): ] question = TextMobject(*strings) question.highlight_by_tex("have", YELLOW) - self.dither() + self.wait() for word, part in zip(strings, question): n_chars = len(word.strip()) n_spaces = len(word) - n_chars @@ -152,8 +152,8 @@ class AskQuestion(Scene): run_time = self.time_per_char * len(word), rate_func = squish_rate_func(smooth, 0, 0.5) ) - self.dither(self.time_per_char*n_spaces) - self.dither(2) + self.wait(self.time_per_char*n_spaces) + self.wait(2) class ListOfAttributes(Scene): def construct(self): @@ -184,7 +184,7 @@ class ListOfAttributes(Scene): for building in buildings: self.play(FadeIn(building)) self.play(ShowCreation(building.cross)) - self.dither() + self.wait() class UnknownAuthor(Scene): CONFIG = { @@ -205,7 +205,7 @@ class UnknownAuthor(Scene): Write(question), ShowCreation(arrow) ) - self.dither() + self.wait() class DisectQuestion(TeacherStudentsScene): def construct(self): @@ -229,7 +229,7 @@ class DisectQuestion(TeacherStudentsScene): question.restore ) self.change_student_modes(*["pondering"]*3) - self.dither() + self.wait() self.bitcoin_word = question.get_part_by_tex("Bitcoin") @@ -270,7 +270,7 @@ class DisectQuestion(TeacherStudentsScene): you.change, "erm", words ) self.play(Blink(you)) - self.dither() + self.wait() class CryptocurrencyEquation(Scene): def construct(self): @@ -285,7 +285,7 @@ class CryptocurrencyEquation(Scene): for part in parts: self.play(FadeIn(part)) - self.dither(2) + self.wait(2) class CryptocurrencyMarketCaps(ExternallyAnimatedScene): pass @@ -328,7 +328,7 @@ class ListRecentCurrencies(Scene): dots = TexMobject("\\vdots") dots.next_to(logos, DOWN) self.play(LaggedStart(FadeIn, dots, run_time = 1)) - self.dither() + self.wait() class Hype(TeacherStudentsScene): def construct(self): @@ -350,7 +350,7 @@ class Hype(TeacherStudentsScene): student.change_mode, mode, FadeIn(bubble), ) - self.dither(3) + self.wait(3) class NoCommentOnSpeculation(TeacherStudentsScene): def construct(self): @@ -393,28 +393,28 @@ class NoCommentOnSpeculation(TeacherStudentsScene): graph, run_time = 2, rate_func = None )) - self.dither() + self.wait() self.play(ShowCreation(cross)) group.add(cross) self.play( group.shift, 2*SPACE_WIDTH*RIGHT, self.teacher.change, "happy" ) - self.dither() + self.wait() self.student_says( "But...what are they?", student_index = 0, target_mode = "confused" ) - self.dither(2) + self.wait(2) self.play( FadeIn(mining_graphic), RemovePiCreatureBubble(self.students[0]), self.teacher.change, "sassy", ) self.play(ShowCreation(mining_cross)) - self.dither() + self.wait() self.play( VGroup(mining_graphic, mining_cross).shift, 2*SPACE_WIDTH*RIGHT @@ -611,7 +611,7 @@ class LayOutPlan(LedgerScene): DrawBorderThenFill(btc), Write(group[1], run_time = 2) ) - self.dither() + self.wait() self.play( group.scale, 0.7, group.next_to, ORIGIN, RIGHT, @@ -646,7 +646,7 @@ class LayOutPlan(LedgerScene): FadeOut(cash), Write(new_line, run_time = 1) ) - self.dither() + self.wait() def become_skeptical(self): creatures = self.pi_creatures @@ -663,7 +663,7 @@ class LayOutPlan(LedgerScene): ) for i in range(4) ]) - self.dither(2) + self.wait(2) class UnderlyingSystemVsUserFacing(Scene): def construct(self): @@ -723,15 +723,15 @@ class UnderlyingSystemVsUserFacing(Scene): self.add(h_line, h_line2, h_line3, v_line, v_line2) self.add(underlying, user_facing, btc) self.play(Write(protocol)) - self.dither(2) + self.wait(2) self.play( card.restore, Write(dollar) ) self.play(Write(banking)) - self.dither(2) + self.wait(2) self.play(DrawBorderThenFill(phone)) - self.dither(2) + self.wait(2) class FromBankToDecentralizedSystemCopy(ExternallyAnimatedScene): pass @@ -764,7 +764,7 @@ class IntroduceLedgerSystem(LedgerScene): to_pi.change_mode, "hooray" ) self.play(FadeOut(cash)) - self.dither() + self.wait() def add_ledger(self): ledger = self.get_ledger() @@ -778,7 +778,7 @@ class IntroduceLedgerSystem(LedgerScene): ) for payment in self.payments: self.animate_payment_addition(*payment) - self.dither(3) + self.wait(3) def tally_it_all_up(self): accounts = dict() @@ -834,7 +834,7 @@ class IntroduceLedgerSystem(LedgerScene): for pi in debtors ] ) - self.dither() + self.wait() debtor_cash, creditor_cash = [ VGroup(*it.chain(*[pi.cash for pi in group])) for group in debtors, creditors @@ -844,11 +844,11 @@ class IntroduceLedgerSystem(LedgerScene): debtor_cash.arrange_submobjects, RIGHT, SMALL_BUFF, debtor_cash.move_to, self.pi_creatures, ) - self.dither() + self.wait() self.play(ReplacementTransform( debtor_cash, creditor_cash )) - self.dither(2) + self.wait(2) class InitialProtocol(Scene): def construct(self): @@ -872,9 +872,9 @@ class InitialProtocol(Scene): ])) for item in items: - self.dither() + self.wait() self.play(LaggedStart(FadeIn, item)) - self.dither(2) + self.wait(2) def get_new_item(self, item_string): item = TextMobject("$\\cdot$ %s"%item_string) @@ -904,7 +904,7 @@ class AddFraudulentLine(LedgerScene): self.play(Write(words, run_time = 1)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.play( FadeOut(words), FadeOut(arrow), @@ -919,7 +919,7 @@ class AddFraudulentLine(LedgerScene): self.play(self.bob.change, "conniving") self.play(line.restore) - self.dither() + self.wait() def alice_reacts(self): bubble = SpeechBubble( @@ -933,7 +933,7 @@ class AddFraudulentLine(LedgerScene): FadeIn(bubble), Write(bubble.content, run_time = 1) ) - self.dither(3) + self.wait(3) self.play( FadeOut(bubble), FadeOut(bubble.content), @@ -949,7 +949,7 @@ class AnnounceDigitalSignatures(TeacherStudentsScene): target_mode = "hooray", ) self.change_student_modes(*["hooray"]*3) - self.dither(2) + self.wait(2) class IntroduceSignatures(LedgerScene): CONFIG = { @@ -970,7 +970,7 @@ class IntroduceSignatures(LedgerScene): for payment in self.payments ]) self.play(LaggedStart(FadeIn, transactions)) - self.dither() + self.wait() def add_signatures(self): signatures = VGroup(*[ @@ -982,14 +982,14 @@ class IntroduceSignatures(LedgerScene): signature.highlight(transaction[0].get_color()) self.play(Write(signature, run_time = 2)) transaction.add(signature) - self.dither(2) + self.wait(2) rect = SurroundingRectangle(self.ledger.content[1]) self.play(ShowCreation(rect)) self.play(FadeOut(rect)) - self.dither() + self.wait() self.play(Indicate(signatures[0])) - self.dither() + self.wait() class AskHowDigitalSignaturesArePossible(TeacherStudentsScene): def construct(self): @@ -1015,13 +1015,13 @@ class AskHowDigitalSignaturesArePossible(TeacherStudentsScene): self.change_student_modes("pondering", "confused", "erm") self.play(Write(signature)) self.play(LaggedStart(FadeIn, bits, run_time = 1)) - self.dither() + self.wait() self.play(ReplacementTransform( bits.copy(), bits_copy, path_arc = np.pi/2 )) self.play(Write(signature_copy)) - self.dither(3) + self.wait(3) class DescribeDigitalSignatures(LedgerScene): CONFIG = { @@ -1098,11 +1098,11 @@ class DescribeDigitalSignatures(LedgerScene): VGroup(VGroup(private.copy())), private_keys )) - self.dither() + self.wait() self.play(private.shift, DOWN) self.play(FadeIn(secret)) self.play(FadeOut(private)) - self.dither() + self.wait() title.remove(private) title.add(secret) @@ -1128,7 +1128,7 @@ class DescribeDigitalSignatures(LedgerScene): self.play(ShowCreation(rects)) self.play(LaggedStart(DrawBorderThenFill, locks)) - self.dither() + self.wait() self.private_key_rects = rects self.locks = locks @@ -1173,7 +1173,7 @@ class DescribeDigitalSignatures(LedgerScene): LaggedStart(FadeIn, documents, run_time = 1) ) self.play(Write(signatures)) - self.dither() + self.wait() self.signatures = signatures self.documents = documents @@ -1219,7 +1219,7 @@ class DescribeDigitalSignatures(LedgerScene): ]) for word in words: self.play(FadeIn(word)) - self.dither() + self.wait() self.play(FadeOut(words)) def show_signing_functions(self): @@ -1258,20 +1258,20 @@ class DescribeDigitalSignatures(LedgerScene): self.play(ReplacementTransform( message.copy(), VGroup(sign.message) )) - self.dither() + self.wait() self.play(ReplacementTransform( private_key.copy(), sign.sk )) - self.dither() + self.wait() self.play(ReplacementTransform( VGroup(sign.sk, sign.message).copy(), VGroup(sign.signature) )) - self.dither() + self.wait() self.play(Indicate(sign.sk)) - self.dither() + self.wait() self.play(Indicate(sign.message)) - self.dither() + self.wait() self.play(*[ FadeIn(part) for part in verify @@ -1280,7 +1280,7 @@ class DescribeDigitalSignatures(LedgerScene): verify.pk, verify[-1] ] ]) - self.dither() + self.wait() self.play( ReplacementTransform( sign.message.copy(), verify.message @@ -1289,13 +1289,13 @@ class DescribeDigitalSignatures(LedgerScene): sign.signature.copy(), verify.signature ) ) - self.dither() + self.wait() self.play(ReplacementTransform( public_key.copy(), VGroup(verify.pk) )) - self.dither() + self.wait() self.play(Write(verify[-1])) - self.dither() + self.wait() class TryGuessingDigitalSignature(Scene): def construct(self): @@ -1325,7 +1325,7 @@ class TryGuessingDigitalSignature(Scene): run_time = 3 ) ) - self.dither() + self.wait() for n in range(2**10): last_row = zeros[-1] binary = bin(n)[2:] @@ -1336,7 +1336,7 @@ class TryGuessingDigitalSignature(Scene): last_row.submobjects[-i-1] = new_bit self.remove(curr_bit) self.add(last_row) - self.dither(1./30) + self.wait(1./30) class WriteTwoTo256PossibleSignatures(Scene): def construct(self): @@ -1346,7 +1346,7 @@ class WriteTwoTo256PossibleSignatures(Scene): words.scale(2) words.highlight_by_tex("256", BLUE) self.play(Write(words)) - self.dither() + self.wait() class SupplementVideoWrapper(Scene): def construct(self): @@ -1357,7 +1357,7 @@ class SupplementVideoWrapper(Scene): rect.next_to(title, DOWN) self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class FeelConfidentWithVerification(PiCreatureScene): def construct(self): @@ -1407,14 +1407,14 @@ class FeelConfidentWithVerification(PiCreatureScene): self.play(ReplacementTransform( verify.copy(), rhs )) - self.dither() + self.wait() self.play(self.pi_creature.change, "happy") self.play(Write(sk_group)) self.play( ShowCreation(lock_box), DrawBorderThenFill(lock, run_time = 1) ) - self.dither(2) + self.wait(2) def show_secret_key(self): @@ -1453,9 +1453,9 @@ class IncludeTransactionNumber(LedgerScene): signature.restore, self.alice.change, "raise_left_hand" ) - self.dither() + self.wait() self.play(self.alice.change, "happy") - self.dither() + self.wait() line.add(signature) @@ -1477,7 +1477,7 @@ class IncludeTransactionNumber(LedgerScene): Write(q_marks) ) self.play(ShowCreation(cross)) - self.dither() + self.wait() self.play(*map(FadeOut, [payment, cross, q_marks])) self.ledger.content.remove(payment) @@ -1492,7 +1492,7 @@ class IncludeTransactionNumber(LedgerScene): self.bob.change, "conniving", ) self.play(self.alice.change, "angry") - self.dither() + self.wait() self.copies = copies @@ -1529,7 +1529,7 @@ class IncludeTransactionNumber(LedgerScene): run_time = 2, )) self.play(self.bob.change, "erm") - self.dither(2) + self.wait(2) class ProtocolWithDigitalSignatures(InitialProtocol): def construct(self): @@ -1546,9 +1546,9 @@ class ProtocolWithDigitalSignatures(InitialProtocol): new_item.highlight(YELLOW) self.play(Write(new_item)) - self.dither() + self.wait() self.play(ShowCreation(rect)) - self.dither() + self.wait() class SignedLedgerScene(LedgerScene): CONFIG = { @@ -1592,7 +1592,7 @@ class CharlieRacksUpDebt(SignedLedgerScene): ApplyMethod(pi.change, "angry", self.charlie) for pi in self.get_pi_creatures() ]) - self.dither() + self.wait() class CharlieFeelsGuilty(Scene): def construct(self): @@ -1603,7 +1603,7 @@ class CharlieFeelsGuilty(Scene): self.play(charlie.change, "sad") for x in range(2): self.play(Blink(charlie)) - self.dither(2) + self.wait(2) class ThinkAboutSettlingUp(Scene): def construct(self): @@ -1618,7 +1618,7 @@ class ThinkAboutSettlingUp(Scene): target_mode = "thinking" )) self.play(Blink(randy)) - self.dither() + self.wait() class DontAllowOverdrawing(InitialProtocol): def construct(self): @@ -1631,9 +1631,9 @@ class DontAllowOverdrawing(InitialProtocol): lines[2].highlight(YELLOW) self.add(*lines[:2]) - self.dither() + self.wait() self.play(Write(lines[2])) - self.dither() + self.wait() class LedgerWithInitialBuyIn(SignedLedgerScene): def construct(self): @@ -1699,7 +1699,7 @@ class LedgerWithInitialBuyIn(SignedLedgerScene): for pi in self.pi_creatures ] ) - self.dither() + self.wait() def add_charlie_payments(self): payments = [ @@ -1714,7 +1714,7 @@ class LedgerWithInitialBuyIn(SignedLedgerScene): for line in new_lines: self.play(Write(line, run_time = 1)) - self.dither() + self.wait() def point_out_charlie_is_broke(self): charlie_lines = VGroup(*[ @@ -1736,7 +1736,7 @@ class LedgerWithInitialBuyIn(SignedLedgerScene): self.play(ShowCreation(rects)) self.play(self.charlie.change_mode, "guilty") - self.dither() + self.wait() self.play(ShowCreation(last_rect)) self.play(*[ ApplyMethod(pi.change, "sassy", self.charlie) @@ -1744,7 +1744,7 @@ class LedgerWithInitialBuyIn(SignedLedgerScene): if pi is not self.charlie ]) self.play(Write(invalid)) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [rects, last_rect, invalid])) def running_balance(self): @@ -1788,7 +1788,7 @@ class LedgerWithInitialBuyIn(SignedLedgerScene): LaggedStart(FadeIn, lines, run_time = 3), LaggedStart(ShowCreation, arrows, run_time = 3), ) - self.dither() + self.wait() class RemovedConnectionBetweenLedgerAndCash(TeacherStudentsScene): def construct(self): @@ -1827,7 +1827,7 @@ class RemovedConnectionBetweenLedgerAndCash(TeacherStudentsScene): look_at_arg = ledger, added_anims = [self.teacher.change, "happy"] ) - self.dither(3) + self.wait(3) class RenameToLedgerDollars(LedgerScene): CONFIG = { @@ -1885,7 +1885,7 @@ class RenameToLedgerDollars(LedgerScene): run_time = 4, lag_ratio = 0.3 )) - self.dither() + self.wait() self.payment_lines = lines @@ -1914,7 +1914,7 @@ class RenameToLedgerDollars(LedgerScene): self.pi_creature.change, "thinking", ledger_dollars ) self.play(MoveToTarget(amounts)) - self.dither(2) + self.wait(2) ### @@ -1951,7 +1951,7 @@ class ExchangeCashForLedgerDollars(LedgerScene): title.to_edge(UP).shift(LEFT) self.play(Write(title)) - self.dither() + self.wait() def give_ten_dollar_bill(self): bill = TenDollarBill() @@ -1971,7 +1971,7 @@ class ExchangeCashForLedgerDollars(LedgerScene): self.play(ShowCreation(arrow)) self.play(MoveToTarget(bill)) self.play(self.bob.change, "happy", bill) - self.dither() + self.wait() def add_bob_pays_alice_line(self): line = self.add_payment_line_to_ledger( @@ -1982,14 +1982,14 @@ class ExchangeCashForLedgerDollars(LedgerScene): line.move_to(self.bob.get_corner(UP+LEFT)) self.play(self.bob.change, "raise_right_hand", line) self.play(line.restore, run_time = 2) - self.dither() + self.wait() def everyone_thinks(self): self.play(*[ ApplyMethod(pi.change, "thinking", self.ledger) for pi in self.pi_creatures ]) - self.dither(4) + self.wait(4) class BitcoinIsALedger(Scene): def construct(self): @@ -2004,12 +2004,12 @@ class BitcoinIsALedger(Scene): group.arrange_submobjects(RIGHT) self.play(DrawBorderThenFill(logo)) - self.dither() + self.wait() self.play( Write(arrow), Write(ledger) ) - self.dither() + self.wait() self.btc_to_ledger = group @@ -2025,7 +2025,7 @@ class BitcoinIsALedger(Scene): for part in reversed(equation): self.play(FadeIn(part)) - self.dither() + self.wait() def get_ledger(self): rect = Rectangle(height = 2, width = 1.5) @@ -2065,13 +2065,13 @@ class BigDifferenceBetweenLDAndCryptocurrencies(Scene): word.shift(SPACE_WIDTH*vect/2) self.add(logos) - self.dither() + self.wait() self.play( cryptos.next_to, decentralized, DOWN, LARGE_BUFF, ld.next_to, centralized, DOWN, LARGE_BUFF, ) self.play(*map(Write, words)) - self.dither(2) + self.wait(2) class DistributedLedgerScene(LedgerScene): def get_large_network(self): @@ -2138,7 +2138,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene): question.next_to(self.ledger, UP) self.play(Write(question)) - self.dither() + self.wait() self.question = question @@ -2155,7 +2155,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene): for payment in payments: self.play(LaggedStart(FadeIn, payment, run_time = 1)) - self.dither() + self.wait() def ask_who_controls_ledger(self): new_question = TextMobject("Who", "controls", "this?!") @@ -2168,7 +2168,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene): ApplyMethod(pi.change, "confused", new_question) for pi in self.pi_creatures ]) - self.dither(2) + self.wait(2) def distribute_ledger(self): ledger = self.ledger @@ -2189,7 +2189,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene): group.scale_to_fit_height, 2*SPACE_HEIGHT - 2, group.center ) - self.dither(2) + self.wait(2) def broadcast_transaction(self): payment = TextMobject( @@ -2210,7 +2210,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene): self.alice.change, "raise_right_hand", payment, Write(payment, run_time = 2) ) - self.dither() + self.wait() self.play( ReplacementTransform( VGroup(payment), payment_copies, @@ -2220,7 +2220,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene): Broadcast(self.alice.get_corner(UP+RIGHT)), self.alice.change, "happy" ) - self.dither() + self.wait() pairs = zip(payment_copies, self.pi_creatures) Scene.play(self, *it.chain(*[ [ @@ -2230,7 +2230,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene): ] for line, pi in pairs ])) - self.dither(3) + self.wait(3) for line, pi in pairs: pi.ledger.add(line) @@ -2258,7 +2258,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene): self.play(*map(ShowCreation, arrows)) self.play(Write(question)) - self.dither() + self.wait() class BobDoubtsBroadcastTransaction(DistributedLedgerScene): def construct(self): @@ -2325,7 +2325,7 @@ class BobDoubtsBroadcastTransaction(DistributedLedgerScene): FadeIn(chralie_group) ) self.play(charlie.change, "maybe", bob.eyes) - self.dither(2) + self.wait(2) class YouListeningToBroadcasts(LedgerScene): CONFIG = { @@ -2363,7 +2363,7 @@ class YouListeningToBroadcasts(LedgerScene): ), you.change_mode, "pondering" ) - self.dither() + self.wait() class AskWhatToAddToProtocol(InitialProtocol): def construct(self): @@ -2383,7 +2383,7 @@ class AskWhatToAddToProtocol(InitialProtocol): self.add(*items[:3]) self.play(GrowFromCenter(brace)) self.play(Write(question)) - self.dither() + self.wait() class TrustComputationalWork(DistributedLedgerScene): def construct(self): @@ -2421,7 +2421,7 @@ class TrustComputationalWork(DistributedLedgerScene): zeros.submobjects[-i-1] = new_bit self.remove(curr_bit) self.add(zeros) - self.dither(1./30) + self.wait(1./30) class TrustComputationalWorkSupplement(Scene): def construct(self): @@ -2431,7 +2431,7 @@ class TrustComputationalWorkSupplement(Scene): words[1].highlight(YELLOW) self.add(words[0]) self.play(Write(words[1])) - self.dither() + self.wait() class FraudIsInfeasible(Scene): def construct(self): @@ -2444,7 +2444,7 @@ class FraudIsInfeasible(Scene): self.play(FadeIn(words[0])) self.play(FadeIn(words[2])) self.play(Write(words[1])) - self.dither() + self.wait() class ThisIsWellIntoTheWeeds(TeacherStudentsScene): def construct(self): @@ -2467,7 +2467,7 @@ class ThisIsWellIntoTheWeeds(TeacherStudentsScene): ]) ], ) - self.dither() + self.wait() self.play( idea.restore, RemovePiCreatureBubble( @@ -2484,7 +2484,7 @@ class ThisIsWellIntoTheWeeds(TeacherStudentsScene): lambda b : (b.highlight, YELLOW_A), rate_func = there_and_back )) - self.dither(2) + self.wait(2) class IntroduceSHA256(Scene): def construct(self): @@ -2548,14 +2548,14 @@ class IntroduceSHA256(Scene): run_time = 4, lag_ratio = 0.05 )) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(text, run_time = 2) ) - self.dither() + self.wait() self.play(Write(looks_random)) - self.dither(2) + self.wait(2) for mob in digest, message: self.play(LaggedStart( ApplyMethod, mob, @@ -2563,7 +2563,7 @@ class IntroduceSHA256(Scene): rate_func = there_and_back, run_time = 1 )) - self.dither() + self.wait() self.play(FadeOut(looks_random)) new_lhs, new_digest = groups[1] @@ -2590,9 +2590,9 @@ class IntroduceSHA256(Scene): path_arc = np.pi/2 )) if arrow in self.get_mobjects(): - self.dither() + self.wait() self.play(FadeOut(arrow)) - self.dither() + self.wait() new_sha_text = TextMobject( "Cryptographic", "hash function" @@ -2602,7 +2602,7 @@ class IntroduceSHA256(Scene): new_sha_text.highlight(YELLOW) new_sha_text[0].highlight(GREEN) self.play(Transform(sha_text, new_sha_text)) - self.dither() + self.wait() self.lhs = lhs self.message = message @@ -2622,7 +2622,7 @@ class IntroduceSHA256(Scene): self.play(ShowCreation(arrow)) self.play(Write(words)) - self.dither() + self.wait() def issue_challenge(self): desired_output_text = TextMobject("Desired output") @@ -2647,7 +2647,7 @@ class IntroduceSHA256(Scene): FadeOut(self.message), Transform(self.message_text, q_marks) ) - self.dither() + self.wait() def shift_everything_down(self): everything = VGroup(*self.get_top_level_mobjects()) @@ -2693,7 +2693,7 @@ class PonderScematic(Scene): self.play(randy.change, "confused", ORIGIN) for x in range(3): self.play(Blink(randy)) - self.dither(2) + self.wait(2) class ViewingSLLCertificate(ExternallyAnimatedScene): pass @@ -2714,7 +2714,7 @@ class SHA256ToProofOfWork(TeacherStudentsScene): ) self.play(ShowCreation(arrow)) self.play(Write(proof, run_time = 1)) - self.dither(3) + self.wait(3) class IntroduceNonceOnTrasactions(LedgerScene): CONFIG = { @@ -2767,7 +2767,7 @@ class IntroduceNonceOnTrasactions(LedgerScene): self.play(LaggedStart( FadeIn, VGroup(special_word, nonce_brace, nonce) )) - self.dither() + self.wait() self.play( nonce.next_to, ledger.content, DOWN, MED_SMALL_BUFF, LEFT, FadeOut(special_word), @@ -2810,7 +2810,7 @@ class IntroduceNonceOnTrasactions(LedgerScene): ApplyMethod, zeros, lambda m : (m.highlight, YELLOW) )) - self.dither(2) + self.wait(2) self.nonce = nonce self.digest = digest @@ -2825,9 +2825,9 @@ class IntroduceNonceOnTrasactions(LedgerScene): probability.next_to(self.zeros_words, UP, MED_LARGE_BUFF) self.play(FadeIn(probability[0])) - self.dither() + self.wait() self.play(Write(probability[1], run_time = 2)) - self.dither(2) + self.wait(2) def guess_and_check(self): q_mark = TexMobject("?") @@ -2854,7 +2854,7 @@ class IntroduceNonceOnTrasactions(LedgerScene): run_time = 1, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play(self.nonce.restore) self.play( self.digest.restore, @@ -2862,7 +2862,7 @@ class IntroduceNonceOnTrasactions(LedgerScene): run_time = 2 ) self.play(FadeOut(q_mark)) - self.dither() + self.wait() def name_proof_of_work(self): words = TextMobject("``Proof of work''") @@ -2876,7 +2876,7 @@ class IntroduceNonceOnTrasactions(LedgerScene): ) self.play(Write(words, run_time = 2)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() def change_ledger(self): amount = self.ledger.content[2][-1] @@ -3014,7 +3014,7 @@ class IntroduceBlockChain(Scene): lag_factor = 0.6, ) ) - self.dither() + self.wait() for group in all_payments, all_proofs_of_work: self.play(LaggedStart( Indicate, group, @@ -3074,14 +3074,14 @@ class IntroduceBlockChain(Scene): run_time = 2 ) self.play(Write(digests)) - self.dither() + self.wait() for group in signatures, proofs_of_work: self.play(LaggedStart( Indicate, group, run_time = 2, rate_func = there_and_back, )) - self.dither() + self.wait() self.play( proofs_of_work.restore, FadeOut(sha_words) @@ -3124,7 +3124,7 @@ class IntroduceBlockChain(Scene): arrow = new_arrows[0].copy().shift(-block_spacing) sha_arrows.add_to_back(arrow) self.play(*map(FadeIn, [arrow, prev_hashes[0]])) - self.dither(2) + self.wait(2) self.prev_hashes = prev_hashes @@ -3138,9 +3138,9 @@ class IntroduceBlockChain(Scene): self.play(FocusOn(amount)) self.play(Transform(amount, new_amount)) - self.dither() + self.wait() self.play(Swap(*blocks[:2])) - self.dither() + self.wait() blocks.submobjects[:2] = blocks.submobjects[1::-1] @@ -3175,7 +3175,7 @@ class IntroduceBlockChain(Scene): num_pow_group.move_to(proof_of_work) for num_pow in num_pow_group: self.add(num_pow) - self.dither(1./20) + self.wait(1./20) prev_hash.highlight(random_bright_color()) self.remove(num_pow) self.add(num_pow) @@ -3193,7 +3193,7 @@ class IntroduceBlockChain(Scene): ShowCreation(cross), Write(block_chain) ) - self.dither(2) + self.wait(2) ###### @@ -3358,13 +3358,13 @@ class FromBankToDecentralizedSystem(DistributedBlockChainScene): self.play(LaggedStart(DrawBorderThenFill, bank)) self.play(ShowCreation(cross)) - self.dither() + self.wait() self.play( group.next_to, SPACE_WIDTH*RIGHT, RIGHT, rate_func = running_start, path_arc = -np.pi/6, ) - self.dither() + self.wait() self.remove(group) def show_block_chains(self): @@ -3385,7 +3385,7 @@ class FromBankToDecentralizedSystem(DistributedBlockChainScene): LaggedStart(FadeIn, center_chain.blocks, run_time = 1), ShowCreation(center_chain.arrows), ) - self.dither() + self.wait() self.play( ReplacementTransform(VGroup(center_chain), chains), *[ @@ -3393,7 +3393,7 @@ class FromBankToDecentralizedSystem(DistributedBlockChainScene): for pi in creatures ] ) - self.dither() + self.wait() def add_crypto_terms(self): terms = TextMobject( @@ -3404,7 +3404,7 @@ class FromBankToDecentralizedSystem(DistributedBlockChainScene): terms.highlight_by_tex("hash", YELLOW) for term in terms: self.play(Write(term, run_time = 1)) - self.dither() + self.wait() self.digital_signature = terms[0] def set_aside_everything(self): @@ -3430,7 +3430,7 @@ class FromBankToDecentralizedSystem(DistributedBlockChainScene): Write(ledger), digital_signature.next_to, ORIGIN, RIGHT ) - self.dither(2) + self.wait(2) class IntroduceBlockCreator(DistributedBlockChainScene): CONFIG = { @@ -3475,7 +3475,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene): self.play(LaggedStart(FadeIn, everything)) self.pi_creatures.add(*block_creators) - self.dither() + self.wait() self.block_creators = block_creators self.block_creator_labels = labels @@ -3554,7 +3554,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene): MoveToTarget(payments), creator.change, "raise_right_hand" ) - self.dither() + self.wait() block.add(payments) self.block = block @@ -3585,12 +3585,12 @@ class IntroduceBlockCreator(DistributedBlockChainScene): digest.next_to(arrow.get_end(), DOWN) self.add(guess, digest) - self.dither(1./20) + self.wait(1./20) self.remove(guess, digest) proof_of_work = guess self.add(proof_of_work, digest) block.add(proof_of_work) - self.dither() + self.wait() self.hash_group = VGroup(arrow, digest) @@ -3613,7 +3613,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene): Write(new_transaction) ) payments.add_to_back(new_transaction) - self.dither() + self.wait() def comment_on_block_reward(self): reward = self.payments[0] @@ -3637,7 +3637,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene): self.play(FadeIn(big_rect)) for comment in comments: self.play(FadeIn(comment)) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [big_rect, comments, reward_rect])) self.pi_creatures = pi_creatures @@ -3656,7 +3656,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene): new_top_payment.scale_to_fit_height(top_payment.get_height()) new_top_payment.move_to(top_payment, LEFT) self.play(Transform(top_payment, new_top_payment)) - self.dither() + self.wait() def broadcast_block(self): old_chains = self.block_chains @@ -3698,7 +3698,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene): for pi in self.pi_creatures ] )) - self.dither(3) + self.wait(3) class MiningIsALottery(IntroduceBlockCreator): CONFIG = { @@ -3785,7 +3785,7 @@ class MiningIsALottery(IntroduceBlockCreator): digest.next_to(block.arrow, RIGHT) digests.add(digest) self.add(nonces, digests) - self.dither(1./20) + self.wait(1./20) self.remove(nonces, digests) self.add(nonces, digests) @@ -3818,7 +3818,7 @@ class MiningIsALottery(IntroduceBlockCreator): ApplyMethod(loser.change, "angry", winner) for loser in losers ]) - self.dither(2) + self.wait(2) ##### @@ -3889,7 +3889,7 @@ class TwoBlockChains(DistributedBlockChainScene): run_time = 3, ), ) - self.dither() + self.wait() self.block_chain = chain @@ -3939,11 +3939,11 @@ class TwoBlockChains(DistributedBlockChainScene): Write(conflicting), *map(ShowCreation, arrows) ) - self.dither() + self.wait() self.play(ShowCreation(longer_chain_rect)) self.play(Write(checkmark, run_time = 1)) self.play(randy.change, "thinking", checkmark) - self.dither() + self.wait() self.to_fade = VGroup( conflicting, arrows, @@ -3978,7 +3978,7 @@ class TwoBlockChains(DistributedBlockChainScene): randy.change, "confused", block_chains, FadeIn(arrow_block), ) - self.dither() + self.wait() arrow_block = arrow_block.copy() arrow_block.next_to(SPACE_WIDTH*RIGHT, RIGHT) @@ -4002,7 +4002,7 @@ class TwoBlockChains(DistributedBlockChainScene): Write(checkmark), randy.change, "happy", arrow_block ) - self.dither(2) + self.wait(2) #### @@ -4030,7 +4030,7 @@ class ReplaceCentralAuthorityWithWork(Scene): central.shift, DOWN, Write(work) ) - self.dither() + self.wait() class AskAboutTrustingWork(TeacherStudentsScene): def construct(self): @@ -4040,12 +4040,12 @@ class AskAboutTrustingWork(TeacherStudentsScene): target_mode = mode, ) self.change_student_modes("confused", mode, "erm") - self.dither(3) + self.wait(3) self.teacher_says( "Well, let's try\\\\ fooling someone", target_mode = "speaking" ) - self.dither(2) + self.wait(2) class DoubleSpendingAttack(DistributedBlockChainScene): CONFIG = { @@ -4063,7 +4063,7 @@ class DoubleSpendingAttack(DistributedBlockChainScene): block_chains = self.get_distributed_ledgers() self.add(network, block_chains) self.play(self.alice.change, "conniving") - self.dither() + self.wait() def show_fraudulent_block(self): block = self.get_fraud_block() @@ -4075,7 +4075,7 @@ class DoubleSpendingAttack(DistributedBlockChainScene): self.alice.change, "raise_left_hand" ) block.add(block.content) - self.dither() + self.wait() self.block = block @@ -4096,7 +4096,7 @@ class DoubleSpendingAttack(DistributedBlockChainScene): self.alice.change, "happy" ) self.play(ShowCreation(arrow)) - self.dither() + self.wait() def dont_send_to_rest_of_network(self): bubble = ThoughtBubble() @@ -4114,7 +4114,7 @@ class DoubleSpendingAttack(DistributedBlockChainScene): ) self.play(LaggedStart(FadeIn, bubble)) self.play(self.bob.change, "confused", words) - self.dither(2) + self.wait(2) ### @@ -4243,14 +4243,14 @@ class AliceRacesOtherMiners(DoubleSpendingAttack): chain = self.block_chain self.proofs_of_work.add(self.fraud_block.proof_of_work) - self.dither(3) + self.wait(3) self.proofs_of_work.remove(self.fraud_block.proof_of_work) fraud_block.proof_of_work.highlight(GREEN) self.play( Indicate(fraud_block.proof_of_work), self.alice.change, "hooray" ) - self.dither() + self.wait() block = fraud_block.copy() block.generate_target() @@ -4267,7 +4267,7 @@ class AliceRacesOtherMiners(DoubleSpendingAttack): self.play(MoveToTarget(block)) self.play(ShowCreation(arrow)) self.play(self.alice.change, "happy") - self.dither() + self.wait() def receive_broadcast_from_other_miners(self): winner = self.miners[-1] @@ -4314,7 +4314,7 @@ class AliceRacesOtherMiners(DoubleSpendingAttack): self.alice.change, "sassy", ) self.proofs_of_work.add(winner.block.proof_of_work) - self.dither(2) + self.wait(2) self.play( self.alice.change, "pondering", FadeIn(self.fraud_block) @@ -4336,7 +4336,7 @@ class AliceRacesOtherMiners(DoubleSpendingAttack): self.revert_to_original_skipping_status() for winner in winners: - self.dither() + self.wait() if winner == "Alice": block = self.fraud_block prev_block = last_fraud_block @@ -4372,7 +4372,7 @@ class AliceRacesOtherMiners(DoubleSpendingAttack): ##### - def dither(self, time = 1): + def wait(self, time = 1): self.play( Animation(VGroup(*self.foreground_mobjects)), run_time = time @@ -4447,7 +4447,7 @@ class WhenToTrustANewBlock(DistributedBlockChainScene): **kwargs ) ) - self.dither(2) + self.wait(2) def get_block(self): block = DistributedBlockChainScene.get_block(self) @@ -4531,7 +4531,7 @@ class MainIdeas(Scene): self.add(title, h_line) for idea in ideas: self.play(LaggedStart(FadeIn, idea)) - self.dither() + self.wait() class VariableProofOfWork(WhenToTrustANewBlock): CONFIG = { @@ -4585,7 +4585,7 @@ class VariableProofOfWork(WhenToTrustANewBlock): new_digest = sha256_tex_mob(str(x+1), n_zeros) new_digest.replace(digest) Transform(digest, new_digest).update(1) - self.dither(1./20) + self.wait(1./20) proof_of_work.highlight(GREEN) VGroup(*digest[:60]).highlight(YELLOW) @@ -4605,10 +4605,10 @@ class VariableProofOfWork(WhenToTrustANewBlock): self.n_zeros_mob.highlight(YELLOW) self.play(Write(requirement, run_time = 2)) - self.dither(2) + self.wait(2) for n_zeros in 30, 32, 35, 37, 42: self.change_challenge(n_zeros) - self.dither() + self.wait() def add_more_miners(self): miner = self.miner @@ -4630,7 +4630,7 @@ class VariableProofOfWork(WhenToTrustANewBlock): self.play(Transform(miner_block, target)) self.play(LaggedStart(FadeIn, copies)) self.change_challenge(72) - self.dither(2) + self.wait(2) ### def change_challenge(self, n_zeros): @@ -4699,12 +4699,12 @@ class CompareBlockTimes(Scene): FadeIn(examples[0]), DrawBorderThenFill(logos[0]) ) - self.dither() + self.wait() self.play(*[ LaggedStart(FadeIn, VGroup(*group[1:])) for group in examples, logos ]) - self.dither(2) + self.wait(2) # def get_ethereum_logo(self): # logo = SVGMobject( @@ -4760,7 +4760,7 @@ class BlockRewards(Scene): lag_ratio = 0.5 )) self.play(FadeIn(footnote)) - self.dither(3) + self.wait(3) class ShowFirstFewBlocks(ExternallyAnimatedScene): pass @@ -4781,9 +4781,9 @@ class ShowGeometricSum(Scene): self.add(*equation[:2] + equation[-3:-1]) for i in range(2, 9, 2): self.play(FadeIn(VGroup(*equation[i:i+2]))) - self.dither() + self.wait() self.play(Write(equation[-1])) - self.dither(2) + self.wait(2) class TransactionFeeExample(PiCreatureScene): def construct(self): @@ -4825,7 +4825,7 @@ class TransactionFeeExample(PiCreatureScene): fee.set_fill(opacity = 0) self.play(Write(payment)) - self.dither() + self.wait() self.play( alice.change, "raise_right_hand", payment, fee.restore, @@ -4835,13 +4835,13 @@ class TransactionFeeExample(PiCreatureScene): ShowCreation(rect), alice.change_mode, "happy" ) - self.dither() + self.wait() self.play( Write(incentive_words), ShowCreation(arrow), alice.change, "pondering" ) - self.dither(2) + self.wait(2) def create_pi_creature(self): alice = PiCreature(color = BLUE_C) @@ -4911,7 +4911,7 @@ class ShowBitcoinBlockSize(LedgerScene): Write(limit) ) self.play(LaggedStart(FadeIn, payments)) - self.dither() + self.wait() ####Visa @@ -4935,9 +4935,9 @@ class ShowBitcoinBlockSize(LedgerScene): self.play(LaggedStart(DrawBorderThenFill, visa_logo)) self.play(LaggedStart(FadeIn, avg_rate)) - self.dither() + self.wait() self.play(LaggedStart(FadeIn, max_rate)) - self.dither(2) + self.wait(2) class CurrentAverageFees(Scene): def construct(self): @@ -4951,7 +4951,7 @@ class CurrentAverageFees(Scene): fees.to_edge(UP) self.play(Write(fees)) - self.dither() + self.wait() class HighlightingAFewFees(ExternallyAnimatedScene): pass @@ -4987,7 +4987,7 @@ class TopicsNotCovered(TeacherStudentsScene): look_at_arg = topic, added_anims = [LaggedStart(FadeIn, topic)] ) - self.dither() + self.wait() class Exchange(Animation): CONFIG = { @@ -5213,7 +5213,7 @@ class ProtocolLabs(PiCreatureScene): LaggedStart(FadeIn, logo[1]), morty.change, "raise_right_hand", ) - self.dither() + self.wait() self.play( logo.scale, 0.5, logo.to_corner, UP+LEFT, @@ -5223,7 +5223,7 @@ class ProtocolLabs(PiCreatureScene): for mode in modes: for x in range(2): self.play(Blink(morty)) - self.dither(3) + self.wait(3) self.play(morty.change, mode, screen_rect) def get_logo(self): diff --git a/old_projects/domino_play.py b/old_projects/domino_play.py index 3c70dce1..d9402c6a 100644 --- a/old_projects/domino_play.py +++ b/old_projects/domino_play.py @@ -619,7 +619,7 @@ class ContrastTwoGraphs(SimpleVelocityGraph): ShowCreation(graph2, run_time = 4, rate_func = None), Write(hardwood) ) - self.dither() + self.wait() for g, sg in (graph1, smoothed_graph1), (graph2, smoothed_graph2): sg_copy = sg.deepcopy() @@ -640,9 +640,9 @@ class ContrastTwoGraphs(SimpleVelocityGraph): for word in twists, variable_distances: word.to_corner(UP+RIGHT) self.play(Write(twists)) - self.dither() + self.wait() self.play(ReplacementTransform(twists, variable_distances)) - self.dither(3) + self.wait(3) self.play(FadeOut(variable_distances)) self.revert_to_original_skipping_status() @@ -653,7 +653,7 @@ class ContrastTwoGraphs(SimpleVelocityGraph): graph2.move_to, lower_left, DOWN+LEFT, FadeOut(words) ) - self.dither() + self.wait() return #Show moving averages @@ -683,18 +683,18 @@ class ContrastTwoGraphs(SimpleVelocityGraph): dot2.highlight, PINK, rate_func = wiggle ) - self.dither() + self.wait() self.play( FadeOut(arrow), ReplacementTransform(pre_rect, rect), ) - self.dither() + self.wait() self.play( Transform(graph1, smoothed_graph1, run_time = 2), Animation(rect) ) self.play(FadeOut(rect)) - self.dither() + self.wait() self.play(FadeIn(graph2)) self.play(Transform(graph2, smoothed_graph2)) @@ -706,7 +706,7 @@ class ContrastTwoGraphs(SimpleVelocityGraph): LaggedStart(FadeIn, hardwood), run_time = 1 ) - self.dither() + self.wait() #Compare regions dot_group1 = VGroup( @@ -731,7 +731,7 @@ class ContrastTwoGraphs(SimpleVelocityGraph): lag_ratio = 0.05, run_time = 3, )) - self.dither() + self.wait() self.play(ReplacementTransform(rect1, rect2)) for x in range(2): self.play(LaggedStart( @@ -741,7 +741,7 @@ class ContrastTwoGraphs(SimpleVelocityGraph): lag_ratio = 0.05, run_time = 3, )) - self.dither() + self.wait() self.play(ReplacementTransform(rect1, rect3)) for x in range(2): self.play(LaggedStart( @@ -751,7 +751,7 @@ class ContrastTwoGraphs(SimpleVelocityGraph): lag_ratio = 0.05, run_time = 3, )) - self.dither() + self.wait() ### diff --git a/old_projects/efvgt.py b/old_projects/efvgt.py index 388f5815..2e431343 100644 --- a/old_projects/efvgt.py +++ b/old_projects/efvgt.py @@ -194,7 +194,7 @@ class Anniversary(TeacherStudentsScene): ) self.change_student_modes(*["sassy"]*3) self.play(self.get_teacher().change_mode, "shruggie") - self.dither(2) + self.wait(2) def get_party_hats(self): hats = VGroup(*[ @@ -231,16 +231,16 @@ class WatchingScreen(PiCreatureScene): self.add(screen) for mode in "erm", "pondering", "confused": - self.dither() + self.wait() self.change_mode(mode) self.play(Animation(screen)) - self.dither() + self.wait() class LetsStudyTheBasics(TeacherStudentsScene): def construct(self): self.teacher_says("Let's learn some \\\\ group theory!") self.change_student_modes(*["hooray"]*3) - self.dither(2) + self.wait(2) class JustGiveMeAQuickExplanation(TeacherStudentsScene): def construct(self): @@ -255,7 +255,7 @@ class JustGiveMeAQuickExplanation(TeacherStudentsScene): ] for pi in self.get_students()[::2] ])) - self.dither(2) + self.wait(2) class QuickExplanation(ComplexTransformationScene): CONFIG = { @@ -333,14 +333,14 @@ class QuickExplanation(ComplexTransformationScene): color = self.position_color ) - self.dither(2) + self.wait(2) self.play(ShowCreation(s_vector)) self.play(ReplacementTransform( s_vector.copy(), v_vector, path_arc = np.pi/2 )) - self.dither() + self.wait() self.play(v_vector.shift, right) - self.dither() + self.wait() self.vectors = VGroup(s_vector, v_vector) kwargs = { @@ -384,7 +384,7 @@ class SymmetriesOfSquare(ThreeDScene): for index in 0, 2: self.play(Write(title[index], run_time = 1)) self.play(GrowFromCenter(title[1])) - self.dither() + self.wait() self.title = title @@ -397,27 +397,27 @@ class SymmetriesOfSquare(ThreeDScene): self.play(DrawBorderThenFill(self.square)) self.play(GrowFromCenter(brace), Write(q_marks)) self.rotate_square() - self.dither() + self.wait() for axis in UP, UP+RIGHT: self.flip_square(axis) - self.dither() + self.wait() self.rotate_square(-np.pi) - self.dither() + self.wait() self.play(*map(FadeOut, [brace, q_marks])) def talk_through_90_degree_rotation(self): arcs = self.get_rotation_arcs(self.square, np.pi/2) self.play(*map(ShowCreation, arcs)) - self.dither() + self.wait() self.rotate_square(np.pi/2, run_time = 2) - self.dither() + self.wait() self.play(FadeOut(arcs)) - self.dither() + self.wait() def talk_through_vertical_flip(self): self.flip_square(UP, run_time = 2) - self.dither() + self.wait() def confused_by_lack_of_labels(self): randy = Randolph(mode = "confused") @@ -430,7 +430,7 @@ class SymmetriesOfSquare(ThreeDScene): added_anims = [randy.look_at, self.square.points[0]] ) self.play(Blink(randy)) - self.dither() + self.wait() self.randy = randy @@ -445,7 +445,7 @@ class SymmetriesOfSquare(ThreeDScene): self.play(Blink(self.randy)) self.play(FadeOut(self.randy)) - self.dither() + self.wait() def show_full_group(self): new_title = TextMobject("Group", "of", "symmetries") @@ -487,7 +487,7 @@ class SymmetriesOfSquare(ThreeDScene): square.rotation_kwargs = {"angle" : np.pi, "axis" : axis} self.rotate_square(square = square, **square.rotation_kwargs) square.add(axis_line) - self.dither() + self.wait() self.all_squares = all_squares @@ -495,7 +495,7 @@ class SymmetriesOfSquare(ThreeDScene): all_squares = self.all_squares self.play(Indicate(all_squares[0])) - self.dither() + self.wait() self.play(*[ Rotate( @@ -507,7 +507,7 @@ class SymmetriesOfSquare(ThreeDScene): ) for square in all_squares[1:4] ]) - self.dither() + self.wait() def show_bottom_actions(self): for square in self.all_squares[4:]: @@ -517,7 +517,7 @@ class SymmetriesOfSquare(ThreeDScene): run_time = 2, **square.rotation_kwargs ) - self.dither() + self.wait() def name_dihedral_group(self): new_title = TextMobject( @@ -527,7 +527,7 @@ class SymmetriesOfSquare(ThreeDScene): self.play(FadeOut(self.title)) self.play(FadeIn(new_title)) - self.dither() + self.wait() ########## @@ -630,7 +630,7 @@ class ManyGroupsAreInfinite(TeacherStudentsScene): def construct(self): self.teacher_says("Many groups are infinite") self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) class CircleSymmetries(Scene): CONFIG = { @@ -648,7 +648,7 @@ class CircleSymmetries(Scene): circle = self.get_circle() self.play(Write(title), ShowCreation(circle, run_time = 2)) - self.dither() + self.wait() angles = [ np.pi/2, -np.pi/3, 5*np.pi/6, 3*np.pi/2 + 0.1 @@ -656,7 +656,7 @@ class CircleSymmetries(Scene): angles.append(-sum(angles)) for angle in angles: self.play(Rotate(circle, angle = angle)) - self.dither() + self.wait() self.circle = circle @@ -686,9 +686,9 @@ class CircleSymmetries(Scene): run_time = 7, rate_func = rate_func ) - self.dither() + self.wait() self.play(FadeOut(theta_group)) - self.dither() + self.wait() def associate_rotations_with_points(self): zero_dot = Dot(self.circle.point_from_proportion(0)) @@ -702,7 +702,7 @@ class CircleSymmetries(Scene): DrawBorderThenFill(zero_dot) ) self.circle.add(zero_dot) - self.dither() + self.wait() for alpha in 0.2, 0.6, 0.4, 0.8: point = self.circle.point_from_proportion(alpha) @@ -721,13 +721,13 @@ class CircleSymmetries(Scene): Rotate(self.circle, angle, run_time = 2), Animation(dot) ) - self.dither() + self.wait() self.play( Rotate(self.circle, -angle, run_time = 2), FadeOut(dot), FadeOut(arrow), ) - self.dither() + self.wait() #### @@ -788,7 +788,7 @@ class GroupOfCubeSymmetries(ThreeDScene): cube, angle = angle, axis = axis, run_time = 2 )) - self.dither() + self.wait() def get_cube(self): cube = Cube(fill_opacity = self.cube_opacity) @@ -823,7 +823,7 @@ class HowDoSymmetriesPlayWithEachOther(TeacherStudentsScene): target_mode = "hesitant", ) self.change_student_modes("pondering", "maybe", "confused") - self.dither(2) + self.wait(2) class AddSquareSymmetries(SymmetriesOfSquare): def construct(self): @@ -859,13 +859,13 @@ class AddSquareSymmetries(SymmetriesOfSquare): square = square, angle = np.pi/2, added_anims = map(FadeIn, equation[:2]) ) - self.dither() + self.wait() self.play(FadeOut(arcs)) self.flip_square( square = square, axis = UP, added_anims = map(FadeIn, equation[2:4]) ) - self.dither() + self.wait() alt_square.next_to(equals, RIGHT, buff = LARGE_BUFF) alt_square.save_state() alt_square.move_to(square) @@ -879,14 +879,14 @@ class AddSquareSymmetries(SymmetriesOfSquare): square = alt_square, axis = UP+RIGHT, added_anims = map(FadeIn, equation[4:]), ) - self.dither(2) + self.wait(2) ## Reiterate composition self.rotate_square(square = square, angle = np.pi/2) self.flip_square(square = square, axis = UP) - self.dither() + self.wait() self.flip_square(square = alt_square, axis = UP+RIGHT) - self.dither() + self.wait() class AddCircleSymmetries(CircleSymmetries): def construct(self): @@ -928,12 +928,12 @@ class AddCircleSymmetries(CircleSymmetries): ) rotate(circle, angles[0], arcs[0], equation[:2]) - self.dither() + self.wait() circle.add(alt_radius) rotate(circle, angles[1], arcs[1], equation[2:4]) self.play(FadeOut(alt_radius)) circle.remove(alt_radius) - self.dither() + self.wait() circle.add(circle.static_radius) circle.add(*arcs[:2]) @@ -951,19 +951,19 @@ class AddCircleSymmetries(CircleSymmetries): ) arcs[2].shift(alt_circle.get_center()) alt_circle.remove(alt_static_radius) - self.dither() + self.wait() rotate(alt_circle, angles[2], arcs[2], equation[4:]) - self.dither() + self.wait() self.play( Rotate(arcs[1], angles[0], about_point = circle.get_center()) ) - self.dither(2) + self.wait(2) for term, arc in zip(equation[::2], arcs): self.play(*[ ApplyMethod(mob.scale_in_place, 1.2, rate_func = there_and_back) for mob in term, arc ]) - self.dither() + self.wait() class AddCubeSymmetries(GroupOfCubeSymmetries): CONFIG = { @@ -1003,23 +1003,23 @@ class AddCubeSymmetries(GroupOfCubeSymmetries): self.play(Write(equals)) self.play(DrawBorderThenFill(cube3, run_time = 1)) self.rotate_cube(cube3, *angle_axis_pairs[2]) - self.dither(2) + self.wait(2) times = TexMobject("\\times") times.scale(1.5) times.move_to(plus) times.highlight(RED) - self.dither() + self.wait() self.play(ReplacementTransform(plus, times)) self.play(Indicate(times)) - self.dither() + self.wait() for cube, (angle, axis) in zip([cube1, cube_copy, cube3], angle_axis_pairs): self.rotate_cube( cube, -angle, axis, add_arrows = False, rate_func = there_and_back, run_time = 1.5 ) - self.dither() + self.wait() def rotate_cube(self, cube, angle, axis, add_arrows = True, **kwargs): axis = np.dot(axis, self.pose_matrix.T) @@ -1084,7 +1084,7 @@ class DihedralGroupStructure(SymmetriesOfSquare): self.file_away_sum(sum_expression) self.skip_animations = should_skip_animations self.play(FadeIn(sum_expression)) - self.dither(3) + self.wait(3) def demonstrate_sum(self, angle_axis_pairs): @@ -1153,7 +1153,7 @@ class DihedralGroupStructure(SymmetriesOfSquare): ) self.play(*map(ShowCreation, s3.action_illustration)) self.rotate_square(**s3.rotation_kwargs) - self.dither() + self.wait() final_expression.add(*expression) return final_expression @@ -1173,7 +1173,7 @@ class DihedralGroupStructure(SymmetriesOfSquare): target.move_to(x*RIGHT + y*UP) self.play(Transform(sum_expression, target)) - self.dither() + self.wait() self.num_sum_expressions += 1 self.last_sum_expression = sum_expression @@ -1208,7 +1208,7 @@ class ThisIsAVeryGeneralIdea(Scene): ShowCreation(line), Write(example, run_time = 2) ) - self.dither() + self.wait() self.play( VGroup(*examples[:-1]).fade, 0.7, VGroup(*lines[:-1]).fade, 0.7, @@ -1217,7 +1217,7 @@ class ThisIsAVeryGeneralIdea(Scene): self.play( numbers.scale, 1.2, numbers.get_corner(UP+RIGHT), ) - self.dither(2) + self.wait(2) sub_categories = VGroup(*map(TextMobject, [ "Numbers \\\\ (Additive)", @@ -1239,7 +1239,7 @@ class ThisIsAVeryGeneralIdea(Scene): map(ShowCreation, sub_lines), map(Write, sub_categories) )) - self.dither() + self.wait() class NumbersAsActionsQ(TeacherStudentsScene): def construct(self): @@ -1249,7 +1249,7 @@ class NumbersAsActionsQ(TeacherStudentsScene): ) self.change_student_modes("pondering", "confused", "erm") self.play(self.get_teacher().change_mode, "happy") - self.dither(3) + self.wait(3) class AdditiveGroupOfReals(Scene): CONFIG = { @@ -1291,7 +1291,7 @@ class AdditiveGroupOfReals(Scene): self.play(*map(Write, number_line), run_time = 1) self.play(shadow_line.restore, Animation(number_line)) - self.dither() + self.wait() self.number_line = number_line self.shadow_line = shadow_line @@ -1333,7 +1333,7 @@ class AdditiveGroupOfReals(Scene): DrawBorderThenFill(dot), Write(words), ) - self.dither() + self.wait() self.play(*map(FadeOut, [arrow, words])) self.number_line.add(dot) @@ -1347,12 +1347,12 @@ class AdditiveGroupOfReals(Scene): vect = self.number_line.number_to_point(num) - \ self.number_line.number_to_point(0) self.play(ShowCreation(line)) - self.dither() + self.wait() self.play(self.number_line.shift, vect, run_time = 2) - self.dither() + self.wait() if "added_anims" in kwargs: self.play(*kwargs["added_anims"]) - self.dither() + self.wait() self.play( self.number_line.shift, -vect, FadeOut(line) @@ -1370,7 +1370,7 @@ class AdditiveGroupOfReals(Scene): ShowCreation(line), Write(words) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [line, words])) def get_write_name_of_group_anim(self): @@ -1404,7 +1404,7 @@ class AdditiveGroupOfReals(Scene): self.number_line.shift, num_point - zero_point ) - self.dither() + self.wait() #Reset self.play( FadeOut(num_mobs), @@ -1423,13 +1423,13 @@ class AdditiveGroupOfReals(Scene): ShowCreation(arrow), Write(sum_mob, run_time = 1) ) - self.dither() + self.wait() self.play( self.number_line.shift, num_point - zero_point, run_time = 2 ) - self.dither() + self.wait() self.play( self.number_line.restore, *map(FadeOut, [arrows, sum_mob]) @@ -1482,13 +1482,13 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): self.play(ShowCreation(zero_dot)) self.plane.add(zero_dot) self.plane.zero_dot = zero_dot - self.dither() + self.wait() def show_preview_example_slides(self): example_vect = 2*UP+RIGHT for vect in example_vect, -example_vect: self.play(self.plane.shift, vect, run_time = 2) - self.dither() + self.wait() def show_vertical_slide(self): dots = VGroup(*[ @@ -1508,21 +1508,21 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): ShowCreation(dot) ) self.add_foreground_mobjects(dots) - self.dither() + self.wait() Scene.play(self, ShowCreation(arrow)) self.add_foreground_mobjects(arrow) self.play( self.plane.shift, dots[-1].get_center(), run_time = 2 ) - self.dither() + self.wait() self.play(FadeOut(arrow)) self.foreground_mobjects.remove(arrow) self.play( self.plane.shift, 6*DOWN, run_time = 3, ) - self.dither() + self.wait() self.play(self.plane.restore, run_time = 2) self.foreground_mobjects.remove(dots) self.play(FadeOut(dots)) @@ -1546,12 +1546,12 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): Write(label), DrawBorderThenFill(dot) ) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.add_foreground_mobjects(label, dot, arrow) - self.dither() + self.wait() self.slide(z) - self.dither() + self.wait() self.play(FadeOut(self.plane)) self.plane.restore() self.plane.set_stroke(width = 0) @@ -1559,13 +1559,13 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): self.play(ShowCreation(real_arrow)) self.add_foreground_mobjects(real_arrow) self.slide(z.real) - self.dither() + self.wait() self.play(ShowCreation(imag_arrow)) - self.dither() + self.wait() self.play(imag_arrow.shift, self.z_to_point(z.real)) self.add_foreground_mobjects(imag_arrow) self.slide(z - z.real) - self.dither() + self.wait() self.foreground_mobjects.remove(real_arrow) self.foreground_mobjects.remove(imag_arrow) @@ -1606,7 +1606,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): Write(label2) ) self.add_foreground_mobjects(arrow2, dot2, label2) - self.dither() + self.wait() self.slide(z1) arrow2_copy = arrow2.copy() @@ -1615,7 +1615,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): self.slide(z2) self.play(FadeOut(arrow2_copy)) self.foreground_mobjects.remove(arrow2_copy) - self.dither() + self.wait() ##Break into components real_arrow, imag_arrow = component_arrows = [ @@ -1665,7 +1665,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): Write(plus), *map(MoveToTarget, [rp1, rp2]) ) - self.dither() + self.wait() self.play( ShowCreation(imag_arrow), ShowCreation( @@ -1674,7 +1674,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): ), *map(MoveToTarget, [ip1, ip2]) ) - self.dither(2) + self.wait(2) to_remove = [ arrow1, dot1, label1, arrow2, dot2, label2, @@ -1687,7 +1687,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): self.foreground_mobjects.remove(mob) self.play(*map(FadeOut, to_remove)) self.play(self.plane.restore, run_time = 2) - self.dither() + self.wait() def write_group_name(self): title = TextMobject( @@ -1700,7 +1700,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): self.play(Write(title)) self.add_foreground_mobjects(title) - self.dither() + self.wait() def show_some_random_slides(self): example_slides = [ @@ -1712,7 +1712,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene): ] for z in example_slides: self.slide(z) - self.dither() + self.wait() ######### @@ -1758,7 +1758,7 @@ class SchizophrenicNumbers(Scene): self.play(FadeIn(numbers)) self.blink_numbers(numbers) - self.dither() + self.wait() self.add(numbers.copy()) for number in numbers: number.generate_target() @@ -1776,9 +1776,9 @@ class SchizophrenicNumbers(Scene): ) for number, alpha in zip(numbers, np.linspace(0, 0.5, len(numbers))) ]) - self.dither() + self.wait() self.blink_numbers(numbers) - self.dither() + self.wait() def blink_numbers(self, numbers): self.play(*[ @@ -1834,9 +1834,9 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): def introduce_stretch_and_squish(self): for num in [3, 0.25]: self.stretch(num) - self.dither() + self.wait() self.play(self.number_line.restore) - self.dither() + self.wait() def show_zero_fixed_in_place(self): arrow = Arrow(self.zero_point + UP, self.zero_point, buff = 0) @@ -1852,10 +1852,10 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): self.foreground_mobjects.add(arrow) self.stretch(4) self.stretch(0.1) - self.dither() + self.wait() self.play(self.number_line.restore) self.play(FadeOut(words)) - self.dither() + self.wait() self.zero_arrow = arrow @@ -1896,7 +1896,7 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): self.number_line.add(dot) self.number_line.numbers.add(dot) self.number_line.save_state() - self.dither() + self.wait() self.play(*map(FadeOut, [arrow, words])) self.stretch(3) @@ -1909,12 +1909,12 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): dot_copy.move_to, three_line.get_bottom() ) self.play(Indicate(three_mob, run_time = 2)) - self.dither() + self.wait() self.play( self.number_line.restore, *map(FadeOut, [three_line, dot_copy]) ) - self.dither() + self.wait() self.stretch(0.5) self.play( ShowCreation(half_line), @@ -1928,7 +1928,7 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): Write(half_label), ShowCreation(half_arrow) ) - self.dither() + self.wait() self.play( self.number_line.restore, *map(FadeOut, [ @@ -1936,7 +1936,7 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): half_line, dot_copy ]) ) - self.dither() + self.wait() self.one_dot = dot @@ -1963,20 +1963,20 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): self.zero_arrow.shift, 0.5*UP, rate_func = there_and_back ) - self.dither() + self.wait() self.play( self.one_dot.shift, 0.25*UP, rate_func = wiggle ) self.stretch(3) self.stretch(0.33/3, run_time = 3) - self.dither() + self.wait() self.play(ShowCreation(third_line), Animation(self.one)) self.play( ShowCreation(positive_reals_line), Write(positive_reals_words), ) - self.dither() + self.wait() self.play( ReplacementTransform(third_line, one_line), self.number_line.restore, @@ -1989,7 +1989,7 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): 7, run_time = 10, rate_func = there_and_back, added_anims = [Animation(positive_reals_words)] ) - self.dither() + self.wait() def compose_actions(self, num1, num2): words = VGroup(*[ @@ -2013,14 +2013,14 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): added_anims = [FadeIn(word)], run_time = 3 ) - self.dither() + self.wait() self.play(Write(bottom_words, run_time = 2)) - self.dither(2) + self.wait(2) self.play( ApplyMethod(self.number_line.restore, run_time = 2), FadeOut(words), ) - self.dither() + self.wait() def write_group_name(self): new_title = TextMobject( @@ -2035,7 +2035,7 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals): ).highlight(self.positive_reals_color) self.play(Transform(self.title, new_title)) - self.dither() + self.wait() ### @@ -2098,7 +2098,7 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): title.add_background_rectangle() self.play(Write(title, run_time = 2)) - self.dither() + self.wait() self.add_foreground_mobjects(title) def fix_zero_and_move_one(self): @@ -2133,7 +2133,7 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): ShowCreation(one_arrow), Indicate(self.plane.one_dot, color = RED), ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ zero_words, zero_arrow, one_words, one_arrow, @@ -2148,9 +2148,9 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): ] for last_z, z in zip([1] + z_list, z_list): self.multiply_by_z(z/last_z) - self.dither() + self.wait() self.reset_plane() - self.dither() + self.wait() def show_action_at_i(self): i_point = self.z_to_point(complex(0, 1)) @@ -2172,16 +2172,16 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): ShowCreation(i_arrow), DrawBorderThenFill(i_dot) ) - self.dither() + self.wait() self.play( FadeOut(i_arrow), ShowCreation(arc) ) self.add_foreground_mobjects(arc) - self.dither(2) + self.wait(2) self.multiply_by_z(complex(0, 1), run_time = 3) self.remove(i_dot) - self.dither() + self.wait() self.turn_arrow = arc @@ -2198,14 +2198,14 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): half_turn_arc.add_tip(tip_length = 0.15) self.multiply_by_z(complex(0, 1), run_time = 3) - self.dither() + self.wait() self.play(Transform( self.turn_arrow, half_turn_arc, path_arc = np.pi/2 )) - self.dither() + self.wait() self.play(Indicate(neg_one_label, run_time = 2)) - self.dither() + self.wait() self.foreground_mobjects.remove(self.turn_arrow) self.reset_plane(FadeOut(self.turn_arrow)) @@ -2218,7 +2218,7 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): equation.highlight(MULTIPLIER_COLOR) self.play(Write(equation, run_time = 2)) - self.dither() + self.wait() for term in terms[:2]: self.multiply_by_z( complex(0, 1), @@ -2227,9 +2227,9 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): Indicate(term, color = RED, run_time = 2) ] ) - self.dither() + self.wait() self.play(Indicate(terms[-1], color = RED, run_time = 2)) - self.dither() + self.wait() self.reset_plane(FadeOut(equation)) def talk_through_specific_example(self): @@ -2265,9 +2265,9 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): DrawBorderThenFill(dot) ) self.add_foreground_mobjects(label, dot) - self.dither() + self.wait() self.multiply_by_z(z, run_time = 3) - self.dither() + self.wait() self.reset_plane() self.multiply_by_z( np.exp(complex(0, 1)*angle), @@ -2277,14 +2277,14 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): ] ) self.add_foreground_mobjects(arc, angle_label) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(brace_text) ) self.add_foreground_mobjects(brace, brace_text) self.multiply_by_z(np.sqrt(5), run_time = 3) - self.dither(2) + self.wait(2) to_remove = [ label, dot, brace, brace_text, @@ -2293,7 +2293,7 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): for mob in to_remove: self.foreground_mobjects.remove(mob) self.reset_plane(*map(FadeOut, to_remove)) - self.dither() + self.wait() def show_break_down(self): positive_reals = Line(ORIGIN, SPACE_WIDTH*RIGHT) @@ -2312,12 +2312,12 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): self.add_foreground_mobjects(positive_reals) for last_z, z in zip([1]+real_actions, real_actions): self.multiply_by_z(z/last_z) - self.dither() + self.wait() self.play(ShowCreation(circle)) self.add_foreground_mobjects(circle) for last_z, z in zip([1]+rotation_actions, rotation_actions): self.multiply_by_z(z/last_z, run_time = 3) - self.dither() + self.wait() def example_actions_broken_down(self): z_list = [ @@ -2338,9 +2338,9 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers): self.play(dot.restore) self.multiply_by_z(norm) - self.dither() + self.wait() self.multiply_by_z(rot_z) - self.dither() + self.wait() self.reset_plane(FadeOut(dot)) ## @@ -2392,7 +2392,7 @@ class ExponentsAsRepeatedMultiplication(TeacherStudentsScene): for mob in three_twos: self.play(Write(mob, run_time = 1)) self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) self.play( FadeIn(five_twos.brace), FadeIn(five_twos.exp), @@ -2405,7 +2405,7 @@ class ExponentsAsRepeatedMultiplication(TeacherStudentsScene): run_time = 3, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) cdot = TexMobject("\\cdot") lhs = TexMobject("2^{%d + %d} = "%tuple(exponents)) @@ -2424,11 +2424,11 @@ class ExponentsAsRepeatedMultiplication(TeacherStudentsScene): Write(cdot), self.get_teacher().change_mode, "happy", ) - self.dither() + self.wait() self.play(Write(lhs)) - self.dither() + self.wait() self.change_student_modes(*["happy"]*3) - self.dither() + self.wait() general_equation = TexMobject("2^{x+y}=", "2^x", "2^y") general_equation.to_edge(UP, buff = MED_LARGE_BUFF) @@ -2442,7 +2442,7 @@ class ExponentsAsRepeatedMultiplication(TeacherStudentsScene): lhs, three_twos.exp, five_twos.exp ]) ]) - self.dither(2) + self.wait(2) self.exponential_rule = general_equation self.expanded_exponential_rule = VGroup( @@ -2472,20 +2472,20 @@ class ExponentsAsRepeatedMultiplication(TeacherStudentsScene): ) for mob in alt_powers[1:]: self.play(Write(mob, run_time = 1)) - self.dither() - self.dither() + self.wait() + self.wait() self.play(*it.chain(*[ [pi.change_mode, "confused", pi.look_at, half_power] for pi in self.get_students() ])) for power in alt_powers[:2]: self.play(Indicate(power)) - self.dither() - self.dither() + self.wait() + self.wait() self.teacher_says("Extend the \\\\ definition") self.change_student_modes("pondering", "confused", "erm") - self.dither() + self.wait() half_expression = TexMobject( "\\big(", "2^{1/2}", "\\big)", @@ -2507,18 +2507,18 @@ class ExponentsAsRepeatedMultiplication(TeacherStudentsScene): Write(half_expression), RemovePiCreatureBubble(self.get_teacher()), ) - self.dither() + self.wait() self.play( Transform(neg_power, neg_one_expression[1]), Write(neg_one_expression) ) - self.dither(2) + self.wait(2) self.play( self.exponential_rule.next_to, self.get_teacher().get_corner(UP+LEFT), UP, MED_LARGE_BUFF, self.get_teacher().change_mode, "raise_right_hand", ) - self.dither(2) + self.wait(2) self.play( imag_power.move_to, UP, imag_power.scale_in_place, 1.5, @@ -2530,7 +2530,7 @@ class ExponentsAsRepeatedMultiplication(TeacherStudentsScene): [pi.change_mode, "pondering", pi.look_at, imag_power] for pi in self.get_students() ])) - self.dither() + self.wait() group_theory_words = TextMobject("Group theory?") group_theory_words.next_to( @@ -2547,7 +2547,7 @@ class ExponentsAsRepeatedMultiplication(TeacherStudentsScene): Write(group_theory_words), ShowCreation(arrow) ) - self.dither(2) + self.wait(2) class ExponentsAsHomomorphism(Scene): CONFIG = { @@ -2589,8 +2589,8 @@ class ExponentsAsHomomorphism(Scene): GrowFromCenter(brace), Write(text) ) - self.dither() - self.dither() + self.wait() + self.wait() self.equation = equation self.lhs_brace_group = VGroup(lhs_brace, lhs_text) @@ -2612,10 +2612,10 @@ class ExponentsAsHomomorphism(Scene): FadeOut(self.lhs_brace_group), Write(top_line) ) - self.dither() + self.wait() for x in 3, 5, -8: self.play(top_line.shift, x*RIGHT, run_time = 2) - self.dither() + self.wait() self.top_line = top_line self.adders = adders @@ -2643,7 +2643,7 @@ class ExponentsAsHomomorphism(Scene): self.get_stretch_anim(bottom_line, x), run_time = 3 ) - self.dither() + self.wait() self.bottom_line = bottom_line self.multipliers = multipliers @@ -2667,7 +2667,7 @@ class ExponentsAsHomomorphism(Scene): ) self.play(randy.look_at, arrow.get_bottom()) self.play(Blink(randy)) - self.dither() + self.wait() for x in 1, -2, 3, 1, -3: self.play( self.get_stretch_anim(self.bottom_line, 2**x), @@ -2678,7 +2678,7 @@ class ExponentsAsHomomorphism(Scene): if random.random() < 0.3: self.play(Blink(randy)) else: - self.dither() + self.wait() self.randy = randy @@ -2701,7 +2701,7 @@ class ExponentsAsHomomorphism(Scene): randy.change_mode, "pondering", randy.look_at, self.equation ) - self.dither() + self.wait() self.play(randy.look_at, self.top_line) self.show_composition( *inputs, @@ -2715,7 +2715,7 @@ class ExponentsAsHomomorphism(Scene): *inputs, parallel_anims = map(MoveToTarget, self.multipliers) ) - self.dither() + self.wait() def add_quote(self): brace = Brace(self.equation, UP) @@ -2730,9 +2730,9 @@ class ExponentsAsHomomorphism(Scene): ) self.play(self.randy.change_mode, "thinking") self.play(Blink(self.randy)) - self.dither() + self.wait() self.show_composition(-1, 2) - self.dither() + self.wait() #### @@ -2753,7 +2753,7 @@ class ExponentsAsHomomorphism(Scene): anim.set_run_time(2) self.play(parallel_anim) self.play(*anims) - self.dither() + self.wait() self.play(*[ line.restore for line in self.top_line, self.bottom_line @@ -2826,7 +2826,7 @@ class DihedralCubeHomomorphism(GroupOfCubeSymmetries, SymmetriesOfSquare): ) for mob, axis in (square, raw_axis), (cube, posed_axis) ]) - self.dither() + self.wait() if i == 2: for group, color in (homo_group, YELLOW), (morph_group, BLUE): part, remainder = group[0], VGroup(*group[1:]) @@ -2865,7 +2865,7 @@ class ComplexExponentiationAbstract(): self.take_steps_for_e() self.write_eulers_formula() self.show_pure_imaginary_actions(-np.pi, np.pi) - self.dither() + self.wait() def add_vertical_line(self): line = Line(SPACE_HEIGHT*UP, SPACE_HEIGHT*DOWN) @@ -2897,7 +2897,7 @@ class ComplexExponentiationAbstract(): func_mob.add_background_rectangle() self.add_foreground_mobjects(arrow, func_mob) - self.dither() + self.wait() self.func_mob = func_mob def show_example(self, z): @@ -2921,12 +2921,12 @@ class ComplexExponentiationAbstract(): def show_real_actions(self, *example_inputs): for x in example_inputs: self.apply_action(x) - self.dither() + self.wait() def show_pure_imaginary_actions(self, *example_input_imag_parts): for y in example_input_imag_parts: self.apply_action(complex(0, y), run_time = 3) - self.dither() + self.wait() def change_base(self, new_base, new_base_tex): new_func_mob = TexMobject(new_base_tex + "^x") @@ -2935,7 +2935,7 @@ class ComplexExponentiationAbstract(): self.play(FocusOn(self.func_mob)) self.play(Transform(self.func_mob, new_func_mob)) - self.dither() + self.wait() self.base = new_base def write_eulers_formula(self): @@ -2950,7 +2950,7 @@ class ComplexExponentiationAbstract(): Scene.play(self, Write(formula)) self.add_foreground_mobjects(formula) - self.dither(2) + self.wait(2) class ComplexExponentiationAdderHalf( ComplexExponentiationAbstract, @@ -2990,7 +2990,7 @@ class ComplexExponentiationAdderHalf( line.rotate, np.pi/24, rate_func = wiggle, ) - self.dither() + self.wait() self.foreground_mobjects = [line] + self.foreground_mobjects self.vertical_line = line @@ -3015,7 +3015,7 @@ class ComplexExponentiationAdderHalf( line, circle, run_time = 3 )) self.remove(circle) - self.dither() + self.wait() def walk_input_up_vertical(self): arrow = Arrow(ORIGIN, UP, buff = 0, tip_length = 0.15) @@ -3031,9 +3031,9 @@ class ComplexExponentiationAdderHalf( Write(brace_text, run_time = 1) ) self.add_foreground_mobjects(brace, brace_text) - self.dither() + self.wait() self.apply_action(complex(0, 1)) - self.dither(7)##Line up with MultiplierHalf + self.wait(7)##Line up with MultiplierHalf to_remove = arrow, brace, brace_text for mob in to_remove: @@ -3074,8 +3074,8 @@ class ComplexExponentiationAdderHalf( Transform(curr_brace, brace), Transform(curr_label, label), ) - self.dither() - self.dither(4) ##Line up with multiplier half + self.wait() + self.wait(4) ##Line up with multiplier half class ComplexExponentiationMultiplierHalf( ComplexExponentiationAbstract, @@ -3097,7 +3097,7 @@ class ComplexExponentiationMultiplierHalf( def highlight_vertical_line(self): self.play(FadeOut(self.real_line)) self.foreground_mobjects.remove(self.real_line) - self.dither(2) + self.wait(2) def highlight_unit_circle(self): line = VGroup( @@ -3119,7 +3119,7 @@ class ComplexExponentiationMultiplierHalf( line, circle, run_time = 3 )) self.add_foreground_mobjects(circle) - self.dither() + self.wait() def walk_input_up_vertical(self): output_z = self.base**complex(0, 1) @@ -3128,7 +3128,7 @@ class ComplexExponentiationMultiplierHalf( arc, brace, curved_brace, radians_label = \ self.get_arc_braces_and_label(angle) - self.dither(3) + self.wait(3) self.apply_action(complex(0, 1)) Scene.play(self, ShowCreation(arc)) @@ -3136,7 +3136,7 @@ class ComplexExponentiationMultiplierHalf( self.play(GrowFromCenter(brace)) self.play(Transform(brace, curved_brace)) self.play(Write(radians_label, run_time = 2)) - self.dither(2) + self.wait(2) self.foreground_mobjects.remove(arc) self.play(*map(FadeOut, [arc, brace, radians_label])) @@ -3178,7 +3178,7 @@ class ComplexExponentiationMultiplierHalf( label.next_to(curved_brace, UP, buff = SMALL_BUFF) self.apply_action(complex(0, angle-last_angle)) - self.dither(2)#Line up with Adder half + self.wait(2)#Line up with Adder half if curr_brace is None: curr_brace = curved_brace curr_label = label @@ -3201,8 +3201,8 @@ class ComplexExponentiationMultiplierHalf( Transform(curr_brace, curved_brace), Transform(curr_label, label), ) - self.dither() - self.dither() + self.wait() + self.wait() class ExpComplexHomomorphismPreviewAbstract(ComplexExponentiationAbstract): def construct(self): @@ -3215,7 +3215,7 @@ class ExpComplexHomomorphismPreviewAbstract(ComplexExponentiationAbstract): self.change_base(np.exp(1), "e") self.write_eulers_formula() self.show_pure_imaginary_actions(np.pi, 0, -np.pi) - self.dither() + self.wait() class ExpComplexHomomorphismPreviewAdderHalf( ExpComplexHomomorphismPreviewAbstract, @@ -3235,7 +3235,7 @@ class WhyE(TeacherStudentsScene): def construct(self): self.student_says("Why e?") self.play(self.get_teacher().change_mode, "pondering") - self.dither(3) + self.wait(3) class ReadFormula(Scene): def construct(self): @@ -3250,11 +3250,11 @@ class ReadFormula(Scene): randy.look_at(formula) self.add(randy, formula) - self.dither() + self.wait() self.play(randy.change_mode, "thinking") - self.dither() + self.wait() self.play(Blink(randy)) - self.dither(3) + self.wait(3) class EfvgtPatreonThanks(PatreonThanks): CONFIG = { @@ -3324,7 +3324,7 @@ class ECLPromo(PiCreatureScene): self.pi_creature.change_mode, "hooray", ShowCreation(rect) ) - self.dither(3) + self.wait(3) self.play(FadeIn( logo_part1, run_time = 3, submobject_mode = "lagged_start" @@ -3346,12 +3346,12 @@ class ECLPromo(PiCreatureScene): self.pi_creature.change_mode, "happy" ) self.play(self.pi_creature.look_at, rect) - self.dither(10) + self.wait(10) self.play( self.pi_creature.change_mode, "pondering", self.pi_creature.look, DOWN ) - self.dither(10) + self.wait(10) class ExpTransformation(ComplexTransformationScene): CONFIG = { @@ -3383,7 +3383,7 @@ class ExpTransformation(ComplexTransformationScene): run_time = 5 )) self.play(Transform(self.plane, final_plane, run_time = 3)) - self.dither(3) + self.wait(3) class Thumbnail(Scene): def construct(self): diff --git a/old_projects/eoc/chapter1.py b/old_projects/eoc/chapter1.py index 5e6adca4..900d82ed 100644 --- a/old_projects/eoc/chapter1.py +++ b/old_projects/eoc/chapter1.py @@ -129,7 +129,7 @@ class CircleScene(PiCreatureScene): Write(nudge_label), run_time = run_time/2. ) - self.dither(run_time/2.) + self.wait(run_time/2.) self.nudge_line = nudge_line self.nudge_arrow = nudge_arrow self.nudge_label = nudge_label @@ -300,7 +300,7 @@ class Introduction(TeacherStudentsScene): for pi in self.get_pi_creatures() ] ) - self.dither(3) + self.wait(3) self.series = series self.essence_words = essence_words @@ -347,12 +347,12 @@ class Introduction(TeacherStudentsScene): self.teacher.change_mode, "plain" ] ) - self.dither(2) + self.wait(2) self.play( Write(rules[0]), self.teacher.change_mode, "raise_right_hand", ) - self.dither() + self.wait() alt_rules_list = list(rules[1:]) + [VectorizedPoint(self.teacher.eyes.get_top())] for last_rule, rule, video_index in zip(rules, alt_rules_list, video_indices): video = self.series[video_index] @@ -361,7 +361,7 @@ class Introduction(TeacherStudentsScene): FadeIn(rule), ) self.play(Animation(rule)) - self.dither() + self.wait() self.play( self.teacher.change_mode, "happy", self.teacher.look_at, student.eyes @@ -404,7 +404,7 @@ class Introduction(TeacherStudentsScene): student.look_at, calculus ) self.play(ShowCreation(arrow)) - self.dither(2) + self.wait(2) class PreviewFrame(Scene): def construct(self): @@ -425,10 +425,10 @@ class PreviewFrame(Scene): frame.next_to(title, DOWN) self.add(frame, title) - self.dither(3) + self.wait(3) for next_title in titles[1:]: self.play(Transform(title, next_title)) - self.dither(3) + self.wait(3) class ProductRuleDiagram(Scene): def construct(self): @@ -516,7 +516,7 @@ class ProductRuleDiagram(Scene): ReplacementTransform(d_rect.line, d_rect) for d_rect in d_rects ]) - self.dither() + self.wait() self.play( d_rects.space_out_submobjects, 1.2, MaintainPositionRelativeTo( @@ -528,7 +528,7 @@ class ProductRuleDiagram(Scene): dg_rect ), ) - self.dither() + self.wait() deriv = TexMobject( "d(", "fg", ")", "=", @@ -556,7 +556,7 @@ class ProductRuleDiagram(Scene): for tex in "d(", ")", "=", "\\cdot", "+" ]))) ], run_time = 3) - self.dither() + self.wait() class IntroduceCircle(CircleScene): CONFIG = { @@ -580,7 +580,7 @@ class IntroduceCircle(CircleScene): self.pi_creature.look_at, self.circle ) self.introduce_circle() - self.dither() + self.wait() R_copy = self.radius_label.copy() self.play( self.pi_creature.change_mode, "raise_right_hand", @@ -589,7 +589,7 @@ class IntroduceCircle(CircleScene): ) self.play(Write(area)) self.remove(R_copy) - self.dither() + self.wait() self.area = area @@ -614,14 +614,14 @@ class IntroduceCircle(CircleScene): self.pi_creature.change_mode, "confused", self.pi_creature.look_at, self.area, ) - self.dither() + self.wait() self.play( FadeIn(rings, **ring_anim_kwargs), Animation(self.radius_group), FadeOut(q_marks), self.pi_creature.change_mode, "thinking" ) - self.dither() + self.wait() self.play( rings.rotate, np.pi/2, rings.move_to, unwrapped_rings.get_top(), @@ -632,7 +632,7 @@ class IntroduceCircle(CircleScene): self.play( Transform(rings, unwrapped_rings, **ring_anim_kwargs), ) - self.dither() + self.wait() def show_calculus_symbols(self): ftc = TexMobject( @@ -648,7 +648,7 @@ class IntroduceCircle(CircleScene): ), self.pi_creature.change_mode, "plain" ) - self.dither() + self.wait() self.play( ReplacementTransform( self.area.get_part_by_tex("Area").copy(), @@ -659,9 +659,9 @@ class IntroduceCircle(CircleScene): ftc.get_part_by_tex("\\,dr") ) ) - self.dither() + self.wait() self.play(Write(VGroup(*ftc[-2:]))) - self.dither(2) + self.wait(2) class ApproximateOneRing(CircleScene, ReconfigurableScene): CONFIG = { @@ -698,7 +698,7 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): self.radius_label, three, path_arc = np.pi )) - self.dither() + self.wait() def try_to_understand_area(self): line_sets = [ @@ -729,14 +729,14 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): Animation(self.radius_group), self.pi_creature.change_mode, "maybe" ) - self.dither(2) + self.wait(2) for new_lines in line_sets[1:]: self.play( Transform(lines, new_lines), Animation(self.radius_group) ) - self.dither() - self.dither() + self.wait() + self.wait() self.play(FadeOut(lines), Animation(self.radius_group)) def slice_into_rings(self): @@ -753,14 +753,14 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): self.pi_creature.change_mode, "pondering", self.pi_creature.look_at, self.circle ) - self.dither(2) + self.wait(2) for x in range(2): self.play( Rotate(rings, np.pi, in_place = True, run_time = 2), Animation(self.radius_group), self.pi_creature.change_mode, "happy" ) - self.dither(2) + self.wait(2) self.rings = rings @@ -789,9 +789,9 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): self.play(ShowCreation(radius)) self.play(Write(r_label)) - self.dither() + self.wait() self.play(Write(area_q)) - self.dither() + self.wait() self.play(*[ ApplyMethod( r.set_fill, YELLOW, @@ -802,9 +802,9 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): ]+[ Animation(self.radius_group) ]) - self.dither() + self.wait() self.change_mode("thinking") - self.dither() + self.wait() self.original_ring = original_ring self.ring = ring @@ -823,9 +823,9 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): self.unwrap_ring(ring, to_edge = RIGHT) self.change_mode("pondering") - self.dither() + self.wait() self.play(Write(trapezoid)) - self.dither() + self.wait() self.play(trapezoid.shift, DOWN) strike = Line( trapezoid.get_left(), trapezoid.get_right(), @@ -837,7 +837,7 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): ShowCreation(strike), self.pi_creature.change_mode, "happy" ) - self.dither() + self.wait() self.play(*map(FadeOut, [trapezoid, strike])) self.unwrapped_ring = ring @@ -894,13 +894,13 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): width_label.get_part_by_tex("r") ) ) - self.dither() + self.wait() self.play( GrowFromCenter(side_brace), Write(q_marks) ) self.change_mode("confused") - self.dither() + self.wait() for num_rings in 20, 7: self.show_alternate_width(num_rings) self.play(ReplacementTransform(q_marks, dr_label)) @@ -909,19 +909,19 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): ReplacementTransform(dr_label.copy(), alt_dr_label), run_time = 2 ) - self.dither() + self.wait() self.play( dr_label.next_to, concrete_dr.copy(), LEFT, SMALL_BUFF, DOWN, Write(concrete_dr, run_time = 2), self.pi_creature.change_mode, "pondering" ) - self.dither(2) + self.wait(2) self.play( MoveToTarget(two_pi_r_dr), FadeIn(approx), self.area_q.get_part_by_tex("?").fade, 1, ) - self.dither() + self.wait() self.play( FadeOut(concrete_dr), dr_label.restore @@ -931,7 +931,7 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): transformation_kwargs = {"run_time" : 4}, return_to_original_configuration = False, ) - self.dither(2) + self.wait(2) self.look_at(self.circle) self.play( ApplyWave(self.rings, amplitude = 0.1), @@ -941,7 +941,7 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene): run_time = 3, submobject_mode = "lagged_start" ) - self.dither(2) + self.wait(2) def show_alternate_width(self, num_rings, **kwargs): self.transition_to_alt_config( @@ -955,7 +955,7 @@ class MoveForwardWithApproximation(TeacherStudentsScene): "the", "approximation" ) self.change_student_modes("hesitant", "erm", "sassy") - self.dither() + self.wait() words = TextMobject( "It gets better", "\\\\ for smaller ", @@ -963,7 +963,7 @@ class MoveForwardWithApproximation(TeacherStudentsScene): ) words.highlight_by_tex("dr", BLUE) self.teacher_says(words, target_mode = "shruggie") - self.dither(3) + self.wait(3) class GraphRectangles(CircleScene, GraphScene): CONFIG = { @@ -1033,11 +1033,11 @@ class GraphRectangles(CircleScene, GraphScene): self.add(rings, self.radius_group) self.remove(self.circle) - self.dither() + self.wait() self.play(*draw_ring_sum_anims) self.play(Write(area_label, run_time = 2)) self.play(ShowCreation(arrows)) - self.dither() + self.wait() self.ring_sum = ring_sum area_label.add(arrows) @@ -1096,16 +1096,16 @@ class GraphRectangles(CircleScene, GraphScene): ShowCreation(first_tick), ) self.play(Indicate(self.rings[0])) - self.dither() + self.wait() self.play( Transform(moving_arrow, arrows[-1]), ShowCreation(r_ticks, submobject_mode = "lagged_start"), run_time = 2 ) self.play(Indicate(self.rings[-1])) - self.dither() + self.wait() self.play(FadeIn(dr_group)) - self.dither() + self.wait() self.play(*map(FadeOut, [moving_arrow, values_of_r])) self.x_axis.add(r_ticks) @@ -1171,7 +1171,7 @@ class GraphRectangles(CircleScene, GraphScene): ), Animation(self.x_axis), ) - self.dither(2) + self.wait(2) self.play(*[ MoveToTarget( ring, @@ -1184,7 +1184,7 @@ class GraphRectangles(CircleScene, GraphScene): np.linspace(0, 0.75, len(transformed_rings)) ) ] + foreground_animations) - self.dither() + self.wait() ##Demonstrate height of one rect highlighted_ring = transformed_rings[6].copy() @@ -1207,16 +1207,16 @@ class GraphRectangles(CircleScene, GraphScene): self.dr_group.next_to, highlighted_ring, DOWN, SMALL_BUFF ) - self.dither() + self.wait() self.play( GrowFromCenter(side_brace), Write(height_label) ) - self.dither() + self.wait() self.play(Transform(highlighted_ring, original_ring)) - self.dither() + self.wait() self.play(highlighted_ring.restore) - self.dither() + self.wait() self.play( transformed_rings.set_fill, None, 1, FadeOut(side_brace), @@ -1224,7 +1224,7 @@ class GraphRectangles(CircleScene, GraphScene): *foreground_animations ) self.remove(highlighted_ring) - self.dither() + self.wait() ##Rescale self.play(*[ @@ -1239,7 +1239,7 @@ class GraphRectangles(CircleScene, GraphScene): ] + foreground_animations) self.remove(transformed_rings) self.add(rects) - self.dither() + self.wait() self.rects = rects @@ -1253,7 +1253,7 @@ class GraphRectangles(CircleScene, GraphScene): self.play(ShowCreation(self.graph)) self.play(Write(graph_label)) - self.dither() + self.wait() self.play(*[ Transform( rect, flat_rect, @@ -1270,7 +1270,7 @@ class GraphRectangles(CircleScene, GraphScene): ) ] + map(Animation, [self.x_axis, self.graph]) ) - self.dither(2) + self.wait(2) def point_out_approximation(self): rect = self.rects[10] @@ -1286,12 +1286,12 @@ class GraphRectangles(CircleScene, GraphScene): MoveToTarget(rect), Write(approximation), ) - self.dither(2) + self.wait(2) self.play( rect.restore, FadeOut(approximation) ) - self.dither() + self.wait() def let_dr_approah_zero(self): thinner_rects_list = [ @@ -1319,14 +1319,14 @@ class GraphRectangles(CircleScene, GraphScene): Animation(self.axes), Animation(self.graph), ) - self.dither() + self.wait() self.play(ApplyWave( self.rects, direction = RIGHT, run_time = 2, submobject_mode = "lagged_start", )) - self.dither() + self.wait() def compute_area_under_graph(self): formula, formula_with_R = formulas = [ @@ -1355,29 +1355,29 @@ class GraphRectangles(CircleScene, GraphScene): self.play(Write(formula.top_line, run_time = 2)) self.play(FocusOn(base_line)) self.play(ShowCreation(base_line)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(height_label) ) - self.dither() + self.wait() self.play(FocusOn(formula)) self.play(Write(formula.mid_line)) - self.dither() + self.wait() self.play(Write(formula.bottom_line)) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ self.ghost_rings, self.ring_sum.tex_mobs ])) self.play(*map(FadeIn, [fresh_rings, self.radius_group])) - self.dither() + self.wait() self.play( Transform(formula, formula_with_R), Transform(height_label, height_label_with_R), ) - self.dither(2) + self.wait(2) self.fresh_rings = fresh_rings @@ -1414,7 +1414,7 @@ class GraphRectangles(CircleScene, GraphScene): ), Animation(self.radius_group) ) - self.dither() + self.wait() ##### @@ -1500,7 +1500,7 @@ class ThinkLikeAMathematician(TeacherStudentsScene): pi_R_squraed.set_fill, None, 1 ) self.change_student_modes(*["hooray"]*3) - self.dither(2) + self.wait(2) self.change_student_modes( *["pondering"]*3, look_at_arg = self.teacher.eyes, @@ -1510,7 +1510,7 @@ class ThinkLikeAMathematician(TeacherStudentsScene): ) self.play(FadeOut(pi_R_squraed)) self.look_at(2*UP+4*LEFT) - self.dither(5) + self.wait(5) class TwoThingsToNotice(TeacherStudentsScene): def construct(self): @@ -1520,7 +1520,7 @@ class TwoThingsToNotice(TeacherStudentsScene): ) words.highlight_by_tex("dr", GREEN) self.teacher_says(words, run_time = 1) - self.dither(3) + self.wait(3) class RecapCircleSolution(GraphRectangles, ReconfigurableScene): def setup(self): @@ -1555,7 +1555,7 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene): integral_condition, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play(*draw_ring_sum_anims) self.rings = rings @@ -1613,12 +1613,12 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene): for approximation in approximations ] ) - self.dither() + self.wait() self.play(Write(VGroup(*[ approximation[0] for approximation in approximations ]))) - self.dither() + self.wait() self.area_label = area_label self.area_arrows = arrows @@ -1652,15 +1652,15 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene): run_time = 2, path_arc = np.pi/2, )) - self.dither() + self.wait() self.play(FadeIn(self.x_axis)) self.play(Write(r_ticks, run_time = 1)) - self.dither() + self.wait() self.play( GrowFromCenter(dr_brace), dr_copy.next_to, dr_brace.copy(), UP ) - self.dither() + self.wait() self.r_ticks = r_ticks self.dr_brace_group = VGroup(dr_brace, dr_copy) @@ -1702,7 +1702,7 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene): ) self.play(ShowCreation(graph)) self.play(Write(graph_label)) - self.dither() + self.wait() self.graph = graph self.graph_label = graph_label @@ -1732,7 +1732,7 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene): Animation(self.axes), Animation(self.graph), ) - self.dither() + self.wait() def full_precision(self): words = TextMobject("Area under \\\\ a graph") @@ -1756,9 +1756,9 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene): arc.next_to(arc_next_to_group, LEFT, SMALL_BUFF) self.play(Write(group)) - self.dither() + self.wait() self.play(ShowCreation(arc)) - self.dither() + self.wait() class ExampleIntegralProblems(PiCreatureScene, GraphScene): CONFIG = { @@ -1787,7 +1787,7 @@ class ExampleIntegralProblems(PiCreatureScene, GraphScene): Write(words), self.pi_creature.change_mode, "raise_right_hand" ) - self.dither() + self.wait() self.words = words @@ -1837,10 +1837,10 @@ class ExampleIntegralProblems(PiCreatureScene, GraphScene): ), run_time = self.t_max ) - self.dither() + self.wait() for mob in v_dt: self.play(Indicate(mob)) - self.dither(2) + self.wait(2) self.v_dt_brace_group = v_dt_brace_group self.line = line @@ -1895,14 +1895,14 @@ class ExampleIntegralProblems(PiCreatureScene, GraphScene): ) self.play(ShowCreation(v_graph)) self.change_mode("pondering") - self.dither() + self.wait() self.play( v_t.next_to, brace, LEFT, SMALL_BUFF, dt.next_to, special_rect, DOWN, special_rect.set_fill, None, 1, ReplacementTransform(start_brace, brace), ) - self.dither(3) + self.wait(3) self.v_graph = v_graph self.rects = rects @@ -1926,7 +1926,7 @@ class ExampleIntegralProblems(PiCreatureScene, GraphScene): FadeOut(self.v_dt_brace_group_copy), ) self.change_mode("thinking") - self.dither() + self.wait() for thinner_rects in thinner_rects_list: self.play( Transform( @@ -1935,7 +1935,7 @@ class ExampleIntegralProblems(PiCreatureScene, GraphScene): submobject_mode = "lagged_start" ) ) - self.dither() + self.wait() def show_confusion(self): randy = Randolph(color = BLUE_C) @@ -1952,7 +1952,7 @@ class ExampleIntegralProblems(PiCreatureScene, GraphScene): self.pi_creature.look_at, randy.eyes ) self.play(Blink(randy)) - self.dither() + self.wait() class MathematicianPonderingAreaUnderDifferentCurves(PiCreatureScene): def construct(self): @@ -1960,17 +1960,17 @@ class MathematicianPonderingAreaUnderDifferentCurves(PiCreatureScene): self.pi_creature.change_mode, "raise_left_hand", self.pi_creature.look, UP+LEFT ) - self.dither(4) + self.wait(4) self.play( self.pi_creature.change_mode, "raise_right_hand", self.pi_creature.look, UP+RIGHT ) - self.dither(4) + self.wait(4) self.play( self.pi_creature.change_mode, "pondering", self.pi_creature.look, UP+LEFT ) - self.dither(2) + self.wait(2) def create_pi_creature(self): self.pi_creature = Randolph(color = BLUE_C) @@ -2010,7 +2010,7 @@ class AreaUnderParabola(GraphScene): self.play(ShowCreation(graph)) self.play(Write(graph_label)) - self.dither() + self.wait() self.graph = graph self.graph_label = graph_label @@ -2039,7 +2039,7 @@ class AreaUnderParabola(GraphScene): ), *map(Animation, foreground_mobjects) ) - self.dither() + self.wait() for new_rects in rect_lists[1:]: self.play( Transform( @@ -2048,7 +2048,7 @@ class AreaUnderParabola(GraphScene): ), *map(Animation, foreground_mobjects) ) - self.dither() + self.wait() self.rects = rects self.dx = dx_list[-1] @@ -2073,9 +2073,9 @@ class AreaUnderParabola(GraphScene): Write(question), ShowCreation(arrow) ) - self.dither() + self.wait() self.play(ShowCreation(v_lines, run_time = 2)) - self.dither() + self.wait() self.foreground_mobjects += [question, arrow] self.question = question @@ -2094,7 +2094,7 @@ class AreaUnderParabola(GraphScene): self.play(morty.look_at, self.rects.get_bottom()) self.play(Blink(morty)) self.play(morty.look_at, self.question) - self.dither() + self.wait() self.play(Blink(morty)) self.play(FadeOut(morty)) @@ -2120,11 +2120,11 @@ class AreaUnderParabola(GraphScene): self.foreground_mobjects.remove(self.axes) self.play(DrawBorderThenFill(self.right_point_slider)) self.move_right_point_to(2) - self.dither() + self.wait() self.move_right_point_to(self.default_right_x) - self.dither() + self.wait() self.play(ReplacementTransform(self.question, A_func)) - self.dither() + self.wait() self.A_func = A_func @@ -2139,7 +2139,7 @@ class AreaUnderParabola(GraphScene): Write(words), GrowFromCenter(brace) ) - self.dither() + self.wait() for x in 4, 2, self.default_right_x: self.move_right_point_to(x, run_time = 2) @@ -2186,7 +2186,7 @@ class WhoCaresAboutArea(TeacherStudentsScene): "Who cares!?!", target_mode = "angry", ) self.play(self.teacher.change_mode, "guilty") - self.dither() + self.wait() self.play( RemovePiCreatureBubble(self.students[1]), self.teacher.change_mode, "raise_right_hand", @@ -2198,7 +2198,7 @@ class WhoCaresAboutArea(TeacherStudentsScene): added_anims = [self.teacher.look_at, point] ) - self.dither(3) + self.wait(3) class PlayWithThisIdea(TeacherStudentsScene): def construct(self): @@ -2207,12 +2207,12 @@ class PlayWithThisIdea(TeacherStudentsScene): target_mode = "hooray" ) self.change_student_modes(*["happy"]*3) - self.dither() + self.wait() equation = TexMobject("A(x)", "\\leftrightarrow", "x^2") equation.highlight_by_tex("x^2", BLUE) self.teacher_says(equation, target_mode = "sassy") self.change_student_modes(*["thinking"]*3) - self.dither(2) + self.wait(2) class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): CONFIG = { @@ -2299,26 +2299,26 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): FadeIn(dx_group) ) self.play(Indicate(dx_label)) - self.dither() + self.wait() self.play(ShowCreation(dA_arrow)) - self.dither() + self.wait() self.play(Write(dA_label, run_time = 2)) - self.dither() + self.wait() self.play( ReplacementTransform(dA_label[0].copy(), difference_in_area[0]), ReplacementTransform(dA_label[1].copy(), difference_in_area[2]), *map(FadeIn, [difference_in_area[1], difference_in_area[3]]) ) - self.dither(2) + self.wait(2) self.play(FadeIn(dA_rect), Animation(dA_arrow)) self.play(GrowFromCenter(side_brace)) self.play( graph_label_copy.highlight, WHITE, graph_label_copy.next_to, side_brace, LEFT, SMALL_BUFF ) - self.dither() + self.wait() self.play(Indicate(dx_group)) - self.dither() + self.wait() self.play(FadeOut(difference_in_area)) self.dx_group = dx_group @@ -2360,13 +2360,13 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): for mob, tex in (x_squared, f_tex), (dx, "dx"), (dA, "dA") ]) self.play(Write(equation.get_part_by_tex("approx"))) - self.dither() + self.wait() for tex, mob in (f_tex, x_squared), ("dx", dx): self.play(*map(Indicate, [ equation.get_part_by_tex(tex), mob ])) - self.dither(2) + self.wait(2) self.play(*[ ReplacementTransform( equation.get_part_by_tex(tex), @@ -2377,9 +2377,9 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): ] + [ Write(deriv_equation.get_part_by_tex("over")) ]) - self.dither(2) + self.wait(2) self.shrink_dx(return_to_original_configuration = False) - self.dither() + self.wait() self.deriv_equation = deriv_equation @@ -2407,14 +2407,14 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): ) self.play(Write(q_marks, run_time = 2)) self.play(Blink(randy)) - self.dither() + self.wait() self.play( randy.change_mode, "surprised", randy.look_at, dA_circle, ReplacementTransform(A_circle, dA_circle) ) self.play(Blink(randy)) - self.dither() + self.wait() self.play(*map(FadeOut, [randy, q_marks, dA_circle])) def write_example_inputs(self): @@ -2446,7 +2446,7 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): ShowCreation(line_copy) ) self.play(FadeOut(line_copy)) - self.dither() + self.wait() self.three = three self.three_plus_dx = three_plus_dx @@ -2474,7 +2474,7 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): expression.get_part_by_tex(")"), )), ) - self.dither() + self.wait() self.play( ReplacementTransform( self.three.get_part_by_tex("%d"%d).copy(), @@ -2485,7 +2485,7 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): expression.get_parts_by_tex(")")[1], )), ) - self.dither(2) + self.wait(2) self.play( Write(expression.get_part_by_tex("over")), ReplacementTransform( @@ -2494,7 +2494,7 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): ) ) - self.dither() + self.wait() self.play( Write(expression.get_part_by_tex("approx")), ReplacementTransform( @@ -2503,7 +2503,7 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene): run_time = 2 ) ) - self.dither() + self.wait() def show_smaller_x(self): self.transition_to_alt_config( @@ -2558,7 +2558,7 @@ class AlternateAreaUnderCurve(PlayingTowardsDADX): ShowCreation(arrow), FadeIn(dx_to_zero_words), ) - self.dither() + self.wait() self.transition_to_alt_config( deriv_dx = self.deriv_dx/4.0, transformation_kwargs = {"run_time" : 2} @@ -2597,12 +2597,12 @@ class AlternateAreaUnderCurve(PlayingTowardsDADX): dx_to_zero = self.dx_to_zero_words[1] self.play(*map(FadeIn, [box, brace])) - self.dither() + self.wait() self.play( FadeOut(faders), dx_to_zero.next_to, box, DOWN ) - self.dither() + self.wait() ######## @@ -2629,9 +2629,9 @@ class NextVideoWrapper(Scene): self.add(titles[0]) self.play(ShowCreation(rect)) - self.dither(3) + self.wait(3) self.play(Transform(*titles)) - self.dither(3) + self.wait(3) class ProblemSolvingTool(TeacherStudentsScene): def construct(self): @@ -2639,7 +2639,7 @@ class ProblemSolvingTool(TeacherStudentsScene): The derivative is a problem-solving tool """) - self.dither(3) + self.wait(3) class FundamentalTheorem(Scene): def construct(self): @@ -2655,11 +2655,11 @@ class FundamentalTheorem(Scene): deriv.next_to(arrow, RIGHT) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.play(Write(deriv)) - self.dither() + self.wait() self.play(Write(words)) - self.dither() + self.wait() class NextVideos(TeacherStudentsScene): def construct(self): @@ -2672,7 +2672,7 @@ class NextVideos(TeacherStudentsScene): self.teacher_says( "That's a high-level view" ) - self.dither() + self.wait() self.play( RemovePiCreatureBubble( self.teacher, @@ -2698,7 +2698,7 @@ class NextVideos(TeacherStudentsScene): ) for video, alpha in zip(series, np.linspace(0, 0.7, len(series))) ]) - self.dither() + self.wait() student = self.get_students()[1] self.remove(student) @@ -2723,9 +2723,9 @@ class NextVideos(TeacherStudentsScene): student.change_mode, "confused", student.look_at, words ) - self.dither(3) + self.wait(3) self.play(student.change_mode, "thinking") - self.dither(4) + self.wait(4) class Chapter1PatreonThanks(PatreonThanks): CONFIG = { @@ -2766,7 +2766,7 @@ class EndScreen(PiCreatureScene): ), self.pi_creature.change_mode, "hooray" ) - self.dither() + self.wait() mode_point_pairs = [ ("raise_left_hand", 5*LEFT+3*UP), ("raise_right_hand", 5*RIGHT+3*UP), @@ -2778,8 +2778,8 @@ class EndScreen(PiCreatureScene): ] for mode, point in mode_point_pairs: self.play(self.pi_creature.change, mode, point) - self.dither() - self.dither(3) + self.wait() + self.wait(3) def create_pi_creature(self): diff --git a/old_projects/eoc/chapter10.py b/old_projects/eoc/chapter10.py index 698ac535..eaa12d79 100644 --- a/old_projects/eoc/chapter10.py +++ b/old_projects/eoc/chapter10.py @@ -148,8 +148,8 @@ class ExampleApproximation(GraphScene): Animation(near_text), term.set_fill, None, 1, ) - self.dither() - self.dither(2) + self.wait() + self.wait(2) class ExampleApproximationWithSine(ExampleApproximation): CONFIG = { @@ -235,7 +235,7 @@ class Pendulum(ReconfigurableScene): ) for m in 2, -2, 2: self.play(Rotate(self.pendulum, m*self.angle, **kwargs)) - self.dither() + self.wait() def show_height(self): v_line = self.get_v_line() @@ -265,7 +265,7 @@ class Pendulum(ReconfigurableScene): self.play( GrowFromCenter(radius_brace) ) - self.dither(2) + self.wait(2) self.play( Write(to_write), ReplacementTransform( @@ -278,7 +278,7 @@ class Pendulum(ReconfigurableScene): ), run_time = 2 ) - self.dither(2) + self.wait(2) self.arc = arc self.theta = theta @@ -309,9 +309,9 @@ class Pendulum(ReconfigurableScene): MoveToTarget(cosine), morty.change, "angry", cosine.target, ) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() self.morty = morty @@ -337,7 +337,7 @@ class Pendulum(ReconfigurableScene): MoveToTarget(cosine), morty.change, "pondering", cosine_approx ) - self.dither() + self.wait() if not self.perform_substitution: return self.play( @@ -366,10 +366,10 @@ class Pendulum(ReconfigurableScene): randy.change, "confused", self.cosine ) self.play(randy.look_at, self.height_tex_R) - self.dither() + self.wait() self.play(randy.look_at, self.cosine) self.play(Blink(randy)) - self.dither() + self.wait() ####### @@ -548,9 +548,9 @@ class ExampleApproximationWithCos(ExampleApproximationWithSine): look_at_arg = self.graph_origin, target_mode = "confused" )) - self.dither(2) + self.wait(2) self.play(Blink(randy)) - self.dither() + self.wait() def setup_axes(self): GraphScene.setup_axes(self) @@ -668,7 +668,7 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): self.change_quadratic_graph( self.quadratic_graph, *alt_consts ) - self.dither() + self.wait() self.quadratic_tex = quadratic_tex self.free_to_change_group = VGroup(free_to_change, *arrows) @@ -698,7 +698,7 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): Write(x_equals_0, run_time = 2) ) self.play(one.restore) - self.dither() + self.wait() self.v_line = v_line self.equals_one_group = VGroup(arrow, x_equals_0, one) @@ -733,15 +733,15 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): self.quadratic_tex.copy(), poly_at_zero )) - self.dither(2) + self.wait(2) self.play(FadeIn(equals_c0)) - self.dither(2) + self.wait(2) self.play(Transform( poly_group, poly_group_target, run_time = 2, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [poly_at_zero, equals_c0])) self.free_to_change_group.remove( @@ -762,7 +762,7 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): self.quadratic_graph, *alt_consts ) - self.dither() + self.wait() def show_tangent_slope(self): graph_point_at_zero = self.input_to_graph_point( @@ -774,15 +774,15 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): self.change_quadratic_graph( self.quadratic_graph, 1, 0, -0.1 ) - self.dither() + self.wait() self.change_quadratic_graph( self.quadratic_graph, 1, 1, -0.1 ) - self.dither(2) + self.wait(2) self.change_quadratic_graph( self.quadratic_graph, 1, 0, -0.1 ) - self.dither(2) + self.wait(2) self.tangent_line = tangent_line @@ -795,16 +795,16 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): run_time = 2, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) self.play(Write(VGroup(*rhs[2:])), run_time = 2) - self.dither() + self.wait() self.play(Rotate( self.tangent_line, np.pi/12, in_place = True, run_time = 3, rate_func = wiggle )) - self.dither() + self.wait() def compute_polynomial_derivative(self): derivative = self.get_quadratic_derivative("c_1", "c_2") @@ -839,21 +839,21 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): run_time = 3, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play(Transform( derivative, derivative_at_zero, run_time = 2, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) self.play(Write(equals_c1)) - self.dither(2) + self.wait(2) self.play(Transform( poly_group, poly_group_target, run_time = 3, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, poly_group[:-1])) self.free_to_change_group.remove( @@ -868,7 +868,7 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): self.quadratic_graph, 1, 0, alt_c2 ) - self.dither() + self.wait() def point_out_negative_concavity(self): partial_cosine_graph = self.get_graph( @@ -879,13 +879,13 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): ) self.play(ShowCreation(partial_cosine_graph, run_time = 2)) - self.dither() + self.wait() for x, run_time in (-1, 2), (1, 4): self.play(self.get_tangent_line_change_anim( self.tangent_line, x, self.cosine_graph, run_time = run_time )) - self.dither() + self.wait() self.play(*map(FadeOut, [ partial_cosine_graph, self.tangent_line ])) @@ -898,9 +898,9 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): run_time = 2, submobject_mode = "lagged_start" )) - self.dither(3) + self.wait(3) self.play(Write(VGroup(*rhs[1][2:]), run_time = 2)) - self.dither() + self.wait() def show_matching_curvature(self): alt_consts_list = [ @@ -913,7 +913,7 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): self.quadratic_graph, *alt_consts ) - self.dither() + self.wait() def show_matching_tangent_lines(self): graphs = [self.quadratic_graph, self.cosine_graph] @@ -972,15 +972,15 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): self.play(FadeOut(self.free_to_change_group)) self.play(FadeIn(derivs[0])) - self.dither(2) + self.wait(2) self.play(Write(second_derivs[0])) - self.dither(2) + self.wait(2) self.play(Transform( poly_group, poly_group_target, run_time = 3, submobject_mode = "lagged_start" )) - self.dither(3) + self.wait(3) def box_final_answer(self): box = Rectangle(stroke_color = PINK) @@ -993,7 +993,7 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos): box.move_to(self.quadratic_tex) self.play(ShowCreation(box, run_time = 2)) - self.dither(2) + self.wait(2) ###### @@ -1152,19 +1152,19 @@ class ReflectOnQuadraticApproximation(TeacherStudentsScene): Write(approx_at_x, run_time = 2), self.teacher.change_mode, "raise_right_hand" ) - self.dither(2) + self.wait(2) self.play(ReplacementTransform( approx_at_x, approx_at_point, )) - self.dither() + self.wait() self.play(Write(approx_rhs)) - self.dither(2) + self.wait(2) self.play( real_result.shift, 1.5*DOWN, real_result.set_fill, None, 1, ) self.change_student_modes(*["hooray"]*3) - self.dither(2) + self.wait(2) self.change_student_modes( *["plain"]*3, added_anims = map(FadeOut, [ @@ -1181,7 +1181,7 @@ class ReflectOnQuadraticApproximation(TeacherStudentsScene): Write(polynomial), self.teacher.change, "pondering" ) - self.dither(2) + self.wait(2) self.play(*[ ApplyMethod( const.shift, MED_LARGE_BUFF*UP, @@ -1190,7 +1190,7 @@ class ReflectOnQuadraticApproximation(TeacherStudentsScene): ) for const, a in zip(const_terms, np.linspace(0, 0.3, len(const_terms))) ]) - self.dither() + self.wait() self.const_terms = const_terms self.polynomial = polynomial @@ -1204,7 +1204,7 @@ class ReflectOnQuadraticApproximation(TeacherStudentsScene): self.play(c0.shift, UP) self.play(Write(equation)) - self.dither() + self.wait() self.play(Transform(self.polynomial, new_polynomial)) self.play(FadeOut(equation)) @@ -1219,9 +1219,9 @@ class ReflectOnQuadraticApproximation(TeacherStudentsScene): self.play(c1.shift, UP) self.play(Write(equation)) - self.dither() + self.wait() self.play(Transform(self.polynomial, new_polynomial)) - self.dither() + self.wait() self.play(FadeOut(equation)) def show_c2(self): @@ -1239,9 +1239,9 @@ class ReflectOnQuadraticApproximation(TeacherStudentsScene): self.play(c2.shift, UP) self.play(FadeIn(equation)) - self.dither(2) + self.wait(2) self.play(Transform(self.polynomial, new_polynomial)) - self.dither(2) + self.wait(2) self.play(FadeOut(equation)) ##### @@ -1265,25 +1265,25 @@ class ReflectionOnQuadraticSupplement(ConstructQuadraticApproximation): quadratic_graph = self.get_quadratic_graph() self.add(quadratic_graph) - self.dither() + self.wait() for c0 in 0, 2, 1: self.change_quadratic_graph( quadratic_graph, c0 = c0 ) - self.dither(2) + self.wait(2) for c1 in 1, -1, 0: self.change_quadratic_graph( quadratic_graph, c1 = c1 ) - self.dither(2) + self.wait(2) for c2 in -0.1, -1, -0.5: self.change_quadratic_graph( quadratic_graph, c2 = c2 ) - self.dither(2) + self.wait(2) class SimilarityOfChangeBehavior(ConstructQuadraticApproximation): def construct(self): @@ -1329,7 +1329,7 @@ class SimilarityOfChangeBehavior(ConstructQuadraticApproximation): ) self.play(*tangent_line_movements + dot_anims, run_time = 6) self.play(*map(FadeOut, [tangent_lines, dots])) - self.dither() + self.wait() class MoreTerms(TeacherStudentsScene): def construct(self): @@ -1338,7 +1338,7 @@ class MoreTerms(TeacherStudentsScene): target_mode = "surprised", ) self.change_student_modes(*["hooray"]*3) - self.dither(3) + self.wait(3) class CubicAndQuarticApproximations(ConstructQuadraticApproximation): CONFIG = { @@ -1410,7 +1410,7 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): MoveToTarget(polynomial), GrowFromCenter(plus_cubic_term) ) - self.dither() + self.wait() brace = Brace(polynomial.quadratic_part, DOWN) third_derivative = TexMobject( @@ -1427,7 +1427,7 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): polynomial.quadratic_part.copy(), VGroup(third_derivative[1]) )) - self.dither(2) + self.wait(2) self.play(plus_cubic_copy.next_to, third_derivative, RIGHT) derivative_term = self.take_derivatives_of_monomial( VGroup(*plus_cubic_copy[1:]) @@ -1451,13 +1451,13 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): self.cosine_second_derivative.copy(), cosine_third_derivative )) - self.dither(2) + self.wait(2) dot.set_fill(opacity = 0.5) self.play( dot.move_to, self.polynomial_third_derivative.get_right(), dot.set_fill, None, 0, ) - self.dither() + self.wait() def set_c3_to_zero(self): c3s = VGroup( @@ -1477,7 +1477,7 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): run_time = 2, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) def show_cubic_curves(self): real_graph = self.quadratic_graph @@ -1496,7 +1496,7 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): real_graph.set_stroke(width = 0) for alt_graph in alt_graphs: self.play(Transform(graph, alt_graph, run_time = 2)) - self.dither() + self.wait() self.play(graph.restore, run_time = 2) real_graph.restore() self.play(FadeOut(graph)) @@ -1513,7 +1513,7 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): self.polynomial_third_derivative_brace, ])) self.play(Write(plus_quartic_term)) - self.dither() + self.wait() self.plus_quartic_term = plus_quartic_term @@ -1525,7 +1525,7 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): self.cosine_third_derivative.copy(), cosine_fourth_derivative )) - self.dither(3) + self.wait(3) def take_fourth_derivative_of_quartic(self): quartic_term = VGroup(*self.plus_quartic_term.copy()[1:]) @@ -1547,11 +1547,11 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): self.play( quartic_term.next_to, fourth_deriv_lhs, RIGHT ) - self.dither() + self.wait() fourth_deriv_rhs = self.take_derivatives_of_monomial(quartic_term) - self.dither() + self.wait() self.play(Write(alt_rhs)) - self.dither() + self.wait() self.fourth_deriv_lhs = fourth_deriv_lhs self.fourth_deriv_rhs = fourth_deriv_rhs @@ -1582,7 +1582,7 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): ), MoveToTarget(x_to_4, run_time = 2) ) - self.dither(3) + self.wait(3) def show_quartic_approximation(self): real_graph = self.quadratic_graph @@ -1613,7 +1613,7 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): ), Animation(tex_mobs) ) - self.dither(3) + self.wait(3) #### @@ -1663,7 +1663,7 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation): self.remove(exponent_copy) self.add(front_num) curr_term = VGroup(front_num, *curr_term) - self.dither() + self.wait() self.play(FadeOut(curr_term[-1])) return VGroup(*curr_term[:-1]) @@ -1731,7 +1731,7 @@ class NoticeAFewThings(TeacherStudentsScene): "Notice a few things", target_mode = "hesitant" ) - self.dither(3) + self.wait(3) class FactorialTerms(CubicAndQuarticApproximations): def construct(self): @@ -1759,7 +1759,7 @@ class FactorialTerms(CubicAndQuarticApproximations): term.highlight_by_tex("c_8", YELLOW) self.add(term) - self.dither() + self.wait() result = self.take_derivatives_of_monomial(term, *added_anims) factorial_term = VGroup(*result[:-1]) @@ -1785,7 +1785,7 @@ class FactorialTerms(CubicAndQuarticApproximations): ), Write(words), ) - self.dither(2) + self.wait(2) class HigherTermsDontMessUpLowerTerms(Scene): CONFIG = { @@ -1829,14 +1829,14 @@ class HigherTermsDontMessUpLowerTerms(Scene): no_affect_words.shift(MED_SMALL_BUFF*(UP+LEFT)) self.add(*polynomial[:-2]) - self.dither() + self.wait() self.play(Write(VGroup(*polynomial[-2:]))) self.play( Write(no_affect_words), ShowCreation(arrows), run_time = 3 ) - self.dither(2) + self.wait(2) self.polynomial = polynomial self.c0_tex = c0_tex @@ -1866,11 +1866,11 @@ class HigherTermsDontMessUpLowerTerms(Scene): second_deriv.set_fill(opacity = 0) self.play(second_deriv.restore) - self.dither() + self.wait() self.play(GrowFromCenter(brace)) - self.dither() + self.wait() self.play(Write(equals_zero)) - self.dither(3) + self.wait(3) class EachTermControlsOneDerivative(Scene): def construct(self): @@ -1917,7 +1917,7 @@ class EachTermControlsOneDerivative(Scene): ShowCreation(deriv.arrow), FadeIn(deriv) ) - self.dither() + self.wait() class ApproximateNearNewPoint(CubicAndQuarticApproximations): CONFIG = { @@ -1963,7 +1963,7 @@ class ApproximateNearNewPoint(CubicAndQuarticApproximations): ShowCreation(v_line), Animation(pi) ) - self.dither() + self.wait() def change_approximation_center(self, graph, dot, target, **kwargs): start = self.x_axis.point_to_number(dot.get_center()) @@ -1995,13 +1995,13 @@ class ApproximateNearNewPoint(CubicAndQuarticApproximations): run_time = 4, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) self.play(FadeIn(randy)) self.play(randy.change, "confused", poly_around_pi) self.play(Blink(randy)) - self.dither(2) + self.wait(2) self.play(randy.change_mode, "happy") - self.dither(2) + self.wait(2) ### @@ -2035,7 +2035,7 @@ class OnAPhilosophicalLevel(TeacherStudentsScene): "And on a \\\\ philosophical level", run_time = 1 ) - self.dither(3) + self.wait(3) class TranslationOfInformation(CubicAndQuarticApproximations): def construct(self): @@ -2092,7 +2092,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): self.play(Write(deriv_info, run_time = 2)) self.play(dot.restore) self.play(ShowCreation(center_v_line)) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.play(Write(output_info, run_time = 2)) @@ -2114,7 +2114,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): )), run_time = 2 )) - self.dither() + self.wait() self.play(*map(FadeOut, [ deriv_info, arrow, output_info, outer_v_lines ])) @@ -2170,7 +2170,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): ]) self.play(FadeIn(derivs_at_x[0])) - self.dither() + self.wait() for start_d, arrow, target_d in zip(group[::2], group[1::2], group[2::2]): self.play( ReplacementTransform( @@ -2178,17 +2178,17 @@ class TranslationOfInformation(CubicAndQuarticApproximations): ), ShowCreation(arrow) ) - self.dither() - self.dither() + self.wait() + self.wait() self.play(ReplacementTransform( derivs_at_x, derivs_at_zero )) - self.dither() + self.wait() self.play(*map(Write, rhs_group)) - self.dither() + self.wait() for rhs in rhs_group: self.play(Indicate(rhs[1]), color = WHITE) - self.dither() + self.wait() self.play(*[ ReplacementTransform( zero.copy(), self.dot, @@ -2197,7 +2197,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): ) for zero, a in zip(zeros, np.linspace(0, 0.6, len(zeros))) ]) - self.dither() + self.wait() self.cosine_derivative_group = VGroup( derivs_at_zero, arrows, group[-1], rhs_group @@ -2230,10 +2230,10 @@ class TranslationOfInformation(CubicAndQuarticApproximations): Animation(derivative_values) ) self.remove(derivative_values) - self.dither(2) + self.wait(2) to_fade = self.take_derivatives_of_monomial(monomial) self.play(FadeOut(to_fade)) - self.dither() + self.wait() self.polynomial = polynomial @@ -2257,7 +2257,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): self.play(GrowFromCenter(brace)) self.play(Write(name)) - self.dither() + self.wait() self.play( Transform( self.quadratic_graph, quartic_graph, @@ -2265,7 +2265,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): ), Animation(self.dot) ) - self.dither(2) + self.wait(2) self.taylor_name_group = VGroup(brace, name) @@ -2321,13 +2321,13 @@ class TranslationOfInformation(CubicAndQuarticApproximations): da.replace(dx) self.play(FadeIn(derivs_at_x[0])) - self.dither() + self.wait() for start, target in zip(derivs_at_x, derivs_at_x[1:]): self.play(ReplacementTransform( start.copy(), target )) - self.dither() - self.dither() + self.wait() + self.wait() self.play(ReplacementTransform( derivs_at_x, derivs_at_zero, )) @@ -2337,7 +2337,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): submobject_mode = "lagged_start" )) self.play(ShowCreation(self.v_line)) - self.dither() + self.wait() self.derivs_at_zero = derivs_at_zero self.derivs_at_a = derivs_at_a @@ -2363,7 +2363,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): FadeOut(self.taylor_name_group), ) self.polynomial = new_polynomial - self.dither(3) + self.wait(3) def walk_through_terms(self): func = self.graph.underlying_function @@ -2395,7 +2395,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): self.play(GrowFromCenter(brace)) self.play(ShowCreation(approx_graph)) - self.dither() + self.wait() for new_brace, new_graph in zip(braces[1:], approx_graphs[1:]): self.play(Transform(brace, new_brace)) self.play( @@ -2403,7 +2403,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): Animation(self.polynomial), Animation(self.dot), ) - self.dither() + self.wait() self.play(FadeOut(brace)) self.approx_graph = approx_graph @@ -2453,7 +2453,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): Animation(self.polynomial), Animation(polynomial_third_term) ) - self.dither() + self.wait() self.play(Transform( self.derivs_at_zero, self.derivs_at_a @@ -2462,7 +2462,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): Transform(self.polynomial, new_polynomial), FadeOut(polynomial_third_term) ) - self.dither() + self.wait() for x in -1, np.pi/6: self.play( UpdateFromAlphaFunc( @@ -2471,7 +2471,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations): Animation(self.polynomial), run_time = 4, ) - self.dither() + self.wait() ##### @@ -2504,7 +2504,7 @@ class ThisIsAStandardFormula(TeacherStudentsScene): *["sad"]*3, look_at_arg = SPACE_HEIGHT*UP ) - self.dither(2) + self.wait(2) class ExpPolynomial(TranslationOfInformation, ExampleApproximationWithExp): CONFIG = { @@ -2532,7 +2532,7 @@ class ExpPolynomial(TranslationOfInformation, ExampleApproximationWithExp): ), run_time = 2 ) - self.dither() + self.wait() self.graph = graph self.e_to_x = e_to_x @@ -2594,12 +2594,12 @@ class ExpPolynomial(TranslationOfInformation, ExampleApproximationWithExp): ), Write(arrow, run_time = 1) ) - self.dither() - self.dither() + self.wait() + self.wait() self.play(ReplacementTransform( derivs_at_x, derivs_at_zero )) - self.dither() + self.wait() self.play(*map(Write, rhs_group)) self.derivative_values = derivative_values @@ -2660,7 +2660,7 @@ class ShowSecondTerm(TeacherStudentsScene): "Now for \\\\ something fun!", target_mode = "hooray" ) - self.dither(2) + self.wait(2) self.play( RemovePiCreatureBubble( self.teacher, @@ -2673,7 +2673,7 @@ class ShowSecondTerm(TeacherStudentsScene): FadeIn(words), ) self.change_student_modes(*["pondering"]*3) - self.dither(3) + self.wait(3) class SecondTermIntuition(AreaIsDerivative): CONFIG = { @@ -2741,7 +2741,7 @@ class SecondTermIntuition(AreaIsDerivative): self.play(ApplyWave(self.v_graph, direction = UP)) self.play(Write(deriv, run_time = 2)) - self.dither() + self.wait() self.deriv_label = deriv @@ -2781,7 +2781,7 @@ class SecondTermIntuition(AreaIsDerivative): FadeIn(rect), FadeIn(height_brace) ) - self.dither() + self.wait() if not self.skip_reconfiguration: self.transition_to_alt_config( dx = self.dx/10.0, @@ -2843,12 +2843,12 @@ class SecondTermIntuition(AreaIsDerivative): Write(label), ShowCreation(arrow) ) - self.dither() - self.dither() + self.wait() + self.wait() self.play(ReplacementTransform( dx_label, x_minus_a )) - self.dither() + self.wait() self.x_minus_a = x_minus_a @@ -2891,14 +2891,14 @@ class SecondTermIntuition(AreaIsDerivative): ShowCreation(base_arrow), ShowCreation(base_line) ) - self.dither(2) + self.wait(2) self.play( GrowFromCenter(height_brace), Write(height_labels[0]) ) - self.dither(2) + self.wait(2) self.play(ReplacementTransform(*height_labels)) - self.dither(2) + self.wait(2) #Show area formula equals_half = TexMobject("=\\frac{1}{2}") @@ -2927,11 +2927,11 @@ class SecondTermIntuition(AreaIsDerivative): FadeOut(self.deriv_label), MoveToTarget(group, run_time = 2) ) - self.dither(2) + self.wait(2) self.play(Transform( group[-1], exp_2 )) - self.dither(2) + self.wait(2) def walk_through_taylor_terms(self): mini_area, mini_rect, mini_triangle = [ @@ -2977,25 +2977,25 @@ class SecondTermIntuition(AreaIsDerivative): run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play( FadeIn(VGroup(*analytic_taylor[:3])), self.dark_area.set_fill, BLUE_E, 1, Transform(self.func_name, new_func_name) ) - self.dither() + self.wait() self.play( self.rect.scale_in_place, 0.5, rate_func = there_and_back ) self.play(FadeIn(VGroup(*analytic_taylor[3:5]))) - self.dither(2) + self.wait(2) self.play( self.triangle.scale_in_place, 0.5, rate_func = there_and_back ) self.play(FadeIn(VGroup(*analytic_taylor[5:]))) - self.dither(3) + self.wait(3) class EachTermHasMeaning(TeacherStudentsScene): def construct(self): @@ -3009,7 +3009,7 @@ class EachTermHasMeaning(TeacherStudentsScene): *["thinking"]*3, look_at_arg = 4*UP ) - self.dither(3) + self.wait(3) class AskAboutInfiniteSum(TeacherStudentsScene): def construct(self): @@ -3045,7 +3045,7 @@ class AskAboutInfiniteSum(TeacherStudentsScene): "We could call \\\\ it an end here" ) self.change_student_modes(*["erm"]*3) - self.dither(3) + self.wait(3) self.play( RemovePiCreatureBubble(self.teacher), self.get_students()[0].change_mode, "plain", @@ -3064,7 +3064,7 @@ class AskAboutInfiniteSum(TeacherStudentsScene): ShowCreation(arrow), Write(words) ) - self.dither(3) + self.wait(3) self.arrow = arrow self.words = words @@ -3084,19 +3084,19 @@ class AskAboutInfiniteSum(TeacherStudentsScene): self.play(ReplacementTransform( self.words, series_def )) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(taylor_polynomial) ) - self.dither(2) + self.wait(2) self.play( series_def.scale, 0.7, series_def.to_corner, UP+RIGHT, FadeIn(taylor_series) ) self.play(self.randy.change, "thinking", taylor_series) - self.dither() + self.wait() def be_careful(self): self.play(FadeIn(self.teacher)) @@ -3109,9 +3109,9 @@ class AskAboutInfiniteSum(TeacherStudentsScene): }, added_anims = [self.randy.change, "hesitant"] ) - self.dither(2) + self.wait(2) self.play(self.randy.change, "confused", self.series) - self.dither(3) + self.wait(3) class ConvergenceExample(Scene): def construct(self): @@ -3139,12 +3139,12 @@ class ConvergenceExample(Scene): if i == 4: self.play(FadeIn(convergence_words)) else: - self.dither() + self.wait() self.play( FadeOut(brace), Write(rhs) ) - self.dither(2) + self.wait(2) def get_partial_sum_braces(self, series, partial_sums): braces = [ @@ -3180,16 +3180,16 @@ class ExpConvergenceExample(ConvergenceExample): lhs.target = new_lhs self.add(x_group) - self.dither() + self.wait() self.play(ReplacementTransform(x_group.copy(), one_group)) self.play(FadeIn(brace)) - self.dither() + self.wait() for new_brace in braces[2:]: self.play(Transform(brace, new_brace)) - self.dither() - self.dither() + self.wait() + self.wait() self.play(MoveToTarget(e_to_1)) - self.dither(2) + self.wait(2) def get_series(self, arg, n_terms = 5): series = TexMobject("1", "+", *list(it.chain(*[ @@ -3239,28 +3239,28 @@ class ExpGraphConvergence(ExpPolynomial, ExpConvergenceExample): approx_graph = approx_graphs[1] x = self.example_input self.add(graph, self.series) - self.dither() + self.wait() self.play(dot.move_to, self.coords_to_point(x, 0)) self.play( dot.move_to, self.input_to_graph_point(x, graph), ShowCreation(v_line) ) - self.dither() + self.wait() self.play( GrowFromCenter(brace), ShowCreation(approx_graph) ) - self.dither() + self.wait() for new_brace, new_graph in zip(self.braces[2:], approx_graphs[2:]): self.play( Transform(brace, new_brace), Transform(approx_graph, new_graph), Animation(self.series), ) - self.dither() + self.wait() self.play(FocusOn(equals)) self.play(Transform(self.arrow, equals)) - self.dither(2) + self.wait(2) def add_series(self): series_group = self.get_series("x") @@ -3354,14 +3354,14 @@ class BoundedRadiusOfConvergence(CubicAndQuarticApproximations): ShowCreation(approx_graph), Animation(dot) ) - self.dither() + self.wait() for new_graph in approx_graphs[2:]: self.play( Transform(approx_graph, new_graph), Animation(dot) ) - self.dither() - self.dither() + self.wait() + self.wait() class RadiusOfConvergenceForLnX(ExpGraphConvergence): CONFIG = { @@ -3421,7 +3421,7 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence): run_time = 3, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.series = series self.foreground_mobjects = [series] @@ -3447,7 +3447,7 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence): dot.move_to, self.coords_to_point(1, 0), dot.set_fill, YELLOW, 1, ) - self.dither() + self.wait() self.play( GrowFromCenter(center_v_line), Animation(dot) @@ -3487,7 +3487,7 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence): map(FadeIn, [approx_graph, brace]), map(Animation, self.foreground_mobjects) )) - self.dither() + self.wait() new_graphs = approx_graphs[1:self.initial_n_iterations] for new_graph, new_brace in zip(new_graphs, self.braces[1:]): self.play( @@ -3495,7 +3495,7 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence): Transform(brace, new_brace), *map(Animation, self.foreground_mobjects) ) - self.dither() + self.wait() approx_graph.remove(approx_dot) self.play( approx_dot.move_to, self.coords_to_point(self.divergent_example, 0), @@ -3504,7 +3504,7 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence): map(Animation, self.foreground_mobjects) ) ) - self.dither() + self.wait() self.approx_graphs = approx_graphs self.approx_dot = approx_dot @@ -3534,7 +3534,7 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence): Transform(brace, new_brace), *map(Animation, self.foreground_mobjects) ) - self.dither() + self.wait() self.approx_dot = approx_graph.dot self.approx_graph = approx_graph @@ -3554,14 +3554,14 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence): Write(word), ShowCreation(arrow) ) - self.dither() + self.wait() new_graphs = self.approx_graphs[self.initial_n_iterations:] for new_graph in new_graphs: self.play( Transform(self.approx_graph, new_graph), *map(Animation, self.foreground_mobjects) ) - self.dither() + self.wait() def write_radius_of_convergence(self): line = Line(*[ @@ -3577,9 +3577,9 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence): GrowFromCenter(brace), ShowCreation(line) ) - self.dither() + self.wait() self.play(Write(words)) - self.dither(3) + self.wait(3) class MoreToBeSaid(TeacherStudentsScene): CONFIG = { @@ -3607,12 +3607,12 @@ class MoreToBeSaid(TeacherStudentsScene): ) for word in words: self.play(FadeIn(word)) - self.dither() + self.wait() self.teacher_says( "About everything", ) self.change_student_modes(*["pondering"]*3) - self.dither() + self.wait() self.remove() self.pi_creatures = []##Hack self.play( @@ -3623,7 +3623,7 @@ class MoreToBeSaid(TeacherStudentsScene): ) self.pi_creatures = [randy] self.play(ShowCreation(rect)) - self.dither(4) + self.wait(4) class Chapter10Thanks(PatreonThanks): CONFIG = { diff --git a/old_projects/eoc/chapter2.py b/old_projects/eoc/chapter2.py index 84e999d9..0202b9e9 100644 --- a/old_projects/eoc/chapter2.py +++ b/old_projects/eoc/chapter2.py @@ -152,7 +152,7 @@ class IncrementTest(Scene): num = TexMobject("0") num.shift(UP) self.play(IncrementNumber(num)) - self.dither() + self.wait() @@ -198,7 +198,7 @@ class Introduction(TeacherStudentsScene): run_time = 2 ) self.play(self.get_teacher().change_mode, "happy") - self.dither() + self.wait() self.teacher_says( "It's actually a \\\\", "very subtle idea", @@ -211,7 +211,7 @@ class Introduction(TeacherStudentsScene): "Instantaneous rate of change", "?", student_index = 0, ) - self.dither() + self.wait() bubble = self.get_students()[0].bubble phrase = bubble.content[0] @@ -233,7 +233,7 @@ class Introduction(TeacherStudentsScene): ]) ]) ) - self.dither() + self.wait() change = VGroup(*phrase[-len("change"):]) instantaneous = VGroup(*phrase[:len("instantaneous")]) change_brace = Brace(change) @@ -318,7 +318,7 @@ class FathersOfCalculus(Scene): GrowFromCenter(rigor_brace), Write(rigor, run_time = 1) ) - self.dither() + self.wait() class IntroduceCar(Scene): CONFIG = { @@ -367,7 +367,7 @@ class IntroduceCar(Scene): GrowFromCenter(distance_brace), Write(distance) ) - self.dither() + self.wait() if self.should_transition_to_graph: self.play( @@ -396,7 +396,7 @@ class IntroduceCar(Scene): car_line_group.target.rotate(np.pi/2, about_point = point_A) car_line_group.target.shift(graph_scene.graph_origin - point_A) self.play(MoveToTarget(car_line_group, path_arc = np.pi/2)) - self.dither() + self.wait() def introduce_added_mobjects(self): pass @@ -473,7 +473,7 @@ class GraphCarTrajectory(GraphScene): UpdateFromFunc(v_line, v_update), run_time = self.time_of_journey, ) - self.dither() + self.wait() self.play(*map(FadeOut, [h_line, v_line, car])) #Show example vertical distance @@ -487,13 +487,13 @@ class GraphCarTrajectory(GraphScene): brace = Brace(dashed_h, RIGHT) brace_text = brace.get_text("Distance traveled") self.play(t_dot.restore) - self.dither() + self.wait() self.play(ShowCreation(dashed_h)) self.play( GrowFromCenter(brace), Write(brace_text) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [t_dot, dashed_h, brace, brace_text])) #Name graph @@ -509,10 +509,10 @@ class GraphCarTrajectory(GraphScene): d.highlight(DISTANCE_COLOR) self.play(Write(s_of_t)) - self.dither() + self.wait() s.save_state() self.play(Transform(s, d)) - self.dither() + self.wait() self.play(s.restore) def comment_on_slope(self, graph, origin): @@ -528,9 +528,9 @@ class GraphCarTrajectory(GraphScene): change_lines = self.get_change_lines(curr_time, delta_t) self.play(FadeIn(rect)) - self.dither() + self.wait() self.play(Write(change_lines)) - self.dither() + self.wait() for x in range(1, 10): curr_time = x new_change_lines = self.get_change_lines(curr_time, delta_t) @@ -543,10 +543,10 @@ class GraphCarTrajectory(GraphScene): "$\\frac{\\text{meters}}{\\text{second}}$" ) self.play(Write(text)) - self.dither() + self.wait() self.play(FadeOut(text)) else: - self.dither() + self.wait() self.play(*map(FadeOut, [rect, change_lines])) self.rect = rect @@ -579,10 +579,10 @@ class GraphCarTrajectory(GraphScene): return result label = get_velocity_label(velocity_graph) self.play(Write(label)) - self.dither() + self.wait() self.rect.move_to(self.coords_to_point(0, 0), DOWN+LEFT) self.play(FadeIn(self.rect)) - self.dither() + self.wait() for time, show_slope in (4.5, True), (9, False): self.play( self.rect.move_to, self.coords_to_point(time, 0), DOWN+LEFT @@ -590,10 +590,10 @@ class GraphCarTrajectory(GraphScene): if show_slope: change_lines = self.get_change_lines(time) self.play(FadeIn(change_lines)) - self.dither() + self.wait() self.play(FadeOut(change_lines)) else: - self.dither() + self.wait() self.play(FadeOut(self.rect)) #Change distance and velocity graphs @@ -630,13 +630,13 @@ class GraphCarTrajectory(GraphScene): Transform(velocity_graph, new_velocity_graph), Transform(label, new_velocity_label), ) - self.dither(2) + self.wait(2) self.play(self.s_graph.restore) self.play( velocity_graph.restore, label.restore, ) - self.dither(2) + self.wait(2) def ask_critically_about_velocity(self): morty = Mortimer().flip() @@ -646,7 +646,7 @@ class GraphCarTrajectory(GraphScene): "what velocity means." )) self.play(Blink(morty)) - self.dither() + self.wait() class ShowSpeedometer(IntroduceCar): CONFIG = { @@ -741,7 +741,7 @@ class VelocityInAMomentMakesNoSense(Scene): self.play(Blink(randy)) self.play(Write(q_marks)) self.play(Blink(randy)) - self.dither() + self.wait() class SnapshotOfACar(Scene): def construct(self): @@ -782,7 +782,7 @@ class SnapshotOfACar(Scene): ) question.next_to(car, UP, buff = LARGE_BUFF) self.play(Write(question, run_time = 2)) - self.dither(2) + self.wait(2) class CompareTwoTimes(Scene): CONFIG = { @@ -812,11 +812,11 @@ class CompareTwoTimes(Scene): dividers.highlight(GREY) self.add(dividers, state1) - self.dither() + self.wait() copied_state = state1.copy() self.play(copied_state.move_to, state2) self.play(Transform(copied_state, state2)) - self.dither(2) + self.wait(2) self.keeper = state1 def show_equation(self): @@ -858,7 +858,7 @@ class CompareTwoTimes(Scene): group, submobject_mode = "lagged_start", run_time = 3 )) - self.dither(3) + self.wait(3) self.formula = formula def fade_all_but_one_moment(self): @@ -868,7 +868,7 @@ class CompareTwoTimes(Scene): ] anims.append(Animation(self.keeper.copy())) self.play(*anims) - self.dither() + self.wait() def get_car_state(self, distance, time): line = Line(3*LEFT, 3*RIGHT) @@ -940,13 +940,13 @@ class VelocityAtIndividualPointsVsPairs(GraphCarTrajectory): ) self.play(ShowCreation(line)) - self.dither() + self.wait() self.play(UpdateFromAlphaFunc( line, line_update, run_time = 4, rate_func = there_and_back )) - self.dither() + self.wait() velocity_graph.add(line) def show_two_times_on_distance(self): @@ -972,7 +972,7 @@ class VelocityAtIndividualPointsVsPairs(GraphCarTrajectory): GrowFromCenter(brace), Write(text) ) - self.dither() + self.wait() def show_confused_pi_creature(self): randy = Randolph() @@ -981,12 +981,12 @@ class VelocityAtIndividualPointsVsPairs(GraphCarTrajectory): self.play(randy.change_mode, "confused") self.play(Blink(randy)) - self.dither(2) + self.wait(2) self.play(Blink(randy)) self.play(randy.change_mode, "erm") - self.dither() + self.wait() self.play(Blink(randy)) - self.dither(2) + self.wait(2) class FirstRealWorld(TeacherStudentsScene): def construct(self): @@ -994,7 +994,7 @@ class FirstRealWorld(TeacherStudentsScene): self.change_student_modes( "happy", "hooray", "happy" ) - self.dither(3) + self.wait(3) class SidestepParadox(Scene): def construct(self): @@ -1018,11 +1018,11 @@ class SidestepParadox(Scene): self.add(title, car) self.play(Write(speedometer)) - self.dither() + self.wait() self.play(Write(cross)) - self.dither() + self.wait() self.play(Write(new_words)) - self.dither() + self.wait() class CompareTwoVerySimilarTimes(CompareTwoTimes): CONFIG = { @@ -1056,7 +1056,7 @@ class CompareTwoVerySimilarTimes(CompareTwoTimes): Write(dt_text) ) formula.add(dt_brace, dt_text) - self.dither(2) + self.wait(2) formula.generate_target() VGroup( @@ -1067,7 +1067,7 @@ class CompareTwoVerySimilarTimes(CompareTwoTimes): GrowFromCenter(ds_brace), Write(ds_text) ) - self.dither(2) + self.wait(2) class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene): CONFIG = { @@ -1146,7 +1146,7 @@ class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene): GrowFromCenter(brace), Write(text) ) - self.dither() + self.wait() #Show as function frac = TexMobject("\\frac{ds}{dt}") @@ -1203,7 +1203,7 @@ class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene): self.play(Write(frac)) self.play(Write(rise_over_run)) - self.dither() + self.wait() def input_point_line_update(line, alpha): time = interpolate(self.start_time, self.end_time, alpha) line.put_start_and_end_on( @@ -1221,10 +1221,10 @@ class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene): run_time = 6, ) self.play(FadeOut(input_point_line)) - self.dither() + self.wait() self.play(FadeOut(rise_over_run)) self.play(Write(of_t)) - self.dither(2) + self.wait(2) self.play(ShowCreation(velocity_graph)) velocity_label = self.label_graph( velocity_graph, @@ -1233,9 +1233,9 @@ class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene): direction = DOWN+LEFT, buff = SMALL_BUFF ) - self.dither(2) + self.wait(2) self.play(Write(dt_choice)) - self.dither() + self.wait() for anim_class in FadeIn, FadeOut: self.play(anim_class( t_tick_marks, submobject_mode = "lagged_start", @@ -1245,18 +1245,18 @@ class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene): Write(equals), Write(numerator) ) - self.dither() + self.wait() self.play(ShowCreation(v_line_at_t)) - self.dither() + self.wait() self.play(ShowCreation(v_line_at_t_plus_dt)) - self.dither() + self.wait() self.play(*map(FadeOut, [v_line_at_t, v_line_at_t_plus_dt])) self.play( Write(frac_line), Write(lower_dt) ) - self.dither(2) + self.wait(2) #Show different curves self.disactivate_zooming() @@ -1292,7 +1292,7 @@ class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene): self.play(Transform(self.graph, new_graph)) self.play(Transform(velocity_graph, new_velocity_graph)) - self.dither(2) + self.wait(2) self.play(self.graph.restore) self.play( velocity_graph.restore, @@ -1306,12 +1306,12 @@ class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene): self.play(FadeIn(randy)) self.play(randy.change_mode, "pondering") - self.dither() + self.wait() self.play(Blink(randy)) self.play(randy.change_mode, "thinking") - self.dither() + self.wait() self.play(Blink(randy)) - self.dither() + self.wait() class DefineTrueDerivative(Scene): def construct(self): @@ -1335,17 +1335,17 @@ class DefineTrueDerivative(Scene): self.add(lhs, dt_rhs) self.play(Write(title)) - self.dither() + self.wait() dt_rhs.save_state() for num_rhs in numerical_rhs_list: self.play(Transform(dt_rhs, num_rhs)) - self.dither() + self.wait() self.play(dt_rhs.restore) self.play( GrowFromCenter(brace), Write(dt_to_zero) ) - self.dither() + self.wait() def get_fraction(self, dt_string): tex_mob = TexMobject( @@ -1494,13 +1494,13 @@ class SecantLineToTangentLine(GraphCarTrajectory, DefineTrueDerivative): ), run_time = 4 )) - self.dither() + self.wait() def show_tangent_line(self): self.curr_time = self.start_time ds_dt_group = self.get_ds_dt_group(2, animate = True) - self.dither() + self.wait() def update_ds_dt_group(ds_dt_group, alpha): new_dt = interpolate(self.start_dt, self.end_dt, alpha) new_group = self.get_ds_dt_group(new_dt) @@ -1509,7 +1509,7 @@ class SecantLineToTangentLine(GraphCarTrajectory, DefineTrueDerivative): UpdateFromAlphaFunc(ds_dt_group, update_ds_dt_group), run_time = 15 ) - self.dither() + self.wait() def update_as_tangent_line(ds_dt_group, alpha): self.curr_time = interpolate(self.start_time, self.end_time, alpha) new_group = self.get_ds_dt_group(self.end_dt) @@ -1519,15 +1519,15 @@ class SecantLineToTangentLine(GraphCarTrajectory, DefineTrueDerivative): run_time = 8, rate_func = there_and_back ) - self.dither() + self.wait() what_dt_is_not_text = self.what_this_is_not_saying() - self.dither() + self.wait() self.play( UpdateFromAlphaFunc(ds_dt_group, update_ds_dt_group), run_time = 8, rate_func = lambda t : 1-there_and_back(t) ) - self.dither() + self.wait() self.play(FadeOut(what_dt_is_not_text)) v_line = self.get_vertical_line_to_graph( @@ -1546,7 +1546,7 @@ class SecantLineToTangentLine(GraphCarTrajectory, DefineTrueDerivative): ) return v_line self.play(ShowCreation(v_line)) - self.dither() + self.wait() original_end_time = self.end_time for end_time in self.alt_end_time, original_end_time, self.start_time: @@ -1590,7 +1590,7 @@ class SecantLineToTangentLine(GraphCarTrajectory, DefineTrueDerivative): self.play(Write(words)) self.play(ShowCreation(circle)) - self.dither() + self.wait() class UseOfDImpliesApproaching(TeacherStudentsScene): def construct(self): @@ -1602,7 +1602,7 @@ class UseOfDImpliesApproaching(TeacherStudentsScene): VGroup(*statement[-4:-2]).highlight(TIME_COLOR) self.teacher_says(statement) self.change_student_modes(*["pondering"]*3) - self.dither(4) + self.wait(4) class LeadIntoASpecificExample(TeacherStudentsScene, SecantLineToTangentLine): def setup(self): @@ -1615,7 +1615,7 @@ class LeadIntoASpecificExample(TeacherStudentsScene, SecantLineToTangentLine): self.remove(deriv_def) self.teacher_says("An example \\\\ should help.") - self.dither() + self.wait() self.play( Write(deriv_def), *it.chain(*[ @@ -1634,7 +1634,7 @@ class LeadIntoASpecificExample(TeacherStudentsScene, SecantLineToTangentLine): # height = 3, # target_mode = "hooray" # ) - # self.dither(2) + # self.wait(2) class TCubedExample(SecantLineToTangentLine): CONFIG = { @@ -1674,7 +1674,7 @@ class TCubedExample(SecantLineToTangentLine): direction = LEFT, buff = SMALL_BUFF ) - self.dither() + self.wait() def show_vertical_lines(self): for t in 1, 2: @@ -1695,7 +1695,7 @@ class TCubedExample(SecantLineToTangentLine): last_group = group else: self.play(Transform(last_group, group)) - self.dither() + self.wait() self.play(FadeOut(last_group)) def bear_with_me(self): @@ -1708,7 +1708,7 @@ class TCubedExample(SecantLineToTangentLine): target_mode = "sassy" )) self.play(Blink(morty)) - self.dither() + self.wait() self.play(*map( FadeOut, [morty, morty.bubble, morty.bubble.content] @@ -1760,23 +1760,23 @@ class TCubedExample(SecantLineToTangentLine): *[mob.restore for mob in ds, dt] ) self.play(ShowCreation(v_lines[0])) - self.dither() + self.wait() self.play( ShowCreation(arrow), Write(nonzero_size), ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [arrow, nonzero_size])) self.play(Write(numerator)) self.play(ShowCreation(v_lines[1])) - self.dither() + self.wait() self.play( v_lines[0].highlight, YELLOW, rate_func = there_and_back ) - self.dither() + self.wait() self.play(Write(non_numerator)) - self.dither(2) + self.wait(2) self.play( *map(MoveToTarget, s_pair), **{ @@ -1784,7 +1784,7 @@ class TCubedExample(SecantLineToTangentLine): } ) self.play(numerator_non_minus.shift, 0.2*LEFT) - self.dither() + self.wait() self.vertical_lines = v_lines self.ds_dt_group = ds_dt_group @@ -1814,14 +1814,14 @@ class TCubedExample(SecantLineToTangentLine): morty.look_at, self.rhs ) self.play(Blink(morty)) - self.dither() + self.wait() self.play( morty.change_mode, "sassy", morty.look, OUT ) self.play(Blink(morty)) self.play(morty.change_mode, "pondering") - self.dither() + self.wait() self.play(FadeOut(morty)) def show_expansion(self): @@ -1871,7 +1871,7 @@ class TCubedExample(SecantLineToTangentLine): for term in terms: self.play(FadeIn(term)) - self.dither() + self.wait() #Cancel out two_cubed terms self.play(*it.chain(*[ @@ -1890,7 +1890,7 @@ class TCubedExample(SecantLineToTangentLine): numerator.scale, 1.4, numerator.get_bottom(), terms[-1].scale, 1.4, terms[-1].get_top() ) - self.dither(2) + self.wait(2) #Cancel out dt #This is all way too hacky... @@ -1906,7 +1906,7 @@ class TCubedExample(SecantLineToTangentLine): FadeIn(new_exp), run_time = 2, ) - self.dither() + self.wait() terms[3].add(new_exp) shift_val = 0.4*DOWN self.play( @@ -1927,12 +1927,12 @@ class TCubedExample(SecantLineToTangentLine): VGroup(*brace_text[-2:]).highlight(TIME_COLOR) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(brace_text) ) - self.dither(2) + self.wait(2) #Shink dt faders = VGroup(*terms[2:4] + [brace, brace_text]) @@ -1951,7 +1951,7 @@ class TCubedExample(SecantLineToTangentLine): faders.fade, 0.7, run_time = 5 ) - self.dither(2) + self.wait(2) #Show as derivative deriv_term = VGroup(*terms[1][:5]) @@ -1982,8 +1982,8 @@ class TCubedExample(SecantLineToTangentLine): ShowCreation(arrow), Write(approach_text) ) - self.dither(2) - self.dither() + self.wait(2) + self.wait() #Ephasize slope v_line = self.vertical_lines[0] @@ -1996,7 +1996,7 @@ class TCubedExample(SecantLineToTangentLine): rate_func = wiggle ) self.play(ShowCreation(v_line)) - self.dither() + self.wait() self.play(FadeOut(v_line)) self.play(FadeOut(slope_text)) @@ -2021,7 +2021,7 @@ class TCubedExample(SecantLineToTangentLine): run_time = 5, rate_func = there_and_back ) - self.dither(2) + self.wait(2) self.lhs_copy = lhs_copy self.deriv_term = deriv_term @@ -2054,9 +2054,9 @@ class TCubedExample(SecantLineToTangentLine): ), morty.look_at, mob ) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() class YouWouldntDoThisEveryTime(TeacherStudentsScene): def construct(self): @@ -2068,11 +2068,11 @@ class YouWouldntDoThisEveryTime(TeacherStudentsScene): "You wouldn't do this \\\\ every time" ) self.change_student_modes(*["happy"]*3) - self.dither(2) + self.wait(2) self.student_thinks( "$\\frac{d(t^3)}{dt} = 3t^2$", ) - self.dither(3) + self.wait(3) series = VideoSeries() series.scale_to_fit_width(2*SPACE_WIDTH-1) @@ -2087,7 +2087,7 @@ class YouWouldntDoThisEveryTime(TeacherStudentsScene): next_video.highlight, YELLOW, next_video.shift, 0.5*DOWN ) - self.dither(2) + self.wait(2) class ContrastConcreteDtWithLimit(Scene): def construct(self): @@ -2149,7 +2149,7 @@ class ContrastConcreteDtWithLimit(Scene): GrowFromCenter(brace), Write(text) ) - self.dither(2) + self.wait(2) class TimeForAnActualParadox(TeacherStudentsScene): def construct(self): @@ -2174,7 +2174,7 @@ class TimeForAnActualParadox(TeacherStudentsScene): ["pondering", "happy", "hesitant"] ) ])) - self.dither(4) + self.wait(4) class ParadoxAtTEquals0(TCubedExample): CONFIG = { @@ -2239,7 +2239,7 @@ class ParadoxAtTEquals0(TCubedExample): direction = RIGHT, buff = SMALL_BUFF ) - self.dither() + self.wait() self.car = car @@ -2258,10 +2258,10 @@ class ParadoxAtTEquals0(TCubedExample): self.play(Write(question[0], run_time = 1)) self.play(MoveCar(self.car, origin)) - self.dither() + self.wait() self.play(Write(question[1])) self.play(ShowCreation(arrow)) - self.dither(2) + self.wait(2) self.question = question @@ -2280,10 +2280,10 @@ class ParadoxAtTEquals0(TCubedExample): derivative.shift(2*UP) self.play(Write(derivative[0])) - self.dither() + self.wait() self.play(FadeIn(derivative[1])) self.play(*map(FadeIn, derivative[2:])) - self.dither(2) + self.wait(2) self.derivative = derivative @@ -2321,7 +2321,7 @@ class ParadoxAtTEquals0(TCubedExample): UpdateFromAlphaFunc(dot, dot_update), run_time = 4 ) - self.dither(2) + self.wait(2) self.tangent_line = line @@ -2348,7 +2348,7 @@ class ParadoxAtTEquals0(TCubedExample): ) self.play(MoveCar(self.car, self.coords_to_point(0, 0))) self.play(Blink(morty)) - self.dither(2) + self.wait(2) self.morty = morty @@ -2385,7 +2385,7 @@ class ParadoxAtTEquals0(TCubedExample): rate_func = there_and_back, run_time = 1.5 ) - self.dither(2) + self.wait(2) self.play( everything.restore, FadeOut(question), @@ -2396,14 +2396,14 @@ class ParadoxAtTEquals0(TCubedExample): GrowFromCenter(brace), FadeIn(brace_text) ) - self.dither() + self.wait() self.play( self.tangent_line.rotate_in_place, np.pi/24, rate_func = wiggle, run_time = 1 ) self.play(Blink(morty)) - self.dither() + self.wait() class TinyMovement(ZoomedScene): CONFIG = { @@ -2462,7 +2462,7 @@ class TinyMovement(ZoomedScene): zoom_rect.scale, 0.5, zoom_rect.move_to, brace ) - self.dither() + self.wait() def show_ratios(self): ratios = [ @@ -2471,10 +2471,10 @@ class TinyMovement(ZoomedScene): ] ratio = ratios[0] self.play(FadeIn(ratio)) - self.dither(2) + self.wait(2) for new_ratio in ratios[1:]: self.play(Transform(ratio, new_ratio)) - self.dither() + self.wait() def get_ratio(self, power = 1): dt = "0.%s1"%("0"*(power-1)) @@ -2530,9 +2530,9 @@ class NextVideos(TeacherStudentsScene): for pi in self.get_students() ]) ) - self.dither(2) + self.wait(2) self.change_student_modes(*["thinking"]*3) - self.dither(3) + self.wait(3) class Chapter2PatreonThanks(PatreonThanks): CONFIG = { @@ -2626,9 +2626,9 @@ class Promotion(PiCreatureScene): aops_logo.shift, 1.5*UP + 0.5*RIGHT ) self.change_mode("happy") - self.dither(2) + self.wait(2) self.play(Blink(mathy)) - self.dither() + self.wait() self.play( RemovePiCreatureBubble( mathy, target_mode = "happy" @@ -2640,28 +2640,28 @@ class Promotion(PiCreatureScene): mathy.look_at, morty.eyes, morty.look_at, mathy.eyes, ) - self.dither(2) + self.wait(2) self.play( Animation(VectorizedPoint(book_spot)), mathy.change, "raise_right_hand", book_spot, morty.change, "pondering", ) - self.dither(3) + self.wait(3) self.play(Blink(mathy)) - self.dither(7) + self.wait(7) self.play( ShowCreation(rect), morty.restore, morty.change, "happy", rect, FadeOut(mathy), ) - self.dither(10) + self.wait(10) self.play(ShowCreation(url_rect)) self.play( FadeOut(url_rect), url.get_part_by_tex("3blue1brown").highlight, BLUE, ) - self.dither(3) + self.wait(3) class Thumbnail(SecantLineToTangentLine): def construct(self): diff --git a/old_projects/eoc/chapter3.py b/old_projects/eoc/chapter3.py index 98538493..038d557c 100644 --- a/old_projects/eoc/chapter3.py +++ b/old_projects/eoc/chapter3.py @@ -55,7 +55,7 @@ class PoseAbstractDerivative(TeacherStudentsScene): """) content_copy = self.teacher.bubble.content.copy() self.change_student_modes("sad", "confused", "erm") - self.dither() + self.wait() self.student_says( "Why?", target_mode = "sassy", added_anims = [ @@ -64,7 +64,7 @@ class PoseAbstractDerivative(TeacherStudentsScene): ] ) self.play(self.teacher.change_mode, "pondering") - self.dither(2) + self.wait(2) class ContrastAbstractAndConcrete(Scene): def construct(self): @@ -95,7 +95,7 @@ class ContrastAbstractAndConcrete(Scene): self.add(l_title, r_title) self.play(*map(ShowCreation, [h_line, v_line])) self.play(Write(functions)) - self.dither() + self.wait() anims = [ method(func_mob) for func_mob, method in zip(functions, [ @@ -203,7 +203,7 @@ class ApplicationNames(Scene): mob = TextMobject(name) mob.scale(2) self.play(Write(mob)) - self.dither(2) + self.wait(2) self.play(FadeOut(mob)) class ListOfRules(PiCreatureScene): @@ -232,7 +232,7 @@ class ListOfRules(PiCreatureScene): self.pi_creature.change_mode, "pleading", ) self.change_mode("tired") - self.dither() + self.wait() class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene): CONFIG = { @@ -261,7 +261,7 @@ class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene): ) self.play(ShowCreation(graph)) self.play(Write(label)) - self.dither() + self.wait() self.graph = graph def ask_about_df_dx(self): @@ -301,17 +301,17 @@ class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene): Write(derivative_q, run_time = 1), self.pi_creature.change_mode, "speaking" ) - self.dither() + self.wait() self.play( FadeOut(derivative_q), self.pi_creature.change_mode, "plain" ) self.play(ShowCreation(v_line)) - self.dither() + self.wait() self.play(Transform(v_line.copy(), nudged_v_line)) self.remove(self.get_mobjects_from_last_animation()[0]) self.add(nudged_v_line) - self.dither() + self.wait() self.activate_zooming() self.little_rectangle.replace(self.big_rectangle) self.play( @@ -330,14 +330,14 @@ class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene): ShowCreation(ss_group.dx_line), Write(ss_group.dx_label), ) - self.dither() + self.wait() self.play( ShowCreation(ss_group.df_line), Write(ss_group.df_label), ) - self.dither() + self.wait() self.play(Write(df_dx)) - self.dither() + self.wait() self.play(*map(FadeOut, [ v_line, nudged_v_line, ])) @@ -363,7 +363,7 @@ class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene): self.pi_creature.change_mode, "thinking" ) ss_group.add(ss_group.secant_line) - self.dither() + self.wait() for target_x in self.big_x, -self.dx/2, 1, 2: self.animate_secant_slope_group_change( ss_group, target_x = target_x, @@ -371,7 +371,7 @@ class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene): UpdateFromFunc(self.little_rectangle, rect_update) ] ) - self.dither() + self.wait() def mention_alternate_view(self): self.remove(self.pi_creature) @@ -386,7 +386,7 @@ class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene): self.pi_creature.change_mode, "happy" ) self.say("Let's try \\\\ another view.", target_mode = "speaking") - self.dither(2) + self.wait(2) class NudgeSideLengthOfSquare(PiCreatureScene): CONFIG = { @@ -446,7 +446,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): self.play(*map(GrowFromCenter, braces)) self.play(Write(x_squared)) self.change_mode("pondering") - self.dither() + self.wait() self.square = square self.side_braces = braces @@ -507,7 +507,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): self.remove(corner_point, bottom_line, right_line) self.add(corner_square, bottom_rect, right_rect) self.play(*map(GrowFromCenter, little_braces)) - self.dither() + self.wait() self.play(*it.chain(*[ [mob.shift, vect*SMALL_BUFF] for mob, vect in [ @@ -520,7 +520,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): ] ])) self.change_mode("thinking") - self.dither() + self.wait() self.right_rect = right_rect self.bottom_rect = bottom_rect self.corner_square = corner_square @@ -558,7 +558,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): mover.save_state() Transform(mover, origin).update(1) self.play(df.restore) - self.dither() + self.wait() self.play( *[ mob.restore @@ -570,7 +570,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): run_time = 2 ) self.change_mode("happy") - self.dither() + self.wait() self.df_equation = df_equation @@ -589,7 +589,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): ]), rate_func = there_and_back ) - self.dither() + self.wait() def examine_thin_rectangles(self): df, equals, r1, plus1, r2, plus2, s = self.df_equation @@ -611,7 +611,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): Write(text), self.pi_creature.change_mode, "pondering" ) - self.dither() + self.wait() xs = VGroup(*[ brace[-1] @@ -631,11 +631,11 @@ class NudgeSideLengthOfSquare(PiCreatureScene): Transform(submob, number).update(1) self.play(MoveToTarget(xs)) self.play(MoveToTarget(dxs)) - self.dither() + self.wait() self.play(Transform(text, alt_text)) - self.dither() + self.wait() self.play(Write(example_value)) - self.dither() + self.wait() self.play( FadeOut(example_value), *[ @@ -647,7 +647,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): text.restore() self.add(text) - self.dither() + self.wait() self.dxs = dxs self.thin_rect_brace = thin_rect_brace self.thin_rect_area = text @@ -662,7 +662,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): self.play(Write(text)) self.change_mode("surprised") - self.dither() + self.wait() self.play( MoveToTarget(self.dxs), self.pi_creature.change_mode, "plain" @@ -677,7 +677,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): Transform(text, alt_text), self.pi_creature.change_mode, "raise_right_hand" ) - self.dither(2) + self.wait(2) self.play(*[ mob.restore for mob in self.dxs, text @@ -707,13 +707,13 @@ class NudgeSideLengthOfSquare(PiCreatureScene): alt_scene.mobjects_at_start_of_show_smaller_dx, ) ]) - self.dither() + self.wait() self.play(*[ mob.restore for mob in self.get_mobjects() ]) self.change_mode("happy") - self.dither() + self.wait() def rule_of_thumb(self): circle = Circle(color = RED) @@ -737,7 +737,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): dx_squared_group.to_corner, UP+RIGHT, self.pi_creature.change_mode, "plain" ) - self.dither() + self.wait() def write_out_derivative(self): df, equals, r1, plus1, r2, plus2, s = self.df_equation @@ -758,14 +758,14 @@ class NudgeSideLengthOfSquare(PiCreatureScene): RIGHT, MED_SMALL_BUFF, UP, self.pi_creature.change_mode, "thinking" ) - self.dither(2) + self.wait(2) self.play( ApplyMethod(df.next_to, frac_line, UP, SMALL_BUFF), ApplyMethod(dx.next_to, frac_line, DOWN, SMALL_BUFF), Write(frac_line), path_arc = -np.pi ) - self.dither() + self.wait() brace_xs = [ brace[-1] @@ -781,7 +781,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): x_mob.save_state() x_mob.target = number self.play(*map(MoveToTarget, xs)) - self.dither(2) + self.wait(2) #Recursively transform to what would have happened #with a wider square width @@ -801,7 +801,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene): ) ]) self.change_mode("happy") - self.dither(2) + self.wait(2) class ChangeInAreaOverChangeInX(Scene): def construct(self): @@ -821,9 +821,9 @@ class ChangeInAreaOverChangeInX(Scene): self.play(Write(words[0], run_time = 1)) self.play(*map(Write, words[1:]), run_time = 1) - self.dither() + self.wait() self.play(Transform(words, symbols)) - self.dither() + self.wait() class NudgeSideLengthOfCube(Scene): CONFIG = { @@ -859,7 +859,7 @@ class NudgeSideLengthOfCube(Scene): title.shift(SPACE_WIDTH*LEFT/2) title.to_edge(UP) self.play(Write(title)) - self.dither() + self.wait() def introduce_cube(self): cube = self.get_cube() @@ -890,12 +890,12 @@ class NudgeSideLengthOfCube(Scene): self.play(DrawBorderThenFill(cube)) self.play(GrowFromCenter(x_brace)) - self.dither() + self.wait() self.play(Transform(alt_dv_pieces, dv_pieces)) self.remove(alt_dv_pieces) self.add(dv_pieces) self.play(GrowFromCenter(dx_brace)) - self.dither() + self.wait() for piece in dv_pieces: piece.on_cube_state = piece.copy() self.play(*[ @@ -907,7 +907,7 @@ class NudgeSideLengthOfCube(Scene): ]+[ ApplyMethod(dx_brace.shift, 0.7*UP) ]) - self.dither() + self.wait() self.cube = cube self.dx_brace = dx_brace @@ -952,21 +952,21 @@ class NudgeSideLengthOfCube(Scene): self.play(*map(Write, [df, equals])) self.grab_pieces(self.faces, faces) - self.dither() + self.wait() self.shrink_dx("Faces are introduced") face = self.faces[0] face.save_state() self.play(face.shift, SPACE_WIDTH*RIGHT) x_squared_dx.next_to(face, LEFT) self.play(Write(x_squared_dx, run_time = 1)) - self.dither() + self.wait() for submob, sides in zip(x_squared_dx, [face[0], VGroup(*face[1:])]): self.play( submob.highlight, RED, sides.highlight, RED, rate_func = there_and_back ) - self.dither() + self.wait() self.play( face.restore, Transform( @@ -975,14 +975,14 @@ class NudgeSideLengthOfCube(Scene): ), GrowFromCenter(faces_brace) ) - self.dither() + self.wait() self.grab_pieces(self.bars, bars, plus1) self.grab_pieces(self.corner_cube, corner_cube, plus2) self.play( GrowFromCenter(extras_brace), Write(ignore_text) ) - self.dither() + self.wait() self.play(*[ ApplyMethod(mob.fade, 0.7) for mob in [ @@ -990,7 +990,7 @@ class NudgeSideLengthOfCube(Scene): extras_brace, ignore_text ] ]) - self.dither() + self.wait() self.df_equation = df_equation self.derivative = derivative @@ -1016,7 +1016,7 @@ class NudgeSideLengthOfCube(Scene): df_equals.shift, 0.07*DOWN ) self.play(Write(extra_stuff)) - self.dither() + self.wait() frac_line = TexMobject("-") frac_line.replace(df) @@ -1039,7 +1039,7 @@ class NudgeSideLengthOfCube(Scene): Write(dx_below_dx_squared), path_arc = -np.pi ) - self.dither() + self.wait() inner_dx = VGroup(*dx_squared[:-1]) self.play( FadeOut(frac_line2), @@ -1047,13 +1047,13 @@ class NudgeSideLengthOfCube(Scene): dx_squared[-1].highlight, BLACK, inner_dx.next_to, extra_stuff[0], RIGHT, SMALL_BUFF ) - self.dither() + self.wait() self.shrink_dx("Derivative is written", restore = False) self.play(*[ ApplyMethod(mob.fade, 0.7) for mob in extra_stuff, inner_dx ]) - self.dither(2) + self.wait(2) anims = [] for mob in list(self.faces)+list(self.bars)+list(self.corner_cube): @@ -1063,7 +1063,7 @@ class NudgeSideLengthOfCube(Scene): ] anims += self.dx_brace.shift, 0.7*DOWN self.play(*anims) - self.dither() + self.wait() def grab_pieces(self, start_pieces, end_pices, to_write = None): for piece in start_pieces: @@ -1073,7 +1073,7 @@ class NudgeSideLengthOfCube(Scene): ) piece.target.highlight(RED) self.play(*map(MoveToTarget, start_pieces), rate_func = wiggle) - self.dither() + self.wait() added_anims = [] if to_write is not None: added_anims.append(Write(to_write)) @@ -1109,7 +1109,7 @@ class NudgeSideLengthOfCube(Scene): self.alt_scene.states[state_name] ) ]) - self.dither() + self.wait() if restore: self.play(*[m.restore for m in movers]) self.remove(*movers) @@ -1279,7 +1279,7 @@ class GraphOfXCubed(GraphScene): self.play(ShowCreation(graph)) self.play(Write(label, run_time = 1)) - self.dither() + self.wait() self.play(Write(deriv_label, run_time = 1)) self.play(ShowCreation(ss_group, submobject_mode = "all_at_once")) self.animate_secant_slope_group_change( @@ -1291,7 +1291,7 @@ class GraphOfXCubed(GraphScene): ] ) self.play(FadeIn(full_deriv_graph)) - self.dither() + self.wait() for x_val in -2, -self.dx/2, 2: self.animate_secant_slope_group_change( ss_group, @@ -1340,7 +1340,7 @@ class PatternForPowerRule(PiCreatureScene): replace_mobject_with_target_in_scene = True )) self.change_mode("thinking") - self.dither() + self.wait() for derivative in derivatives[-2:]: derivative.save_state() self.play( @@ -1348,7 +1348,7 @@ class PatternForPowerRule(PiCreatureScene): derivative.next_to, derivative, RIGHT, SMALL_BUFF, DOWN, ) - self.dither(2) + self.wait(2) self.play(derivative.restore) self.remove(derivative) derivative.restore() @@ -1386,14 +1386,14 @@ class PatternForPowerRule(PiCreatureScene): submobject_mode = "lagged_start", run_time = 2, ) - self.dither() + self.wait() self.play(Write(power_rule[1])) - self.dither() + self.wait() self.play( Write(title), self.pi_creature.change_mode, "speaking" ) - self.dither() + self.wait() def show_hopping(self): exp_range = range(2, 2+self.num_exponents-1) @@ -1419,7 +1419,7 @@ class PatternForPowerRule(PiCreatureScene): lhs_copy.move_to, rhs, DOWN+LEFT, Write(arrow) ) - self.dither() + self.wait() self.play( ApplyMethod( lhs_copy[1].replace, form[3], @@ -1431,7 +1431,7 @@ class PatternForPowerRule(PiCreatureScene): rate_func = squish_rate_func(smooth, 0.5, 1) ) ) - self.dither() + self.wait() self.play( self.pi_creature.change_mode, "hesitant", self.pi_creature.look_at, lhs_copy @@ -1479,7 +1479,7 @@ class PowerRuleAlgebra(Scene): GrowFromCenter(nudge_brace), GrowFromCenter(nudged_output) ) - self.dither() + self.wait() self.play( Write(VGroup(equals, full_product)), GrowFromCenter( @@ -1488,7 +1488,7 @@ class PowerRuleAlgebra(Scene): ), run_time = 3 ) - self.dither() + self.wait() self.workout_product(equals2, full_product) def workout_product(self, equals, full_product): @@ -1518,11 +1518,11 @@ class PowerRuleAlgebra(Scene): Write(equals), Transform(xs_copy, x_to_n) ) - self.dither() + self.wait() brace, derivative_term = self.pull_out_linear_terms( x_to_n, product_part_tex_pairs, xs, dxs ) - self.dither() + self.wait() circle = Circle(color = DERIVATIVE_COLOR) circle.replace(derivative_term, stretch = True) @@ -1537,9 +1537,9 @@ class PowerRuleAlgebra(Scene): extra_stuff.next_to(brace, aligned_edge = UP) self.play(Write(extra_stuff), full_product.restore) - self.dither() + self.wait() self.play(ShowCreation(circle)) - self.dither() + self.wait() def pull_out_linear_terms(self, x_to_n, product_part_tex_pairs, xs, dxs): last_group = None @@ -1620,10 +1620,10 @@ class ReactToFullExpansion(Scene): self.play(randy.change_mode, "pleading") self.play(Blink(randy)) self.play(randy.change_mode, "angry") - self.dither() + self.wait() self.play(randy.change_mode, "thinking") self.play(Blink(randy)) - self.dither() + self.wait() class OneOverX(PiCreatureScene, GraphScene): CONFIG = { @@ -1679,7 +1679,7 @@ class OneOverX(PiCreatureScene, GraphScene): Write(func), self.pi_creature.change_mode, "pondering" ) - self.dither() + self.wait() self.play( recip_copy.next_to, self.pi_creature, UP+LEFT, self.pi_creature.change_mode, "raise_right_hand" @@ -1687,7 +1687,7 @@ class OneOverX(PiCreatureScene, GraphScene): x_to_neg_one.move_to(recip_copy) neg_two.replace(neg_one) self.play(ReplacementTransform(recip_copy, x_to_neg_one)) - self.dither() + self.wait() self.play( neg_one.scale, 1.5, neg_one.next_to, x_to_neg_one, LEFT, SMALL_BUFF, DOWN, @@ -1695,7 +1695,7 @@ class OneOverX(PiCreatureScene, GraphScene): path_arc = np.pi ) self.play(FadeIn(neg_two)) - self.dither() + self.wait() self.say( "More geometry!", target_mode = "hooray", @@ -1705,7 +1705,7 @@ class OneOverX(PiCreatureScene, GraphScene): ], run_time = 2 ) - self.dither() + self.wait() self.play(RemovePiCreatureBubble(self.pi_creature)) def introduce_puddle(self): @@ -1720,13 +1720,13 @@ class OneOverX(PiCreatureScene, GraphScene): GrowFromCenter(rect_group.x_brace), Write(rect_group.x_label), ) - self.dither() + self.wait() self.play( GrowFromCenter(rect_group.recip_brace), Write(rect_group.recip_label), ) self.setup_axes(animate = True) - self.dither() + self.wait() for d in 2, 3: self.change_rectangle_group( @@ -1737,9 +1737,9 @@ class OneOverX(PiCreatureScene, GraphScene): }, run_time = 2 ) - self.dither() + self.wait() self.change_rectangle_group(rect_group, 3) - self.dither() + self.wait() self.rect_group = rect_group @@ -1757,7 +1757,7 @@ class OneOverX(PiCreatureScene, GraphScene): ) self.change_mode("happy") self.change_rectangle_group(rect_group, self.start_x_value) - self.dither() + self.wait() self.graph = graph @@ -1878,37 +1878,37 @@ class OneOverX(PiCreatureScene, GraphScene): GrowFromCenter(dx_brace), *map(ShowCreation, v_lines) ) - self.dither() + self.wait() self.play( GrowFromCenter(df_brace), *map(ShowCreation, h_lines) ) self.change_mode("confused") - self.dither() + self.wait() self.play( FadeIn(area_gained), Write(area_gained_label, run_time = 2), ShowCreation(area_gained_arrow) ) - self.dither() + self.wait() self.play( FadeIn(area_lost), Write(area_lost_label, run_time = 2), ShowCreation(area_lost_arrow) ) - self.dither() + self.wait() self.revert_to_original_skipping_status()### self.play( Write(negative), ShowCreation(negative_arrow) ) - self.dither() + self.wait() self.play( Write(question), self.pi_creature.change_mode, "raise_right_hand" ) - self.dither(2) + self.wait(2) ######## @@ -1928,7 +1928,7 @@ class OneOverX(PiCreatureScene, GraphScene): rect_group = self.get_rectangle_group(0.5) self.add(rect_group) - self.dither() + self.wait() self.change_rectangle_group( rect_group, 2, target_group_kwargs = { @@ -1937,7 +1937,7 @@ class OneOverX(PiCreatureScene, GraphScene): }, added_anims = [ShowCreation(graph)] ) - self.dither() + self.wait() def get_rectangle_group( self, x, @@ -2034,7 +2034,7 @@ class AskRecipriocalQuestion(Scene): arrow.move_to(tex[0].get_top(), DOWN+LEFT) self.play(Write(tex)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() class SquareRootOfX(Scene): CONFIG = { @@ -2087,7 +2087,7 @@ class SquareRootOfX(Scene): Write(area_label) ) self.play(*map(FadeIn, braces)) - self.dither() + self.wait() self.square = square self.area_label = area_label @@ -2150,13 +2150,13 @@ class SquareRootOfX(Scene): map(FadeIn, little_braces) )) self.play(Write(question)) - self.dither() + self.wait() class MentionSine(TeacherStudentsScene): def construct(self): self.teacher_says("Let's tackle $\\sin(\\theta)$") self.change_student_modes("pondering", "hooray", "erm") - self.dither(2) + self.wait(2) self.student_thinks("") self.zoom_in_on_thought_bubble() @@ -2166,7 +2166,7 @@ class NameUnitCircle(Scene): words.scale(2) words.highlight(BLUE) self.play(Write(words)) - self.dither() + self.wait() class DerivativeOfSineIsSlope(Scene): def construct(self): @@ -2180,7 +2180,7 @@ class DerivativeOfSineIsSlope(Scene): VGroup(*tex[1][-9:]).highlight(BLUE) self.play(Write(tex, run_time = 2)) - self.dither() + self.wait() class IntroduceUnitCircleWithSine(GraphScene): CONFIG = { @@ -2233,7 +2233,7 @@ class IntroduceUnitCircleWithSine(GraphScene): Rotate(radial_line, 2*np.pi), run_time = 2, ) - self.dither() + self.wait() self.circle = circle self.radial_line = radial_line @@ -2266,18 +2266,18 @@ class IntroduceUnitCircleWithSine(GraphScene): GrowFromCenter(brace), ) self.play(Write(brace_text)) - self.dither() + self.wait() self.play( line.move_to, radial_line.get_end(), DOWN, FadeOut(brace) ) self.play(ReplacementTransform(line, arc)) - self.dither() + self.wait() self.play( Rotate(radial_line, self.example_radians), ShowCreation(arc_copy) ) - self.dither() + self.wait() arc_copy.generate_target() arc_copy.target.scale(0.2) theta_copy.generate_target() @@ -2288,7 +2288,7 @@ class IntroduceUnitCircleWithSine(GraphScene): ) theta_copy.target.shift(SMALL_BUFF*UP) self.play(*map(MoveToTarget, [arc_copy, theta_copy])) - self.dither() + self.wait() self.angle_label = VGroup(arc_copy, theta_copy) self.example_theta_equation = brace_text @@ -2307,7 +2307,7 @@ class IntroduceUnitCircleWithSine(GraphScene): GrowFromCenter(brace), Write(brace_text) ) - self.dither() + self.wait() faders = [brace, brace_text, self.example_theta_equation] if self.remove_angle_label: faders += self.angle_label @@ -2392,7 +2392,7 @@ class DerivativeIntuitionFromSineGraph(GraphScene): run_time = 2./rps, rate_func = None ) - self.dither() + self.wait() self.graph = graph def draw_derivative_from_slopes(self): @@ -2409,7 +2409,7 @@ class DerivativeIntuitionFromSineGraph(GraphScene): self.play(ShowCreation(ss_group, submobject_mode = "all_at_once")) self.play(ShowCreation(v_line)) - self.dither() + self.wait() last_theta = 0 next_theta = np.pi/2 while last_theta < self.x_max: @@ -2434,7 +2434,7 @@ class DerivativeIntuitionFromSineGraph(GraphScene): ), ] ) - self.dither() + self.wait() if next_theta == 2*np.pi: words = TextMobject("Looks a lot like $\\cos(\\theta)$") words.next_to(self.graph_origin, RIGHT) @@ -2468,7 +2468,7 @@ class DerivativeIntuitionFromSineGraph(GraphScene): Transform(self.deriv_graph, new_graph), run_time = 2 ) - self.dither() + self.wait() ###### @@ -2498,7 +2498,7 @@ class LookToFunctionsMeaning(TeacherStudentsScene): actual meaning """) self.change_student_modes(*["pondering"]*3) - self.dither(3) + self.wait(3) class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene): CONFIG = { @@ -2536,7 +2536,7 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene): self.little_rectangle.shift, SMALL_BUFF*(DOWN+RIGHT) ) - self.dither() + self.wait() def perform_nudge(self): d_theta_arc = Arc( @@ -2582,7 +2582,7 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene): GrowFromCenter(d_theta_brace), FadeIn(d_theta_label) ) - self.dither() + self.wait() self.play( ShowCreation(h_line), ShowCreation(d_sine_line) @@ -2591,7 +2591,7 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene): GrowFromCenter(d_sine_brace), Write(d_sine) ) - self.dither() + self.wait() self.little_triangle = Polygon( nudged_point, point, interim_point @@ -2635,7 +2635,7 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene): little_triangle.highlight, YELLOW, rate_func = there_and_back ) - self.dither() + self.wait() groups = [self.d_theta_group, self.d_sine_group] for group, line in zip(groups, little_triangle_lines): self.play(ApplyMethod( @@ -2648,7 +2648,7 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene): group.highlight, YELLOW, rate_func = there_and_back, ) - self.dither() + self.wait() self.play(ReplacementTransform( little_triangle.copy().set_fill(opacity = 0), @@ -2656,18 +2656,18 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene): path_arc = np.pi/2, run_time = 2 )) - self.dither() + self.wait() self.play( ReplacementTransform(big_triangle_copy, big_triangle), Animation(self.angle_label) ) - self.dither() + self.wait() self.play( self.radial_line.rotate_in_place, np.pi/12, Animation(big_triangle), rate_func = wiggle, ) - self.dither() + self.wait() self.play( ReplacementTransform( big_triangle.copy().set_fill(opacity = 0), @@ -2687,7 +2687,7 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene): new_angle_label.highlight, RED, rate_func = there_and_back ) - self.dither() + self.wait() def analyze_ratios(self): d_ratio = TexMobject("\\frac{d(\\sin(\\theta))}{d\\theta} = ") @@ -2709,14 +2709,14 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene): for mob in group: self.play(Write(mob)) - self.dither() + self.wait() class TryWithCos(Scene): def construct(self): words = TextMobject("What about $\\cos(\\theta)$?") words.highlight(YELLOW) self.play(Write(words)) - self.dither() + self.wait() class NextVideo(TeacherStudentsScene): def construct(self): @@ -2747,7 +2747,7 @@ class NextVideo(TeacherStudentsScene): next_video.highlight, YELLOW, next_video.shift, MED_LARGE_BUFF*DOWN ) - self.dither() + self.wait() for mob in group: self.play( Write(mob, run_time = 1), @@ -2756,7 +2756,7 @@ class NextVideo(TeacherStudentsScene): for pi in self.get_pi_creatures() ] ) - self.dither(3) + self.wait(3) class Chapter3PatreonThanks(PatreonThanks): CONFIG = { @@ -2806,15 +2806,15 @@ class Promotion(PiCreatureScene): self.pi_creature.change, "raise_right_hand" ) self.play(ShowCreation(rect)) - self.dither(2) + self.wait(2) self.change_mode("thinking") - self.dither() + self.wait() self.look_at(url) - self.dither(10) + self.wait(10) self.change_mode("happy") - self.dither(10) + self.wait(10) self.change_mode("raise_right_hand") - self.dither(10) + self.wait(10) class Thumbnail(NudgeSideLengthOfCube): def construct(self): diff --git a/old_projects/eoc/chapter4.py b/old_projects/eoc/chapter4.py index ae4be91e..52453904 100644 --- a/old_projects/eoc/chapter4.py +++ b/old_projects/eoc/chapter4.py @@ -87,8 +87,8 @@ class TransitionFromLastVideo(TeacherStudentsScene): for pi in self.get_students() ] ) - self.dither() - self.dither(2) + self.wait() + self.wait(2) self.play(simple_rules.replace, last_video) self.play( last_video.restore, @@ -105,7 +105,7 @@ class TransitionFromLastVideo(TeacherStudentsScene): for pi in self.get_students() ] ) - self.dither(2) + self.wait(2) for rule in combination_rules: interior = VGroup(*rule[5:-1]) added_anims = [] @@ -121,8 +121,8 @@ class TransitionFromLastVideo(TeacherStudentsScene): *added_anims, submobject_mode = "lagged_start" ) - self.dither() - self.dither() + self.wait() + self.wait() #Address subtraction and division subtraction = TexMobject("\\sin(x)", "-", "x^2") @@ -162,14 +162,14 @@ class TransitionFromLastVideo(TeacherStudentsScene): self.get_students()[2].change_mode, "raise_right_hand", self.get_teacher().change_mode, "plain", ) - self.dither() + self.wait() answer[1].highlight(GREEN) self.play( Transform(question, answer), self.get_teacher().change_mode, "hooray", self.get_students()[2].change_mode, "plain", ) - self.dither() + self.wait() self.play(FadeOut(question)) #Monstrous expression @@ -201,7 +201,7 @@ class TransitionFromLastVideo(TeacherStudentsScene): for pi in self.get_students() ] ) - self.dither() + self.wait() self.change_student_modes(*["happy"]*3) words = map(TextMobject, [ "composition", "product", @@ -217,7 +217,7 @@ class TransitionFromLastVideo(TeacherStudentsScene): part.scale_in_place, 1.2, part.highlight, YELLOW ) - self.dither() + self.wait() self.play(*map(FadeOut, [word, part])) self.play(FadeOut(parts[0])) @@ -229,7 +229,7 @@ class TransitionFromLastVideo(TeacherStudentsScene): for pi_creature in self.get_pi_creatures() ] ) - self.dither(2) + self.wait(2) class DampenedSpring(Scene): def construct(self): @@ -268,7 +268,7 @@ class DampenedSpring(Scene): moving_spring, update_spring, run_time = 10, rate_func = None )) - self.dither() + self.wait() class ComingUp(Scene): def construct(self): @@ -281,7 +281,7 @@ class ComingUp(Scene): self.play(Write(title)) self.play(ShowCreation(rect)) - self.dither() + self.wait() class PreSumRuleDiscussion(Scene): def construct(self): @@ -308,7 +308,7 @@ class PreSumRuleDiscussion(Scene): self.add(specific) for i in 0, 4, 5: self.add(general[i]) - self.dither(2) + self.wait(2) for indices in [(1, 2, 3), (6,), (7, 8)]: self.play(*[ ReplacementTransform( @@ -316,12 +316,12 @@ class PreSumRuleDiscussion(Scene): ) for i in indices ]) - self.dither() + self.wait() #Highlight parts for i in 1, 3, -1, 6, 8: if i < 0: - self.dither() + self.wait() else: part = specific[i] self.play( @@ -329,7 +329,7 @@ class PreSumRuleDiscussion(Scene): part.scale_in_place, 1.2, rate_func = there_and_back ) - self.dither() + self.wait() class SumRule(GraphScene): CONFIG = { @@ -398,7 +398,7 @@ class SumRule(GraphScene): ShowCreation(graph), Write(label) ) - self.dither() + self.wait() num_lines = (self.v_lines_x_max-self.v_lines_x_min)/self.dx sine_v_lines, parabox_v_lines = v_line_sets = [ @@ -414,7 +414,7 @@ class SumRule(GraphScene): sine_v_lines.shift(0.02*RIGHT) for v_lines in v_line_sets: self.play(ShowCreation(v_lines), Animation(labels)) - self.dither() + self.wait() self.play(*it.chain( [ ApplyMethod(l2.move_to, l1.get_top(), DOWN) @@ -423,10 +423,10 @@ class SumRule(GraphScene): [graph.fade for graph in graphs], [Animation(labels)] )) - self.dither() + self.wait() self.play(ShowCreation(sum_graph)) - self.dither() + self.wait() self.sum_graph = sum_graph self.parabola = parabola @@ -457,7 +457,7 @@ class SumRule(GraphScene): self.play(*map(MoveToTarget, [ graph_parts, self.graph_labels ])) - self.dither() + self.wait() def show_example_stacking(self): v_line_sets = self.v_line_sets @@ -524,24 +524,24 @@ class SumRule(GraphScene): ) for line in example_v_lines: line.save_state() - self.dither() + self.wait() self.play( GrowFromCenter(sine_lines[0].brace), Write(sine_lines[0].brace_text), ) - self.dither() + self.wait() self.play( sine_lines[0].shift, UP+4*LEFT, sine_lines[0].brace_anim, parabola_lines[0].move_to, sine_lines[0], DOWN ) - self.dither() + self.wait() parabola_lines[0].brace_anim.update(1) self.play( GrowFromCenter(parabola_lines[0].brace), Write(parabola_lines[0].brace_text), ) - self.dither() + self.wait() self.play(*it.chain(*[ [line.restore, line.brace_anim] for line in example_v_lines @@ -555,13 +555,13 @@ class SumRule(GraphScene): for line in nudged_v_lines ]) ) - self.dither() + self.wait() for line in nudged_v_lines: self.play( GrowFromCenter(line.brace), Write(line.brace_text) ) - self.dither() + self.wait() self.sine_lines = sine_lines self.parabola_lines = parabola_lines @@ -586,7 +586,7 @@ class SumRule(GraphScene): submob.add_to_back(BackgroundRectangle(submob)) df_lines = self.show_difference(parabola_lines, df, equals) - self.dither() + self.wait() self.play(FadeOut(df_lines)) self.play( parabola_lines[0].shift, @@ -595,7 +595,7 @@ class SumRule(GraphScene): ) d_sine_lines = self.show_difference(sine_lines, d_sine, plus) d_x_squared_lines = self.show_difference(parabola_lines, d_x_squared, VGroup()) - self.dither() + self.wait() self.deriv_mob = deriv_mob self.d_sine_lines = d_sine_lines @@ -616,7 +616,7 @@ class SumRule(GraphScene): self.play(ShowCreation(h_lines)) self.play(GrowFromCenter(brace), Write(brace_text)) - self.dither() + self.wait() self.play( ReplacementTransform(brace_text.copy(), target_tex), Write(added_tex) @@ -655,7 +655,7 @@ class SumRule(GraphScene): ), Write(expanded_deriv) ) - self.dither() + self.wait() tex_group_pairs = [ ("\\cos(0.5)dx", self.d_sine_lines), @@ -679,15 +679,15 @@ class SumRule(GraphScene): self.play(FocusOn(old_label)) indicate(old_label) - self.dither() + self.wait() self.play(FadeOut(old_label)) self.play(FadeIn(new_label)) - self.dither() + self.wait() indicate(dx) - self.dither() + self.wait() indicate(pre_dx) - self.dither() - self.dither() + self.wait() + self.wait() self.play(*[ Transform( expanded_deriv[i], rearranged_deriv[j], @@ -695,7 +695,7 @@ class SumRule(GraphScene): ) for i, j in enumerate(deriv_target_indices) ]) - self.dither() + self.wait() class DiscussProducts(TeacherStudentsScene): def construct(self): @@ -718,7 +718,7 @@ class DiscussProducts(TeacherStudentsScene): "Products are a bit different", target_mode = "sassy" ) - self.dither(2) + self.wait(2) self.play(RemovePiCreatureBubble( self.get_teacher(), target_mode = "raise_right_hand" @@ -731,7 +731,7 @@ class DiscussProducts(TeacherStudentsScene): not_equals.highlight, RED ] ) - self.dither() + self.wait() self.teacher_says( "Think about the \\\\ underlying meaning", bubble_kwargs = {"height" : 3}, @@ -741,7 +741,7 @@ class DiscussProducts(TeacherStudentsScene): ] ) self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) class NotGraphsForProducts(GraphScene): CONFIG = { @@ -780,7 +780,7 @@ class NotGraphsForProducts(GraphScene): ShowCreation(graph), Write(graph.label, run_time = 2) ) - self.dither() + self.wait() everything = VGroup(*filter( lambda m : not m.is_subpath, @@ -795,16 +795,16 @@ class NotGraphsForProducts(GraphScene): everything.fade, Write(words) ) - self.dither() + self.wait() class ConfusedMorty(Scene): def construct(self): morty = Mortimer() self.add(morty) - self.dither() + self.wait() self.play(morty.change_mode, "confused") self.play(Blink(morty)) - self.dither(2) + self.wait(2) class IntroduceProductAsArea(ReconfigurableScene): CONFIG = { @@ -854,15 +854,15 @@ class IntroduceProductAsArea(ReconfigurableScene): self.play(Write(labels)) self.play(DrawBorderThenFill(box)) - self.dither() + self.wait() for mob in self.x_slider: self.play(Write(mob, run_time = 1)) - self.dither() + self.wait() for new_x in 0.5, 2, self.default_x: self.animate_x_change( new_x, run_time = 2 ) - self.dither() + self.wait() def talk_though_sine(self): x_axis = self.x_slider[0] @@ -904,15 +904,15 @@ class IntroduceProductAsArea(ReconfigurableScene): UpdateFromFunc(v_line, v_line_update) ] ) - self.dither() + self.wait() self.play(*it.chain( map(FadeOut, [y_axis, graph, label, v_line]), [Animation(x_axis)] )) - self.dither() + self.wait() for x in 1, 0.5, self.default_x: self.animate_x_change(x) - self.dither() + self.wait() def define_f_of_x(self): f_def = TexMobject( @@ -932,7 +932,7 @@ class IntroduceProductAsArea(ReconfigurableScene): box.copy().set_fill(opacity = 0), f_def[-1], run_time = 1.5, )) - self.dither() + self.wait() self.f_def = f_def @@ -954,7 +954,7 @@ class IntroduceProductAsArea(ReconfigurableScene): run_time = 2, added_anims = [Animation(nudge_label_group)] ) - self.dither() + self.wait() self.play( ReplacementTransform(thin_df_boxes, df_boxes), VGroup(*labels[1]).shift, right_box.get_width()*RIGHT, @@ -963,7 +963,7 @@ class IntroduceProductAsArea(ReconfigurableScene): df_boxes.space_out_submobjects, 1.1, df_boxes.move_to, box, UP+LEFT, ) - self.dither() + self.wait() self.df_boxes = df_boxes self.df_box_labels = self.get_df_box_labels(df_boxes) @@ -1069,7 +1069,7 @@ class IntroduceProductAsArea(ReconfigurableScene): df_boxes_copy.next_to, deriv[1] ) deriv.submobjects[4] = df_boxes_copy[1] - self.dither() + self.wait() self.highlight_right_boxes() self.highlight_bottom_boxes() @@ -1093,7 +1093,7 @@ class IntroduceProductAsArea(ReconfigurableScene): rate_func = there_and_back ) self.play(boxes.restore, label.restore) - self.dither() + self.wait() def highlight_right_boxes(self): self.highlight_boxes_and_label( @@ -1121,13 +1121,13 @@ class IntroduceProductAsArea(ReconfigurableScene): faders.save_state() self.play(faders.fade, 0.8) - self.dither() + self.wait() self.play(FocusOn(bottom_box_copy)) self.play( ReplacementTransform(bottom_box_copy, bottom_box_area), other_box_copies.next_to, bottom_box_area, RIGHT ) - self.dither() + self.wait() self.play(faders.restore) def describe_right_box(self, right_box_area): @@ -1145,7 +1145,7 @@ class IntroduceProductAsArea(ReconfigurableScene): faders.save_state() self.play(faders.fade, 0.8) - self.dither() + self.wait() self.play(FocusOn(right_box_copy)) self.play( ReplacementTransform(right_box_copy, right_box_area), @@ -1153,7 +1153,7 @@ class IntroduceProductAsArea(ReconfigurableScene): MED_SMALL_BUFF, RIGHT, ) - self.dither() + self.wait() self.play(faders.restore) def ignore_corner(self): @@ -1170,11 +1170,11 @@ class IntroduceProductAsArea(ReconfigurableScene): corner.highlight, RED, corner_copy.highlight, RED, ) - self.dither() + self.wait() self.play(Write(words), ShowCreation(arrow)) - self.dither() + self.wait() self.play(*map(FadeOut, [words, arrow, corner_copy])) - self.dither() + self.wait() corner_copy.highlight(BLACK) def show_thinner_dx(self): @@ -1185,7 +1185,7 @@ class IntroduceProductAsArea(ReconfigurableScene): # self.deriv.next_to, self.f_def, DOWN, MED_LARGE_BUFF, # self.deriv.shift_onto_screen # ) - # self.dither() + # self.wait() expanded_deriv = TexMobject( "df", "=", @@ -1236,11 +1236,11 @@ class IntroduceProductAsArea(ReconfigurableScene): top_part.add(self.deriv[i].copy()) bottom_part.add(expanded_deriv[i]) self.play(top_part.move_to, bottom_part) - self.dither() + self.wait() indicate(top_part) - self.dither() + self.wait() self.play(ReplacementTransform(top_part, bottom_part)) - self.dither() + self.wait() top_part = VGroup() bottom_part = VGroup() for i in non_deriv_indices: @@ -1250,7 +1250,7 @@ class IntroduceProductAsArea(ReconfigurableScene): top_part, bottom_part )) - self.dither() + self.wait() self.play(*[ ReplacementTransform( expanded_deriv[i], final_deriv[j], @@ -1268,10 +1268,10 @@ class IntroduceProductAsArea(ReconfigurableScene): (8, 1), ] ]) - self.dither() + self.wait() for index in 0, 1, 3, 4, 6, 7: indicate(final_deriv[index]) - self.dither() + self.wait() def write_derivative_abstractly(self): self.transition_to_alt_config( @@ -1283,7 +1283,7 @@ class IntroduceProductAsArea(ReconfigurableScene): side_func_nudge_label = "dh", side_func_derivative = "\\frac{dh}{dx}", ) - self.dither() + self.wait() def write_mneumonic(self): morty = Mortimer() @@ -1304,7 +1304,7 @@ class IntroduceProductAsArea(ReconfigurableScene): morty.change_mode, "raise_right_hand", Write(words) ) - self.dither() + self.wait() ############### @@ -1404,7 +1404,7 @@ class WriteDXSquared(Scene): term = TexMobject("(...)(dx)^2") term.highlight(RED) self.play(Write(term)) - self.dither() + self.wait() class MneumonicExample(TeacherStudentsScene): def construct(self): @@ -1439,11 +1439,11 @@ class MneumonicExample(TeacherStudentsScene): self.play(ReplacementTransform( left_words.copy(), left_terms )) - self.dither() + self.wait() self.play(*map(Indicate, [left, left_words[0], left_terms[0]])) - self.dither() + self.wait() self.play(*map(Indicate, [right, left_words[1], left_terms[1]])) - self.dither() + self.wait() right_words = VGroup(*words[2:]) right_terms = VGroup(*deriv[2:]) @@ -1454,30 +1454,30 @@ class MneumonicExample(TeacherStudentsScene): self.play(ReplacementTransform( right_words.copy(), right_terms )) - self.dither() + self.wait() self.play(*map(Indicate, [right, right_words[1], right_terms[1]])) - self.dither() + self.wait() self.play(*map(Indicate, [left, right_words[2], right_terms[2]])) - self.dither(3) + self.wait(3) self.play(self.get_teacher().change_mode, "shruggie") - self.dither() + self.wait() self.change_student_modes(*["confused"]*3) - self.dither(3) + self.wait(3) class ConstantMultiplication(TeacherStudentsScene): def construct(self): question = TextMobject("What about $\\dfrac{d}{dx}(2\\sin(x))$?") answer = TextMobject("2\\cos(x)") self.teacher_says(question) - self.dither() + self.wait() self.student_says( answer, target_mode = "hooray", added_anims = [question.copy().to_edge, UP] ) self.play(self.get_teacher().change_mode, "happy") self.change_student_modes("pondering", "hooray", "pondering") - self.dither(3) + self.wait(3) class ConstantMultiplicationFigure(IntroduceProductAsArea): CONFIG = { @@ -1524,7 +1524,7 @@ class ShoveXSquaredInSine(Scene): self.add(group) self.play(Write(title)) - self.dither() + self.wait() triplets = [ [sine, (0, 2), (0, 2)], [x_squared, (0,), (1,)], @@ -1538,13 +1538,13 @@ class ShoveXSquaredInSine(Scene): ) for i, j in zip(pre_indices, comp_indicies) ]) - self.dither() - self.dither() + self.wait() + self.wait() self.play( GrowFromCenter(brace), Write(deriv_q) ) - self.dither() + self.wait() class ThreeLinesChainRule(ReconfigurableScene): CONFIG = { @@ -1605,7 +1605,7 @@ class ThreeLinesChainRule(ReconfigurableScene): for line in lines: self.play(Write(line, run_time = 2)) - self.dither() + self.wait() last_label = labels[0].copy() last_label.to_corner(UP+LEFT) last_label.set_fill(opacity = 0) @@ -1613,11 +1613,11 @@ class ThreeLinesChainRule(ReconfigurableScene): self.play(ReplacementTransform( last_label.copy(), label )) - self.dither() + self.wait() last_label = label for x in self.max_x, self.min_x, self.start_x: self.animate_x_change(x, run_time = 1) - self.dither() + self.wait() def draw_function_arrows(self): lines, line_labels = self.line_group @@ -1638,7 +1638,7 @@ class ThreeLinesChainRule(ReconfigurableScene): ShowCreation(arrow), Write(label) ) - self.dither() + self.wait() self.arrows = arrows self.arrow_labels = labels @@ -1646,14 +1646,14 @@ class ThreeLinesChainRule(ReconfigurableScene): lines, labels = self.line_group self.animate_x_change(self.top_x, run_time = 4) - self.dither() + self.wait() for label in labels[0], labels[1]: oval = Circle(color = YELLOW) oval.replace(label, stretch = True) oval.scale(2.5) oval.move_to(label.get_bottom()) self.play(ShowCreation(oval)) - self.dither() + self.wait() self.play(FadeOut(oval)) sine_text = TexMobject("\\sin(9) \\approx 0.412") sine_text.move_to(labels[-1][-1]) @@ -1667,7 +1667,7 @@ class ThreeLinesChainRule(ReconfigurableScene): FadeIn(sine_text), ShowCreation(sine_arrow) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [sine_text, sine_arrow])) self.animate_x_change(self.example_x, run_time = 3) @@ -1743,30 +1743,30 @@ class ThreeLinesChainRule(ReconfigurableScene): ) ) self.animate_x_change(self.example_x) - self.dither() + self.wait() self.play(Write(x_value_label)) - self.dither() + self.wait() self.play(FocusOn(dx_squared_brace)) self.play(Write(dx_squared_brace)) self.wiggle_by_dx() - self.dither() + self.wait() for part in dx_squared_value: self.play(Write(part)) - self.dither() + self.wait() self.play(FadeOut(dx_squared_value)) - self.dither() + self.wait() #Needs to be part of everything for the reconfiguraiton dsine_brace.set_fill(opacity = 0) dsine_value.set_fill(opacity = 0) self.add(dsine_brace, dsine_value) self.replace_x_squared_with_h() - self.dither() + self.wait() self.play(dsine_brace.set_fill, None, 1) self.discuss_dsine_sign(less_than_zero) - self.dither() + self.wait() dsine_value.set_fill(opacity = 1) self.play(Write(dsine_value)) - self.dither() + self.wait() self.play( all_x_squared_relevant_labels.restore, submobject_mode = "lagged_start", @@ -1774,10 +1774,10 @@ class ThreeLinesChainRule(ReconfigurableScene): run_time = 3, ) self.__dict__.update(self.__class__.CONFIG) - self.dither() + self.wait() for mob in dsine_value: self.play(Indicate(mob)) - self.dither() + self.wait() two_x_dx = dx_squared_value[0] dx_squared = dsine_value[1] @@ -1792,17 +1792,17 @@ class ThreeLinesChainRule(ReconfigurableScene): self.play(FadeOut(dx_squared)) for sublist in two_x_dx_copy[:2], two_x_dx_copy[2:]: self.play(Indicate(VGroup(*sublist))) - self.dither() - self.dither(2) + self.wait() + self.wait(2) self.final_derivative = dsine_value def discuss_dsine_sign(self, less_than_zero): self.wiggle_by_dx() - self.dither() + self.wait() for x in self.example_x+self.dx, self.example_x: self.animate_x_change(x, run_time = 2) - self.dither() + self.wait() if less_than_zero not in self.get_mobjects(): self.play(Write(less_than_zero)) else: @@ -1829,9 +1829,9 @@ class ThreeLinesChainRule(ReconfigurableScene): self.play(*map(FadeOut, [self.arrows, self.arrow_labels])) self.play(FadeIn(group)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.wiggle_by_dx() - self.dither() + self.wait() ######## @@ -1968,8 +1968,8 @@ class GeneralizeChainRule(Scene): for brace in braces: self.play(GrowFromCenter(brace)) self.play(Write(brace.text, run_time = 1)) - self.dither() - self.dither() + self.wait() + self.wait() self.play(*it.chain(*[ [mob.scale_in_place, 1.2, mob.highlight, YELLOW] for mob in example_inner, d_example_inner @@ -1979,7 +1979,7 @@ class GeneralizeChainRule(Scene): path_arc = -np.pi/2, remover = True )) - self.dither() + self.wait() self.play( GrowFromCenter(d_example_d_inner_brace), Write(d_example_d_inner_brace.text) @@ -1991,30 +1991,30 @@ class GeneralizeChainRule(Scene): run_time = 2, remover = True )) - self.dither() + self.wait() #Generalize self.play(*map(FadeIn, general[:5])) - self.dither() + self.wait() self.play( Transform(example_outer_brace, general_outer_brace), Transform(example_outer_brace.text, general_outer_brace.text), Transform(example_inner_brace, general_inner_brace), Transform(example_inner_brace.text, general_inner_brace.text), ) - self.dither() + self.wait() self.play( Transform(d_example_outer_brace, d_general_outer_brace), Transform(d_example_outer_brace.text, d_general_outer_brace.text), ) self.play(Write(d_general_outer)) - self.dither(2) + self.wait(2) self.play( Transform(d_example_d_inner_brace, d_general_d_inner_brace), Transform(d_example_d_inner_brace.text, d_general_d_inner_brace.text), ) self.play(Write(d_general_d_inner)) - self.dither(2) + self.wait(2) #Name chain rule name = TextMobject("``Chain rule''") @@ -2022,7 +2022,7 @@ class GeneralizeChainRule(Scene): name.highlight(YELLOW) name.to_corner(UP+LEFT) self.play(Write(name)) - self.dither() + self.wait() #Point out dh bottom morty = Mortimer().flip() @@ -2037,13 +2037,13 @@ class GeneralizeChainRule(Scene): morty.get_corner(UP+LEFT), UP, MED_LARGE_BUFF, d_general_outer_copy.shift_onto_screen ) - self.dither() + self.wait() circle = Circle(color = YELLOW) circle.replace(d_general_outer_copy[1]) circle.scale_in_place(1.4) self.play(ShowCreation(circle)) self.play(Blink(morty)) - self.dither() + self.wait() inner = d_general_outer_copy[3] self.play( morty.change_mode, "hooray", @@ -2051,10 +2051,10 @@ class GeneralizeChainRule(Scene): inner.shift, UP ) self.play(inner.shift, DOWN) - self.dither() + self.wait() self.play(morty.change_mode, "pondering") self.play(Blink(morty)) - self.dither() + self.wait() self.play(*map(FadeOut, [ d_general_outer_copy, inner, circle ])) @@ -2081,13 +2081,13 @@ class GeneralizeChainRule(Scene): dh_dx.next_to, dg_dh, morty.look_at, dg_dh, ) - self.dither() + self.wait() for mob in list(dg_dh)+list(dh_dx): circle = Circle(color = YELLOW) circle.replace(mob) circle.scale_in_place(1.3) self.play(ShowCreation(circle)) - self.dither() + self.wait() self.play(FadeOut(circle)) strikes = VGroup() @@ -2104,7 +2104,7 @@ class GeneralizeChainRule(Scene): equals_dg_dx.next_to(dh_dx) self.play(Write(equals_dg_dx)) self.play(Blink(morty)) - self.dither(2) + self.wait(2) ##More than a notational trick self.play( @@ -2118,9 +2118,9 @@ class GeneralizeChainRule(Scene): ).shift, DOWN, FadeOut(example) ) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() class WatchingVideo(PiCreatureScene): def construct(self): @@ -2151,19 +2151,19 @@ class WatchingVideo(PiCreatureScene): formulas.shift_onto_screen() self.add(randy, laptop) - self.dither() + self.wait() self.play(randy.change_mode, "erm") self.play(Blink(randy)) - self.dither() + self.wait() self.play(randy.change_mode, "maybe") - self.dither() + self.wait() self.play(Blink(randy)) for formula in formulas: self.play( Write(formula, run_time = 2), randy.change_mode, "thinking" ) - self.dither() + self.wait() def create_pi_creatures(self): return [Randolph().shift(DOWN+RIGHT)] @@ -2216,7 +2216,7 @@ class NextVideo(TeacherStudentsScene): next_video.highlight, YELLOW, self.get_teacher().change_mode, "raise_right_hand" ) - self.dither() + self.wait() self.play( Write(expression), *[ @@ -2225,10 +2225,10 @@ class NextVideo(TeacherStudentsScene): ] ) self.play(FadeIn(axes)) - self.dither() + self.wait() self.remove(expression) self.play(Transform(expression, d_expression, path_arc = np.pi/2)) - self.dither() + self.wait() self.play( Rotate( line, np.pi/4, @@ -2237,7 +2237,7 @@ class NextVideo(TeacherStudentsScene): run_time = 3 ) ) - self.dither(2) + self.wait(2) class Chapter4Thanks(PatreonThanks): CONFIG = { diff --git a/old_projects/eoc/chapter5.py b/old_projects/eoc/chapter5.py index 6275db10..05c98beb 100644 --- a/old_projects/eoc/chapter5.py +++ b/old_projects/eoc/chapter5.py @@ -75,12 +75,12 @@ class LastVideo(TeacherStudentsScene): self.get_teacher().change_mode, "raise_right_hand", ) self.play(Write(known_formulas)) - self.dither() + self.wait() self.student_says( exp_question, student_index = 1, added_anims = [self.get_teacher().change_mode, "pondering"] ) - self.dither(3) + self.wait(3) e_to_x = exp_question.get_part_by_tex("e^x") self.play( self.teacher.change_mode, "raise_right_hand", @@ -88,7 +88,7 @@ class LastVideo(TeacherStudentsScene): e_to_x.highlight, YELLOW, e_to_x.next_to, self.teacher.get_corner(UP+LEFT), UP ) - self.dither(2) + self.wait(2) class PopulationSizeGraphVsPopulationMassGraph(Scene): def construct(self): @@ -137,7 +137,7 @@ class DoublingPopulation(PiCreatureScene): brace.text = text self.play(Write(f_x)) - self.dither() + self.wait() self.play( Transform(f_x, f_t), FadeIn( @@ -151,7 +151,7 @@ class DoublingPopulation(PiCreatureScene): GrowFromCenter(pop_brace), Write(pop_brace.text, run_time = 2) ) - self.dither(2) + self.wait(2) self.function = f_x self.pop_brace = pop_brace @@ -167,18 +167,18 @@ class DoublingPopulation(PiCreatureScene): self.reset() for x in range(num_start_days): self.let_one_day_pass() - self.dither() + self.wait() self.play( Transform(self.function, self.mass_function), Transform(self.pop_brace, self.mass_brace), Transform(self.pop_brace.text, self.mass_brace.text), ) - self.dither() + self.wait() for x in range(total_num_days-num_start_days): self.let_one_day_pass() - self.dither() + self.wait() self.joint_blink(shuffle = False) - self.dither() + self.wait() def count_through_days(self): self.reset() @@ -186,12 +186,12 @@ class DoublingPopulation(PiCreatureScene): days_to_let_pass = 3 self.play(GrowFromCenter(brace)) - self.dither() + self.wait() for x in range(days_to_let_pass): self.let_one_day_pass() new_brace = self.get_population_size_descriptor() self.play(Transform(brace, new_brace)) - self.dither() + self.wait() self.population_size_descriptor = brace @@ -206,10 +206,10 @@ class DoublingPopulation(PiCreatureScene): FadeOut(self.pop_brace.text), Write(dM_dt_question) ) - self.dither(3) + self.wait(3) for mob in dM, dt: self.play(Indicate(mob)) - self.dither() + self.wait() self.dM_dt_question = dM_dt_question @@ -248,7 +248,7 @@ class DoublingPopulation(PiCreatureScene): rect.stretch_to_fit_width(rect.get_width()+MED_SMALL_BUFF) self.play(DrawBorderThenFill(rect)) self.play(Write(frac)) - self.dither() + self.wait() return rect def relate_growth_rate_to_pop_size(self): @@ -305,15 +305,15 @@ class DoublingPopulation(PiCreatureScene): self.play(*map(FadeIn, [ false_deriv, false_deriv.brace, false_deriv.brace_text ])) - self.dither() + self.wait() self.play( Transform(time, new_time), FadeOut(fading_creatures) ) - self.dither() + self.wait() for x in range(3): self.let_one_day_pass(run_time = 2) - self.dither(2) + self.wait(2) for expression in difference_eq, real_deriv: expression.brace_text[1].highlight(GREEN) @@ -322,11 +322,11 @@ class DoublingPopulation(PiCreatureScene): Transform(false_deriv.brace, expression.brace), Transform(false_deriv.brace_text, expression.brace_text), ) - self.dither(3) + self.wait(3) self.reset() for x in range(self.get_num_days()): self.let_one_day_pass() - self.dither() + self.wait() rect = Rectangle(color = YELLOW) rect.replace(real_deriv) @@ -346,7 +346,7 @@ class DoublingPopulation(PiCreatureScene): for pi in self.get_pi_creatures() for a in [0.5*random.random()] ]) - self.dither(3) + self.wait(3) ########### @@ -503,15 +503,15 @@ class GraphOfTwoToT(GraphScene): #Draw graph and revert to tangent self.play(ShowCreation(graph)) self.play(Write(graph_label)) - self.dither() + self.wait() self.play(Write(ss_group)) - self.dither() + self.wait() for target_dx in 0.01, 1, 0.01: self.animate_secant_slope_group_change( ss_group, target_dx = target_dx ) - self.dither() + self.wait() #Mark up with values @@ -520,7 +520,7 @@ class GraphOfTwoToT(GraphScene): GrowFromCenter(brace), Write(height_label, run_time = 1) ) - self.dither() + self.wait() self.play( FadeIn( slope_label, @@ -532,7 +532,7 @@ class GraphOfTwoToT(GraphScene): slope_label.get_part_by_tex("2^") ) ) - self.dither() + self.wait() #Vary value threes = VGroup(height_label[1], slope_label[2][1]) @@ -618,7 +618,7 @@ class SimpleGraphOfTwoToT(GraphOfTwoToT): self.play(ShowCreation(graph, run_time = 2)) for pair in line_pairs: self.play(ShowCreation(pair)) - self.dither() + self.wait() class FakeDiagram(TeacherStudentsScene): def construct(self): @@ -680,7 +680,7 @@ class FakeDiagram(TeacherStudentsScene): DrawBorderThenFill(foreground_graph), Write(two_to_t) ) - self.dither() + self.wait() self.play( ReplacementTransform( foreground_graph.copy(), @@ -693,7 +693,7 @@ class FakeDiagram(TeacherStudentsScene): ) self.play(GrowFromCenter(side_brace)) self.play(Write(deriv, run_time = 2)) - self.dither() + self.wait() self.play( ShowCreation(circle), @@ -705,7 +705,7 @@ class FakeDiagram(TeacherStudentsScene): ShowCreation(arrow), self.teacher.change_mode, "shruggie" ) - self.dither(3) + self.wait(3) self.play( FadeOut(diagram), *[ @@ -716,7 +716,7 @@ class FakeDiagram(TeacherStudentsScene): self.teacher_says( "More numerical \\\\ than visual..." ) - self.dither(2) + self.wait(2) self.diagram = diagram @@ -776,7 +776,7 @@ class AnalyzeExponentRatio(PiCreatureScene): Write(ratio), Write(lhs), self.pi_creature.change_mode, "raise_right_hand" ) - self.dither(2) + self.wait(2) self.play( two_to_t_plus_dt.next_to, exp_prop_brace, UP, self.pi_creature.change_mode, "pondering" @@ -789,7 +789,7 @@ class AnalyzeExponentRatio(PiCreatureScene): ), FadeIn(exp_prop_brace) ) - self.dither(2) + self.wait(2) #Talk about exponential property add_exp_rect, mult_rect = rects = [ @@ -815,20 +815,20 @@ class AnalyzeExponentRatio(PiCreatureScene): ]) self.play(ShowCreation(add_exp_rect)) - self.dither() + self.wait() self.play(ReplacementTransform( add_exp_rect.copy(), mult_rect )) - self.dither() + self.wait() self.change_mode("happy") self.play(Write(words[0], run_time = 2)) self.play(ShowCreation(arrows[0])) - self.dither() + self.wait() self.play( Transform(*words), Transform(*arrows), ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ words[0], arrows[0], add_exp_rect, mult_rect, two_to_t_plus_dt, exp_prop_brace, @@ -859,7 +859,7 @@ class AnalyzeExponentRatio(PiCreatureScene): shifter.next_to, ratio[7], UP, stretcher.stretch_in_place, 0.9, 0 ) - self.dither(2) + self.wait(2) #Ask about dt -> 0 brace = Brace(VGroup(extracted_two_to_t, ratio), DOWN) @@ -870,7 +870,7 @@ class AnalyzeExponentRatio(PiCreatureScene): self.play(GrowFromCenter(brace)) self.play(Write(dt_to_zero)) - self.dither(2) + self.wait(2) #Who cares randy = Randolph() @@ -886,7 +886,7 @@ class AnalyzeExponentRatio(PiCreatureScene): bubble_kwargs = {"direction" : LEFT}, target_mode = "angry", )) - self.dither(2) + self.wait(2) self.play( RemovePiCreatureBubble(randy), FadeOut(randy), @@ -897,7 +897,7 @@ class AnalyzeExponentRatio(PiCreatureScene): Transform(brace, alt_brace), dt_to_zero.next_to, alt_brace, DOWN ) - self.dither() + self.wait() #Highlight separation rects = [ @@ -911,10 +911,10 @@ class AnalyzeExponentRatio(PiCreatureScene): ] ] self.play(ShowCreation(rects[0])) - self.dither(2) + self.wait(2) self.play(ReplacementTransform(rects[0].copy(), rects[1])) self.change_mode("happy") - self.dither() + self.wait() self.play(*map(FadeOut, rects)) #Plug in specific values @@ -938,15 +938,15 @@ class AnalyzeExponentRatio(PiCreatureScene): rp.shift, constant.get_width()*RIGHT, constant.next_to, extracted_two_to_t[0], RIGHT, MED_LARGE_BUFF ) - self.dither() + self.wait() self.change_mode("confused") - self.dither() + self.wait() #Indicate distinction between dt group and t group again for mob in limit_term, extracted_two_to_t: self.play(FocusOn(mob)) self.play(Indicate(mob)) - self.dither() + self.wait() #hold_final_value derivative = VGroup( @@ -966,17 +966,17 @@ class AnalyzeExponentRatio(PiCreatureScene): func_def_rhs.set_fill, None, 1, ) lhs[0].submobjects[1] = func_def_rhs - self.dither() + self.wait() self.play( derivative.next_to, self.pi_creature, UP, derivative.to_edge, RIGHT, self.pi_creature.change_mode, "raise_right_hand" ) - self.dither(2) + self.wait(2) for mob in extracted_two_to_t, constant: self.play(Indicate(mob)) - self.dither() - self.dither(2) + self.wait() + self.wait(2) def try_specific_dt_values(self): expressions = [] @@ -1001,10 +1001,10 @@ class AnalyzeExponentRatio(PiCreatureScene): Write(curr_expression), self.pi_creature.change_mode, "pondering" ) - self.dither(2) + self.wait(2) for expression in expressions[1:]: self.play(Transform(curr_expression, expression)) - self.dither(2) + self.wait(2) return curr_expression[-1] class ExponentRatioWithThree(AnalyzeExponentRatio): @@ -1050,30 +1050,30 @@ class CompareTwoConstantToEightConstant(PiCreatureScene): why.next_to(self.pi_creature, UP, MED_LARGE_BUFF) self.add(eight_deriv) - self.dither() + self.wait() self.play(ReplacementTransform( eight_deriv.copy(), two_deriv )) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.play( Write(times_three), self.pi_creature.change_mode, "thinking" ) - self.dither(3) + self.wait(3) self.play( Animation(derivs), Write(why), self.pi_creature.change, "confused", derivs ) - self.dither() + self.wait() for deriv in derivs: for index in -5, -2: self.play(Indicate(deriv[index])) - self.dither() - self.dither(2) + self.wait() + self.wait(2) def get_derivative_expression(self, base): base_str = str(base) @@ -1116,9 +1116,9 @@ class AskAboutConstantOne(TeacherStudentsScene): "pondering", "raise_right_hand", "thinking", # look_at_arg = self.get_students()[1].bubble ) - self.dither(2) + self.wait(2) self.play(FadeOut(note[-1], run_time = 3)) - self.dither() + self.wait() self.teacher_says( "There is!\\\\", @@ -1126,7 +1126,7 @@ class AskAboutConstantOne(TeacherStudentsScene): target_mode = "hooray" ) self.change_student_modes(*["confused"]*3) - self.dither(3) + self.wait(3) class WhyPi(PiCreatureScene): def construct(self): @@ -1151,14 +1151,14 @@ class WhyPi(PiCreatureScene): why.next_to(self.pi_creature, UP, MED_LARGE_BUFF) self.add(ghost_circle, circle, diam, one) - self.dither() + self.wait() self.play(Transform(circle, circum, run_time = 2)) self.play( Write(pi), Write(why), self.pi_creature.change_mode, "confused", ) - self.dither(3) + self.wait(3) ####### @@ -1224,12 +1224,12 @@ class GraphOfExp(GraphScene): rate_func = squish_rate_func(smooth, 0.5, 1), ) ) - self.dither() + self.wait() self.play(*map(ShowCreation, ss_group)) self.play(Write(slope_labels[0])) self.play(ShowCreation(v_lines[0])) self.play(Write(height_labels[0])) - self.dither(2) + self.wait(2) self.animate_secant_slope_group_change( ss_group, target_x = target_input, @@ -1247,7 +1247,7 @@ class GraphOfExp(GraphScene): ] ] ) - self.dither(2) + self.wait(2) self.graph = graph self.ss_group = ss_group @@ -1262,7 +1262,7 @@ class Chapter4Wrapper(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither(3) + self.wait(3) class ApplyChainRule(TeacherStudentsScene): def construct(self): @@ -1288,7 +1288,7 @@ class ApplyChainRule(TeacherStudentsScene): target_mode = "raise_right_hand" ), ) - self.dither(2) + self.wait(2) self.play(*[ Transform( *deriv_equation.get_parts_by_tex( @@ -1302,13 +1302,13 @@ class ApplyChainRule(TeacherStudentsScene): Write(deriv_equation.get_part_by_tex("=")) ]) self.play(self.teacher.change_mode, "happy") - self.dither() + self.wait() self.play(ShowCreation(circle)) self.play(Transform( *deriv_equation.get_parts_by_tex("3").copy()[-1:-3:-1] )) self.play(FadeOut(circle)) - self.dither(3) + self.wait(3) class ChainRuleIntuition(ThreeLinesChainRule): CONFIG = { @@ -1394,14 +1394,14 @@ class ChainRuleIntuition(ThreeLinesChainRule): dt_brace, d3t_brace, dexp3t_brace = braces self.play(*map(FadeIn, [nudge_lines, braces])) - self.dither() + self.wait() for count in range(3): for dx in self.dx, 0: self.animate_x_change( self.example_x + dx, run_time = 2 ) - self.dither() + self.wait() class WhyNaturalLogOf2ShowsUp(TeacherStudentsScene): def construct(self): @@ -1420,9 +1420,9 @@ class WhyNaturalLogOf2ShowsUp(TeacherStudentsScene): ), self.teacher.change, "raise_right_hand" ) - self.dither() + self.wait() self.look_at(4*LEFT + UP) - self.dither(3) + self.wait(3) self.exp_c = exp_c @@ -1477,7 +1477,7 @@ class WhyNaturalLogOf2ShowsUp(TeacherStudentsScene): *["pondering"]*3, look_at_arg = log_words ) - self.dither(2) + self.wait(2) t_group.save_state() t_group.shift(UP) @@ -1490,10 +1490,10 @@ class WhyNaturalLogOf2ShowsUp(TeacherStudentsScene): ), self.teacher.change_mode, "speaking" ) - self.dither(2) + self.wait(2) self.play(FocusOn(self.exp_c)) self.play(Indicate(self.exp_c, scale_factor = 1.05)) - self.dither(2) + self.wait(2) self.play( equation.next_to, derivative_arrow, UP, @@ -1506,9 +1506,9 @@ class WhyNaturalLogOf2ShowsUp(TeacherStudentsScene): Write(derivative_symbol), Write(derivative) ) - self.dither(3) + self.wait(3) self.play(self.teacher.change_mode, "happy") - self.dither(2) + self.wait(2) student = self.get_students()[1] ln = derivative.get_part_by_tex("ln(2)").copy() @@ -1519,7 +1519,7 @@ class WhyNaturalLogOf2ShowsUp(TeacherStudentsScene): ) rhs.next_to(ln, RIGHT) self.play(Write(rhs)) - self.dither(2) + self.wait(2) ###### @@ -1597,16 +1597,16 @@ class CompareWaysToWriteExponentials(GraphScene): ) self.play(Write(cross, run_time = 2)) self.play(Write(e_to_ct, run_time = 2)) - self.dither(2) + self.wait(2) self.play(Write(equation)) - self.dither(2) + self.wait(2) for new_graph, new_equation in zip(graphs, equations)[1:]: self.play( Transform(graph, new_graph), Transform(equation, new_equation) ) - self.dither(2) - self.dither() + self.wait(2) + self.wait() class ManyExponentialForms(TeacherStudentsScene): def construct(self): @@ -1638,15 +1638,15 @@ class ManyExponentialForms(TeacherStudentsScene): rect = BackgroundRectangle(group) self.add(lhs, rhs_list[0]) - self.dither() + self.wait() for rhs in rhs_list[1:]: self.play(FadeIn( rhs, run_time = 2, submobject_mode = 'lagged_start' )) - self.dither(2) - self.dither() + self.wait(2) + self.wait() self.play( FadeIn(rect), exp.next_to, self.teacher, UP+LEFT, @@ -1665,7 +1665,7 @@ class ManyExponentialForms(TeacherStudentsScene): *["pondering"]*3, look_at_arg = exp ) - self.dither(3) + self.wait(3) class TooManySymbols(TeacherStudentsScene): def construct(self): @@ -1674,7 +1674,7 @@ class TooManySymbols(TeacherStudentsScene): target_mode = "pleading" ) self.play(self.teacher.change_mode, "guilty") - self.dither(3) + self.wait(3) class TemperatureOverTimeOfWarmWater(GraphScene): CONFIG = { @@ -1742,7 +1742,7 @@ class TemperatureOverTimeOfWarmWater(GraphScene): Write(delta_T_label), ) self.play(graph_growth, delta_T_group_update, run_time = 15) - self.dither(2) + self.wait(2) class TemperatureOverTimeOfWarmWaterWithSolution(TemperatureOverTimeOfWarmWater): CONFIG = { @@ -1802,13 +1802,13 @@ class InvestedMoney(Scene): self.add(equation) self.play(*anims, run_time = run_time) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.play(Write(solution, run_time = 2)) - self.dither() + self.wait() self.play(FadeOut(cash_pile)) self.play(*anims, run_time = run_time) - self.dither() + self.wait() class NaturalLog(Scene): def construct(self): @@ -1821,13 +1821,13 @@ class NaturalLog(Scene): run_time = 3, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play( expressions.set_fill, None, 1, run_time = 2, submobject_mode = "lagged_start" ) - self.dither() + self.wait() for i in 0, 2, 1: self.show_natural_loggedness(expressions[i]) @@ -1869,7 +1869,7 @@ class NaturalLog(Scene): run_time = 2 ) self.play(Write(ln), Write(log_equals)) - self.dither() + self.wait() self.play( ReplacementTransform( log_expression.copy(), @@ -1877,7 +1877,7 @@ class NaturalLog(Scene): run_time = 2, ) ) - self.dither(2) + self.wait(2) ln_a = expression[-1] self.play( @@ -1886,9 +1886,9 @@ class NaturalLog(Scene): ln_a.move_to, constant, LEFT, ln_a.highlight, BLUE ) - self.dither() + self.wait() self.play(*map(FadeOut, [log_expression, exp_expression])) - self.dither() + self.wait() def get_expression(self, base): expression = TexMobject( @@ -1942,7 +1942,7 @@ class NextVideo(TeacherStudentsScene): self.play(ReplacementTransform( this_tex[1].copy(), this_tex[3] )) - self.dither() + self.wait() self.play( Write(this_tex[4]), ReplacementTransform( @@ -1952,7 +1952,7 @@ class NextVideo(TeacherStudentsScene): remover = True ) ) - self.dither(2) + self.wait(2) self.play(this_tex.replace, this_video) self.play( brace.next_to, next_video, DOWN, @@ -1966,7 +1966,7 @@ class NextVideo(TeacherStudentsScene): *["pondering"]*3, look_at_arg = next_tex ) - self.dither(3) + self.wait(3) class ExpPatreonThanks(PatreonThanks): CONFIG = { diff --git a/old_projects/eoc/chapter6.py b/old_projects/eoc/chapter6.py index 2a483672..c9fe9e73 100644 --- a/old_projects/eoc/chapter6.py +++ b/old_projects/eoc/chapter6.py @@ -56,12 +56,12 @@ class ThisWasConfusing(TeacherStudentsScene): look_at_arg = words, added_anims = [Animation(self.get_teacher())] ) - self.dither() + self.wait() self.play( self.get_teacher().change_mode, "confused", self.get_teacher().look_at, words, ) - self.dither(3) + self.wait(3) class SlopeOfCircleExample(ZoomedScene): CONFIG = { @@ -114,7 +114,7 @@ class SlopeOfCircleExample(ZoomedScene): self.play(ShowCreation(circle, run_time = 2)) self.play(Write(equation)) - self.dither() + self.wait() self.circle = circle self.circle_equation = equation @@ -174,7 +174,7 @@ class SlopeOfCircleExample(ZoomedScene): rate_func = there_and_back, run_time = 5, )) - self.dither(2) + self.wait(2) #Move labels to equation movers = labels.copy() @@ -186,12 +186,12 @@ class SlopeOfCircleExample(ZoomedScene): ApplyMethod(m1.replace, m2) for m1, m2 in pairs ]) - self.dither() + self.wait() self.play(*map(FadeOut, [lines, labels, movers])) self.remove(full_group) self.add(dot) - self.dither() + self.wait() self.example_point_dot = dot @@ -216,9 +216,9 @@ class SlopeOfCircleExample(ZoomedScene): self.play(GrowFromCenter(line)) self.play(Write(word)) - self.dither() + self.wait() self.play(Write(coords)) - self.dither() + self.wait() self.tangent_line = line self.slope_word = word @@ -239,9 +239,9 @@ class SlopeOfCircleExample(ZoomedScene): self.play(ShowCreation(radial_line)) self.play(ShowCreation(perp_mark)) - self.dither() + self.wait() self.play(Indicate(perp_mark)) - self.dither() + self.wait() morty = Mortimer().flip().to_corner(DOWN+LEFT) self.play(FadeIn(morty)) @@ -250,11 +250,11 @@ class SlopeOfCircleExample(ZoomedScene): )) to_fade =self.get_mobjects_from_last_animation() self.play(Blink(morty)) - self.dither() + self.wait() self.play(*map(FadeOut, to_fade)) self.play(*map(FadeOut, [radial_line, perp_mark])) - self.dither() + self.wait() def show_dx_and_dy(self): dot = self.example_point_dot @@ -294,22 +294,22 @@ class SlopeOfCircleExample(ZoomedScene): self.little_rectangle.move_to(step_line.get_center()) self.little_rectangle.save_state() self.little_rectangle.scale_in_place(self.zoom_factor) - self.dither() + self.wait() self.play( self.little_rectangle.restore, dot.scale_in_place, 1./self.zoom_factor, run_time = 2 ) - self.dither() + self.wait() self.play(ShowCreation(step_line)) self.play(GrowFromCenter(brace)) self.play(Write(step_text)) - self.dither() + self.wait() for line in dy_line, dx_line: self.play(ShowCreation(line)) self.play(Write(line.label)) - self.dither() - self.dither() + self.wait() + self.wait() self.step_group = step_group self.dx_line = dx_line @@ -330,7 +330,7 @@ class SlopeOfCircleExample(ZoomedScene): self.play(Transform(slope_word, new_slope_word)) self.play(Write(dy_dx)) - self.dither() + self.wait() self.dy_dx = dy_dx @@ -356,21 +356,21 @@ class SlopeOfCircleExample(ZoomedScene): GrowFromCenter(brace), Write(brace_text) ) - self.dither() + self.wait() self.play(Indicate(x)) - self.dither() + self.wait() self.play(Indicate(y)) - self.dither() + self.wait() self.play(Transform(brace_text, alt_brace_text)) - self.dither() + self.wait() self.play( ShowCreation(new_circle, run_time = 2), Animation(brace_text) ) self.play(new_circle.set_stroke, None, 0) - self.dither() + self.wait() self.play(*map(FadeOut, [brace, brace_text])) - self.dither() + self.wait() def perform_implicit_derivative(self): equation = self.circle_equation @@ -428,7 +428,7 @@ class SlopeOfCircleExample(ZoomedScene): ] ) self.play(Write(dx, run_time = 1)) - self.dither() + self.wait() self.play(*[ ReplacementTransform( equation[1][i].copy(), @@ -445,16 +445,16 @@ class SlopeOfCircleExample(ZoomedScene): ) for i, j in (-3, -2), (-2, -1), (-1, -1) ]) - self.dither() + self.wait() #React self.play(morty.change_mode, "erm") self.play(Blink(morty)) self.play(Write(q_marks)) - self.dither() + self.wait() self.play(Indicate(dx), morty.look_at, dx) self.play(Indicate(dy), morty.look_at, dy) - self.dither() + self.wait() self.play( morty.change_mode, "shruggie", FadeOut(q_marks) @@ -499,7 +499,7 @@ class SlopeOfCircleExample(ZoomedScene): ] + [ morty.look_at, final_form ]) - self.dither(2) + self.wait(2) self.morty = morty self.neg_x_over_y = VGroup(*final_form[6:]) @@ -526,7 +526,7 @@ class SlopeOfCircleExample(ZoomedScene): morty.look_at, rect, run_time = 2, ) - self.dither() + self.wait() self.play(FocusOn(coords), morty.look_at, coords) self.play(Indicate(coords)) scale_factor = 1.4 @@ -543,7 +543,7 @@ class SlopeOfCircleExample(ZoomedScene): morty.look_at, frac, run_time = 2 ) - self.dither() + self.wait() self.play(Blink(morty)) class NameImplicitDifferentation(TeacherStudentsScene): @@ -571,7 +571,7 @@ class NameImplicitDifferentation(TeacherStudentsScene): look_at_arg = derivative, added_anims = [ReplacementTransform(equation.copy(), derivative)] ) - self.dither(2) + self.wait(2) self.teacher_says( "Don't worry...", added_anims = [ @@ -580,7 +580,7 @@ class NameImplicitDifferentation(TeacherStudentsScene): ] ) self.change_student_modes(*["happy"]*3) - self.dither(3) + self.wait(3) class Ladder(VMobject): CONFIG = { @@ -651,14 +651,14 @@ class RelatedRatesExample(ThreeDScene): self.play( ShowCreation(ladder, run_time = 2) ) - self.dither() + self.wait() self.play( DrawBorderThenFill(wall), MoveToTarget(ladder), run_time = 2 ) - self.dither() + self.wait() self.ladder = ladder @@ -666,7 +666,7 @@ class RelatedRatesExample(ThreeDScene): words = TextMobject("Related rates") words.to_corner(UP+RIGHT) self.play(Write(words)) - self.dither() + self.wait() self.related_rates_words = words @@ -686,11 +686,11 @@ class RelatedRatesExample(ThreeDScene): x_label.highlight(x_line.get_color()) self.play(Write(ladder_brace)) - self.dither() + self.wait() self.play(ShowCreation(y_line), Write(y_label)) - self.dither() + self.wait() self.play(ShowCreation(x_line), Write(x_label)) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [x_label, y_label])) self.ladder_brace = ladder_brace @@ -726,15 +726,15 @@ class RelatedRatesExample(ThreeDScene): self.play(ShowCreation(down_arrow)) self.play(Write(speed_label)) self.let_ladder_fall(ladder, *added_anims) - self.dither() + self.wait() self.reset_ladder(ladder, *added_anims) self.play(ShowCreation(left_arrow)) self.play(Write(q_marks)) - self.dither() + self.wait() self.let_ladder_fall(ladder, *added_anims) - self.dither() + self.wait() self.reset_ladder(ladder, *added_anims) - self.dither() + self.wait() self.dy_arrow = down_arrow self.dy_label = speed_label @@ -748,7 +748,7 @@ class RelatedRatesExample(ThreeDScene): self.play(FadeIn(randy)) self.play(Blink(randy)) - self.dither() + self.wait() self.play( randy.change_mode, "confused", randy.look_at, self.ladder.get_top() @@ -756,7 +756,7 @@ class RelatedRatesExample(ThreeDScene): self.play(randy.look_at, self.ladder.get_bottom()) self.play(randy.look_at, self.ladder.get_top()) self.play(Blink(randy)) - self.dither() + self.wait() self.play(PiCreatureSays( randy, "Give names" )) @@ -778,7 +778,7 @@ class RelatedRatesExample(ThreeDScene): equation.to_edge(RIGHT, buff = LARGE_BUFF) self.play(Write(y_label)) - self.dither() + self.wait() self.let_ladder_fall( self.ladder, y_label.shift, self.start_y*DOWN/2, @@ -788,20 +788,20 @@ class RelatedRatesExample(ThreeDScene): ) self.play(FocusOn(x_label)) self.play(Write(x_label)) - self.dither(2) + self.wait(2) self.play( ReplacementTransform(x_label.copy(), equation[0]), ReplacementTransform(y_label.copy(), equation[3]), Write(VGroup(*np.array(equation)[[1, 2, 4, 5, 6]])) ) - self.dither(2) + self.wait(2) self.let_ladder_fall( self.ladder, *self.get_added_anims_for_ladder_fall(), rate_func = there_and_back, run_time = 6 ) - self.dither() + self.wait() self.equation = equation @@ -844,7 +844,7 @@ class RelatedRatesExample(ThreeDScene): ] ) self.play(Blink(randy)) - self.dither() + self.wait() self.play( Write(find_dx_dt), randy.change_mode, "pondering", @@ -858,7 +858,7 @@ class RelatedRatesExample(ThreeDScene): self.play(*map(FadeOut, [ randy, find_dx_dt, alt_equation ])) - self.dither() + self.wait() def discuss_lhs_as_function(self): equation = self.equation @@ -892,14 +892,14 @@ class RelatedRatesExample(ThreeDScene): GrowFromCenter(brace), Write(function_of_time) ) - self.dither() + self.wait() self.play(Write(constant_words)) self.let_ladder_fall( self.ladder, *self.get_added_anims_for_ladder_fall(), run_time = 6, rate_func = lambda t : 0.5*there_and_back(t) ) - self.dither() + self.wait() self.play(*map(FadeOut, [ brace, constant_words, function_of_time ])) @@ -907,7 +907,7 @@ class RelatedRatesExample(ThreeDScene): ReplacementTransform(lhs.copy(), derivative_interior), Write(derivative_scaffold), ) - self.dither() + self.wait() self.derivative = VGroup( derivative_scaffold, derivative_interior @@ -967,9 +967,9 @@ class RelatedRatesExample(ThreeDScene): Write(label), run_time = 1 ) - self.dither() + self.wait() self.play(Indicate(self.derivative[1])) - self.dither() + self.wait() self.dy_group = VGroup(dy_line, dy_brace, dy_label) self.dx_group = VGroup(dx_line, dx_brace, dx_label) @@ -983,10 +983,10 @@ class RelatedRatesExample(ThreeDScene): rhs = self.equation[-1] self.play(Write(equals_zero)) - self.dither() + self.wait() self.play(FocusOn(rhs)) self.play(Indicate(rhs)) - self.dither() + self.wait() self.reset_ladder( self.ladder, *self.get_added_anims_for_ladder_fall()+[ @@ -996,7 +996,7 @@ class RelatedRatesExample(ThreeDScene): rate_func = there_and_back, run_time = 3 ) - self.dither() + self.wait() self.equals_zero = equals_zero @@ -1035,7 +1035,7 @@ class RelatedRatesExample(ThreeDScene): perform_replacement(pairs[:2]) self.play(Write(lhs_derivative[2])) - self.dither() + self.wait() self.play(Indicate( VGroup( *list(lhs_derivative[:2])+\ @@ -1044,17 +1044,17 @@ class RelatedRatesExample(ThreeDScene): run_time = 2 )) self.play(Indicate(VGroup(*lhs_derivative[2][3:]))) - self.dither(2) + self.wait(2) perform_replacement(pairs[2:]) self.play(Write(lhs_derivative[6])) - self.dither() + self.wait() self.play(FocusOn(self.equals_zero)) self.play(ReplacementTransform( self.equals_zero.copy(), equals_zero_copy )) - self.dither(2) + self.wait(2) lhs_derivative.add(equals_zero_copy) self.lhs_derivative = lhs_derivative @@ -1077,9 +1077,9 @@ class RelatedRatesExample(ThreeDScene): self.remove(self.shadow_ladder) self.play(FadeIn(arrow_group)) self.let_ladder_fall(*ladder_fall_args) - self.dither() + self.wait() self.reset_ladder(*ladder_fall_args) - self.dither() + self.wait() def replace_terms_in_final_form(self): x_label, y_label = self.x_and_y_labels @@ -1113,8 +1113,8 @@ class RelatedRatesExample(ThreeDScene): self.play(FadeOut(x_label), FadeIn(num_x_label)) for indices in [(0, 1), (6,), (2, 7)]: fill_in_equation_part(*indices) - self.dither() - self.dither() + self.wait() + self.wait() self.new_lhs_derivative = new_lhs_derivative @@ -1136,9 +1136,9 @@ class RelatedRatesExample(ThreeDScene): box.scale_in_place(1.5) self.play(Write(solution)) - self.dither() + self.wait() self.play(ShowCreation(box)) - self.dither() + self.wait() ######### @@ -1298,7 +1298,7 @@ class CompareLadderAndCircle(PiCreatureScene, ThreeDScene): self.pi_creature.look_at, circle_mobs, Write(circle_mobs, run_time = 2) ) - self.dither(2) + self.wait(2) self.play( circle_mobs.to_edge, RIGHT, ladder_mobs.to_edge, LEFT, @@ -1321,7 +1321,7 @@ class CompareLadderAndCircle(PiCreatureScene, ThreeDScene): self.pi_creature.change_mode, "plain", self.pi_creature.look_at, equation ) - self.dither() + self.wait() self.play(*[ ReplacementTransform( equation[i].copy(), derivative[j], @@ -1336,7 +1336,7 @@ class CompareLadderAndCircle(PiCreatureScene, ThreeDScene): self.pi_creature.change_mode, "pondering", self.pi_creature.look_at, derivative ) - self.dither() + self.wait() self.equation = equation self.derivative = derivative @@ -1363,13 +1363,13 @@ class CompareLadderAndCircle(PiCreatureScene, ThreeDScene): derivative.save_state() self.play(Transform(equation, time_equation)) - self.dither() + self.wait() self.play(Transform(derivative, time_derivative)) - self.dither() + self.wait() self.play(GrowFromCenter(brace)) self.play(Write(brace_text)) self.change_mode("hooray") - self.dither(2) + self.wait(2) self.play( equation.restore, derivative.restore, @@ -1377,7 +1377,7 @@ class CompareLadderAndCircle(PiCreatureScene, ThreeDScene): FadeOut(brace_text), self.pi_creature.change_mode, "confused" ) - self.dither() + self.wait() def comment_on_circle_derivative(self): derivative = self.derivative @@ -1394,13 +1394,13 @@ class CompareLadderAndCircle(PiCreatureScene, ThreeDScene): GrowFromCenter(brace), Write(text) ) - self.dither() + self.wait() self.play( self.pi_creature.change_mode, "pondering", self.pi_creature.look, DOWN+LEFT ) - self.dither(2) + self.wait(2) ####### @@ -1455,13 +1455,13 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): self.play(Write(equation)) self.play(GrowFromCenter(brace)) self.play(Write(s)) - self.dither() + self.wait() self.play( FadeIn(s_rect), s.restore, GrowFromCenter(xy) ) - self.dither() + self.wait() self.equation = equation self.s_expression = s_expression @@ -1491,7 +1491,7 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): ) self.play(ShowCreation(circle), Animation(dot)) self.play(Write(equals_25)) - self.dither() + self.wait() self.example_point_dot = dot self.example_point_label = VGroup( @@ -1514,7 +1514,7 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): self.example_point_dot.move_to, point, Transform(self.example_point_label, point_label) ) - self.dither(2) + self.wait(2) def take_derivative_symbolically(self): equation = self.equation @@ -1547,7 +1547,7 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): ) for i, j in enumerate([2, 1, 4, 6, 5]) ]) - self.dither(2) + self.wait(2) self.derivative = derivative @@ -1584,7 +1584,7 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): lil_rect.scale_to_fit_height(SPACE_HEIGHT - MED_LARGE_BUFF) lil_rect.move_to(s_label, UP) lil_rect.shift(MED_SMALL_BUFF*UP) - self.dither() + self.wait() self.play( FadeOut(rhs), dot.scale, 1./self.zoom_factor, point, @@ -1592,11 +1592,11 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): lil_rect.restore, run_time = 2 ) - self.dither() + self.wait() for line in dx_line, dy_line: self.play(ShowCreation(line)) self.play(Write(line.label, run_time = 1)) - self.dither() + self.wait() new_dot = Dot(color = dot.get_color()) new_s_label = self.get_s_expression( @@ -1619,12 +1619,12 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): self.play(ShowCreation(new_dot)) self.play(Write(new_s_label)) - self.dither() + self.wait() ds = self.derivative[1][0] self.play(FocusOn(ds)) self.play(Indicate(ds)) - self.dither() + self.wait() self.tiny_step_group = VGroup( dx_line, dx_line.label, @@ -1656,13 +1656,13 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): self.play(FadeIn(deriv_example[0])) add_example_parts(0) - self.dither() + self.wait() add_example_parts(1, 2, 4, 5, 6) - self.dither(2) + self.wait(2) add_example_parts(3) - self.dither() + self.wait() add_example_parts(7) - self.dither() + self.wait() #React randy = Randolph() @@ -1676,7 +1676,7 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): ) self.play(Blink(randy)) self.play(randy.look_at, deriv_example.get_right()) - self.dither() + self.wait() self.play( Indicate(self.equation), randy.look_at, self.equation @@ -1686,16 +1686,16 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): randy.change_mode, "thinking", randy.look_at, self.big_rectangle ) - self.dither(2) + self.wait(2) self.play(PiCreatureSays( randy, "Approximately", target_mode = "sassy" )) - self.dither() + self.wait() self.play(RemovePiCreatureBubble(randy)) self.play(randy.look_at, deriv_example) self.play(FadeOut(deriv_example)) - self.dither() + self.wait() self.randy = randy @@ -1713,7 +1713,7 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): randy.change_mode, "confused", randy.look_at, equals_zero ) - self.dither() + self.wait() self.play(Blink(randy)) self.play( randy.change_mode, "plain", @@ -1723,7 +1723,7 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): FadeOut(self.tiny_step_group), self.little_rectangle.move_to, dot, ) - self.dither() + self.wait() self.equals_zero = equals_zero @@ -1778,13 +1778,13 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): randy.look_at, self.big_rectangle ) self.play(Blink(randy)) - self.dither() + self.wait() self.play(Write(s_label)) self.play(ShowCreation(arrow1)) - self.dither() + self.wait() self.play(ReplacementTransform(arrow1.copy(), arrow2)) - self.dither(2) + self.wait(2) def point_out_equalling_zero(self): derivative = self.derivative @@ -1799,7 +1799,7 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): self.play(Blink(randy)) self.play(randy.change_mode, "happy") self.play(randy.look_at, self.big_rectangle) - self.dither(2) + self.wait(2) def show_tangent_line(self): randy = self.randy @@ -1817,13 +1817,13 @@ class TwoVariableFunctionAndDerivative(SlopeOfCircleExample): GrowFromCenter(line), randy.look_at, line ) - self.dither(2) + self.wait(2) self.play( self.little_rectangle.scale_in_place, self.zoom_factor/2, run_time = 4, rate_func = there_and_back ) - self.dither(2) + self.wait(2) ############ @@ -1846,16 +1846,16 @@ class TryOtherExamples(TeacherStudentsScene): """Nothing special about $x^2 + y^2 = 25$""" ) - self.dither() + self.wait() self.play(RemovePiCreatureBubble( self.get_teacher(), target_mode = "raise_right_hand" )) self.play(Write(formula, run_time = 1)) self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) self.play(formula.to_corner, UP+LEFT) - self.dither() + self.wait() class AlternateExample(ZoomedScene): CONFIG = { @@ -1891,7 +1891,7 @@ class AlternateExample(ZoomedScene): self.add(formula) self.play(Write(plane, run_time = 2), Animation(formula)) - self.dither() + self.wait() self.plane = plane self.formula = formula @@ -1923,7 +1923,7 @@ class AlternateExample(ZoomedScene): ), Animation(self.formula) ) - self.dither() + self.wait() self.graphs = graphs @@ -1962,7 +1962,7 @@ class AlternateExample(ZoomedScene): UpdateFromFunc(label, update_label), run_time = 3, ) - self.dither() + self.wait() self.play(*[ ApplyMethod( label[1][i].copy().move_to, self.formula[1][j], @@ -1972,14 +1972,14 @@ class AlternateExample(ZoomedScene): for count, (i, j) in enumerate([(1, 4), (1, 9), (3, 6)]) ]) movers = self.get_mobjects_from_last_animation() - self.dither() + self.wait() self.play( UpdateFromAlphaFunc(dot, update_dot), UpdateFromFunc(label, update_label), run_time = 3, rate_func = lambda t : 1-smooth(t) ) - self.dither() + self.wait() self.play(*[ ApplyMethod(mover.set_fill, None, 0, remover = True) for mover in movers @@ -1995,7 +1995,7 @@ class AlternateExample(ZoomedScene): self.activate_zooming() self.little_rectangle.scale(self.zoom_factor) self.little_rectangle.move_to(dot) - self.dither() + self.wait() for mob in VGroup(dot, label), self.little_rectangle: self.play( ApplyMethod( @@ -2004,7 +2004,7 @@ class AlternateExample(ZoomedScene): run_time = 1, ) ) - self.dither() + self.wait() def show_tiny_step(self): dot = self.dot @@ -2034,7 +2034,7 @@ class AlternateExample(ZoomedScene): for line in dx_line, dy_line: self.play(ShowCreation(line), Animation(arrow)) self.play(Write(line.label, run_time = 1)) - self.dither() + self.wait() self.step_group = VGroup( arrow, dx_line, dx_line.label, dy_line, dy_line.label @@ -2061,7 +2061,7 @@ class AlternateExample(ZoomedScene): Write(word), ShowCreation(arrows) ) - self.dither() + self.wait() self.play(*map(FadeOut, [word, arrows])) def differentiate_lhs(self): @@ -2106,7 +2106,7 @@ class AlternateExample(ZoomedScene): self.play(GrowFromCenter(brace)) self.play(Write(mnemonic)) - self.dither() + self.wait() pairs = [ (sine_rect, derivative_rects[0]), (sine_x, derivative[0]), @@ -2121,10 +2121,10 @@ class AlternateExample(ZoomedScene): ReplacementTransform(m1.copy(), m2, path_arc = np.pi/2) for m1, m2 in pairs_subset ]) - self.dither() + self.wait() self.play(Indicate(pairs_subset[-1][1])) - self.dither() - self.dither() + self.wait() + self.wait() self.play(FadeOut(mnemonic)) self.lhs_derivative = VGroup(*derivative_rects+[derivative]) @@ -2151,7 +2151,7 @@ class AlternateExample(ZoomedScene): self.play(ReplacementTransform(lhs_brace, circle)) self.play(ShowCreation(arrow)) self.play(Write(equals_dx)) - self.dither() + self.wait() self.play(*map(FadeOut, [circle, arrow])) self.equals_dx = equals_dx @@ -2184,14 +2184,14 @@ class AlternateExample(ZoomedScene): lil_rect.shift, lil_rect.get_height()*DOWN/3, run_time = 2 ) - self.dither(2) + self.wait(2) def emphasize_equality(self): self.play(FocusOn(self.lhs)) - self.dither() + self.wait() for mob in self.lhs, self.rhs: self.play(Indicate(mob)) - self.dither() + self.wait() def manipulate_to_find_dy_dx(self): full_derivative = VGroup( @@ -2208,7 +2208,7 @@ class AlternateExample(ZoomedScene): self.play(GrowFromCenter(brace)) self.play(Write(words)) - self.dither() + self.wait() randy = Randolph() randy.to_corner(DOWN+LEFT) @@ -2217,10 +2217,10 @@ class AlternateExample(ZoomedScene): self.play(FadeIn(randy)) self.play(randy.change_mode, "confused") self.play(Blink(randy)) - self.dither(2) + self.wait(2) self.play(randy.change_mode, "pondering") self.play(Blink(randy)) - self.dither() + self.wait() class AskAboutNaturalLog(TeacherStudentsScene): def construct(self): @@ -2244,7 +2244,7 @@ class AskAboutNaturalLog(TeacherStudentsScene): target_mode = "raise_right_hand" )) self.play(Write(exp_deriv)) - self.dither() + self.wait() self.play( Write(log_deriv), exp_deriv.next_to, log_deriv, UP, LARGE_BUFF, @@ -2253,7 +2253,7 @@ class AskAboutNaturalLog(TeacherStudentsScene): for pi in self.get_pi_creatures() ] ) - self.dither(3) + self.wait(3) class DerivativeOfNaturalLog(ZoomedScene): CONFIG = { @@ -2298,7 +2298,7 @@ class DerivativeOfNaturalLog(ZoomedScene): self.add(formula) self.play(ShowCreation(graph)) - self.dither() + self.wait() self.formula = formula self.graph = graph @@ -2335,7 +2335,7 @@ class DerivativeOfNaturalLog(ZoomedScene): UpdateFromFunc(label, update_label), run_time = 3, ) - self.dither() + self.wait() xy_start = VGroup(label[1][1], label[1][3]).copy() xy_end = VGroup(formula[1][5], formula[1][0]).copy() xy_end.highlight(self.example_color) @@ -2343,7 +2343,7 @@ class DerivativeOfNaturalLog(ZoomedScene): xy_start, xy_end, run_time = 2, )) - self.dither() + self.wait() self.play( UpdateFromAlphaFunc(dot, update_dot), UpdateFromFunc(label, update_label), @@ -2392,7 +2392,7 @@ class DerivativeOfNaturalLog(ZoomedScene): self.play(ShowCreation(VGroup(dy_line, dx_line))) for part in equation: self.play(Write(part, run_time = 2)) - self.dither() + self.wait() self.dx_line, self.dy_line = dx_line, dy_line self.slope_equation = equation @@ -2422,10 +2422,10 @@ class DerivativeOfNaturalLog(ZoomedScene): Animation(VGroup(e, new_y, new_eq)), ReplacementTransform(x.copy(), new_x) ) - self.dither(2) + self.wait(2) for mob in e, new_y, new_x: self.play(Indicate(mob)) - self.dither() + self.wait() self.new_formula = new_formula @@ -2452,7 +2452,7 @@ class DerivativeOfNaturalLog(ZoomedScene): self.play(FadeIn(derivative[0]), Animation(derivative[1])) self.remove(derivative, pairs[0][1]) self.add(derivative) - self.dither() + self.wait() self.derivative = derivative @@ -2481,16 +2481,16 @@ class DerivativeOfNaturalLog(ZoomedScene): self.play(lil_rect.scale_in_place, 1./self.zoom_factor) self.play(Write(dx_line.label)) self.play(Write(dy_line.label)) - self.dither() + self.wait() def note_derivatives(self): e, y, dy, eq, dx = self.derivative[1] self.play(FocusOn(e)) self.play(Indicate(VGroup(e, y, dy))) - self.dither() + self.wait() self.play(Indicate(dx)) - self.dither() + self.wait() def solve_for_dy_dx(self): e, y, dy, eq, dx = self.derivative[1] @@ -2523,7 +2523,7 @@ class DerivativeOfNaturalLog(ZoomedScene): (e.copy(), one_over) ] ]) - self.dither() + self.wait() #Change denominator e, y, eq, x = self.new_formula @@ -2538,7 +2538,7 @@ class DerivativeOfNaturalLog(ZoomedScene): x_copy.highlight, YELLOW ) self.play(x_copy.next_to, one_over, DOWN, MED_SMALL_BUFF) - self.dither(2) + self.wait(2) equals_one_over_x = VGroup( new_eq, one_over, x_copy @@ -2552,7 +2552,7 @@ class DerivativeOfNaturalLog(ZoomedScene): self.slope_equation, RIGHT, 0, run_time = 2 ) - self.dither() + self.wait() def show_slope_above_x(self): line = self.tangent_line @@ -2578,15 +2578,15 @@ class DerivativeOfNaturalLog(ZoomedScene): rate_func = there_and_back, run_time = 6 )) - self.dither() + self.wait() self.play(ShowCreation(graph, run_time = 3)) - self.dither() + self.wait() self.play(UpdateFromAlphaFunc( line, update_line, rate_func = there_and_back, run_time = 6 )) - self.dither() + self.wait() class FinalWords(TeacherStudentsScene): def construct(self): @@ -2610,7 +2610,7 @@ class FinalWords(TeacherStudentsScene): Write(formula, run_time = 2), ) self.change_student_modes("pondering", "confused", "thinking") - self.dither(3) + self.wait(3) ##Show series series = VideoSeries() @@ -2638,7 +2638,7 @@ class FinalWords(TeacherStudentsScene): for pi in self.get_pi_creatures() ]) ) - self.dither(3) + self.wait(3) class Chapter6PatreonThanks(PatreonThanks): CONFIG = { diff --git a/old_projects/eoc/chapter7.py b/old_projects/eoc/chapter7.py index ecb7960d..b10df5f5 100644 --- a/old_projects/eoc/chapter7.py +++ b/old_projects/eoc/chapter7.py @@ -101,9 +101,9 @@ class ThisVideo(TeacherStudentsScene): self.get_teacher().look_at, this_video ) self.play(Write(this_tex)) - self.dither(2) + self.wait(2) self.play(self.get_teacher().change_mode, "sassy") - self.dither(2) + self.wait(2) class LimitJustMeansApproach(PiCreatureScene): CONFIG = { @@ -143,8 +143,8 @@ class LimitJustMeansApproach(PiCreatureScene): GrowFromCenter(brace), Write(question) ) - self.dither(0.5) - self.dither(2) + self.wait(0.5) + self.wait(2) def create_pi_creature(self): self.pi_creature = Mortimer().flip() @@ -195,10 +195,10 @@ class Goals(Scene): curr_goal = goals[0] self.play(FadeIn(curr_goal)) - self.dither(2) + self.wait(2) for goal in goals[1:]: self.play(Transform(curr_goal, goal)) - self.dither(2) + self.wait(2) class RefreshOnDerivativeDefinition(GraphScene): CONFIG = { @@ -253,7 +253,7 @@ class RefreshOnDerivativeDefinition(GraphScene): self.play(ShowCreation(graph)) self.play(Write(graph_label, run_time = 1)) self.play(Write(derivative)) - self.dither() + self.wait() input_copy = input_x.copy() self.play( input_copy.next_to, @@ -261,24 +261,24 @@ class RefreshOnDerivativeDefinition(GraphScene): DOWN ) self.play(ShowCreation(start_x_v_line)) - self.dither() + self.wait() #ss_group_development self.play( ShowCreation(ss_group.dx_line), ShowCreation(ss_group.dx_label), ) - self.dither() + self.wait() self.play(ShowCreation(ss_group.df_line)) self.play(Write(ss_group.df_label)) - self.dither(2) + self.wait(2) self.play( ReplacementTransform(ss_group.dx_label.copy(), dx), ReplacementTransform(ss_group.df_label.copy(), df), run_time = 2 ) self.play(ShowCreation(ss_group.secant_line)) - self.dither() + self.wait() #Let dx approach 0 self.play( @@ -290,7 +290,7 @@ class RefreshOnDerivativeDefinition(GraphScene): target_dx = 0.01, run_time = 5, ) - self.dither() + self.wait() #Write out fuller limit new_deriv = TexMobject( @@ -322,7 +322,7 @@ class RefreshOnDerivativeDefinition(GraphScene): run_time = 2 ) self.play(ShowCreation(nudged_x_v_line)) - self.dither() + self.wait() self.play(*[ ReplacementTransform(*pair, run_time = 2) for pair in deriv_to_new_deriv.items() @@ -331,7 +331,7 @@ class RefreshOnDerivativeDefinition(GraphScene): dx_to_0.next_to, new_brace, DOWN ]) self.play(Write(VGroup(*uncovered_new_deriv_parts), run_time = 2)) - self.dither() + self.wait() #Introduce limit notation lim = TexMobject("\\lim").scale(1.3) @@ -353,7 +353,7 @@ class RefreshOnDerivativeDefinition(GraphScene): lim.highlight, color, submobject_mode = "lagged_start" ) - self.dither(2) + self.wait(2) self.animate_secant_slope_group_change( ss_group, target_dx = 0.01, run_time = 5, @@ -361,7 +361,7 @@ class RefreshOnDerivativeDefinition(GraphScene): Transform(nudged_x_v_line, start_x_v_line, run_time = 5) ] ) - self.dither(2) + self.wait(2) #Record attributes for DiscussLowercaseDs below digest_locals(self) @@ -376,9 +376,9 @@ class RantOpenAndClose(Scene): for start in "$<$", "$<$/" ] self.play(FadeIn(opening)) - self.dither(2) + self.wait(2) self.play(Transform(opening, closing)) - self.dither(2) + self.wait(2) class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedScene): CONFIG = { @@ -427,7 +427,7 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS path_arc = np.pi/2, ) self.blink() - self.dither() + self.wait() for tex in "\\Delta x", "h": dx_list_replacement = [ TexMobject( @@ -442,7 +442,7 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS ), self.pi_creature.change_mode, "raise_right_hand" ) - self.dither() + self.wait() self.play( mover.scale, 0.9, mover.move_to, mover.initial_right, RIGHT, @@ -451,7 +451,7 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS self.play( self.dx_to_0.next_to, self.lim, DOWN, SMALL_BUFF, ) - self.dither() + self.wait() def compare_rhs_and_lhs(self): self.derivative.restore() @@ -518,36 +518,36 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS ] ) self.change_mode("thinking") - self.dither(2) + self.wait(2) self.play( ShowCreation(lhs_rect), FadeOut(d_circles), FadeOut(d_words), ) - self.dither(2) + self.wait(2) self.play( ReplacementTransform(lhs_rect, rhs_rect), self.pi_creature.change_mode, "raise_right_hand" ) - self.dither(2) + self.wait(2) self.play(ReplacementTransform( df.copy(), df_target, path_arc = -np.pi/2, run_time = 2 )) - self.dither(2) + self.wait(2) self.play(Indicate( VGroup(*rhs[:2]), run_time = 2 )) - self.dither() + self.wait() self.play(Write(formal_definition_words)) self.play( self.pi_creature.change_mode, "happy", self.pi_creature.look_at, formal_definition_words ) - self.dither(2) + self.wait(2) lhs.add_background_rectangle() self.add(rhs_rect, rhs) @@ -564,7 +564,7 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS self.pi_creature.change_mode, "sassy", self.pi_creature.look_at, 4*UP ) - self.dither() + self.wait() words = TextMobject("No ``infinitely small''") @@ -590,26 +590,26 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS moving_dx = dx_group[0] self.play(Write(words), ShowCreation(arrow)) - self.dither(2) + self.wait(2) self.play( moving_h.next_to, self.pi_creature.get_corner(UP+RIGHT), UP, self.pi_creature.change_mode, "raise_left_hand", ) - self.dither() + self.wait() moving_dx.move_to(moving_h) h_group.save_state() self.play(Transform( h_group, dx_group, path_arc = np.pi, )) - self.dither(2) + self.wait(2) self.play(h_group.restore, path_arc = np.pi) self.play( moving_h.move_to, moving_h.original_center, self.pi_creature.change_mode, "plain" ) - self.dither() + self.wait() #Zoom in self.activate_zooming() @@ -617,14 +617,14 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS lil_rect.move_to(self.ss_group) lil_rect.scale_in_place(3) lil_rect.save_state() - self.dither() + self.wait() self.add(self.rhs) self.play( lil_rect.scale_to_fit_width, self.ss_group.dx_line.get_width()*4, run_time = 4 ) - self.dither() + self.wait() dx = self.ss_group.dx_label dx.save_state() h = TexMobject("h") @@ -632,12 +632,12 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS h.replace(dx, dim_to_match = 1) self.play(Transform(dx, h, path_arc = np.pi)) self.play(Indicate(dx)) - self.dither() + self.wait() self.play(dx.restore, path_arc = np.pi) self.play(lil_rect.restore, run_time = 4) - self.dither() + self.wait() self.disactivate_zooming() - self.dither() + self.wait() #Last approaching reference for target_dx in 3, 0.01, -2, 0.01: @@ -645,7 +645,7 @@ class DiscussLowercaseDs(RefreshOnDerivativeDefinition, PiCreatureScene, ZoomedS self.ss_group, target_dx = target_dx, run_time = 4, ) - self.dither() + self.wait() class OtherViewsOfDx(TeacherStudentsScene): def construct(self): @@ -699,7 +699,7 @@ class OtherViewsOfDx(TeacherStudentsScene): submobject_mode = "lagged_start", lag_factor = 1.5, )) - self.dither() + self.wait() #Teacher answer self.teacher_says( @@ -711,7 +711,7 @@ class OtherViewsOfDx(TeacherStudentsScene): statements[1].dx.copy(), dx_group, run_time = 2, )) - self.dither() + self.wait() #First alternate view moving_dx = dx_group.copy() @@ -732,7 +732,7 @@ class OtherViewsOfDx(TeacherStudentsScene): RemovePiCreatureBubble(self.get_teacher()), ) self.play(self.get_teacher().change_mode, "erm") - self.dither() + self.wait() #Next alternate view bubble_intro = PiCreatureBubbleIntroduction( @@ -761,7 +761,7 @@ class OtherViewsOfDx(TeacherStudentsScene): for pi in self.get_students()[1:] ]) ) - self.dither(3) + self.wait(3) class GoalsListed(Scene): def construct(self): @@ -779,13 +779,13 @@ class GoalsListed(Scene): for goal in goals: self.play(FadeIn(goal)) - self.dither() + self.wait() for i, goal in enumerate(goals): anims = [goal.highlight, YELLOW] if i > 0: anims += [goals[i-1].highlight, WHITE] self.play(*anims) - self.dither() + self.wait() class GraphLimitExpression(GraphScene): CONFIG = { @@ -866,27 +866,27 @@ class GraphLimitExpression(GraphScene): else: anims.append(Transform(graph, new_graph)) self.play(*anims) - self.dither() - self.dither() + self.wait() + self.wait() self.play( MoveToTarget(expression), FadeIn(limit, submobject_mode = "lagged_start"), GrowFromCenter(brace) ) self.play(Write(derivative)) - self.dither(2) + self.wait(2) self.play( expression.restore, *map(FadeOut, [derivative, brace, limit]) ) - self.dither() + self.wait() colored_graph = graph.copy().highlight(YELLOW) self.play(ShowCreation(colored_graph)) - self.dither() + self.wait() self.play(ShowCreation(graph)) self.remove(colored_graph) - self.dither() + self.wait() self.expression = expression self.limit = limit @@ -924,18 +924,18 @@ class GraphLimitExpression(GraphScene): self.play(Write(h_equals_0, run_time = 2)) self.play(*map(ShowCreation, [arrow, dot])) - self.dither() + self.wait() self.play(ReplacementTransform( expression.copy(), new_expression )) - self.dither() + self.wait() self.play(Write(rhs)) - self.dither() + self.wait() self.play( GrowFromCenter(ud_brace), Write(undefined) ) - self.dither(2) + self.wait(2) self.point_to_zero_group = VGroup( h_equals_0, arrow, dot @@ -959,7 +959,7 @@ class GraphLimitExpression(GraphScene): colored_circle.set_fill(opacity = 0) self.play(GrowFromCenter(circle)) - self.dither() + self.wait() self.play(ShowCreation(colored_circle)) self.play(ShowCreation( circle.copy().set_fill(opacity = 0), @@ -971,7 +971,7 @@ class GraphLimitExpression(GraphScene): run_time = 2, rate_func = wiggle ) - self.dither() + self.wait() self.limit_point_hole = circle @@ -1008,7 +1008,7 @@ class GraphLimitExpression(GraphScene): ReplacementTransform(dot, ed_group.input_range), ) self.add(h_zero_hole) - self.dither() + self.wait() self.play( ReplacementTransform( ed_group.input_range.copy(), @@ -1025,7 +1025,7 @@ class GraphLimitExpression(GraphScene): ShowCreation(v_line), ShowCreation(h_line) ) - self.dither() + self.wait() self.play( v_line.move_to, self.coords_to_point(0, 0), DOWN, h_line.move_to, self.coords_to_point(0, self.func(0)), @@ -1034,7 +1034,7 @@ class GraphLimitExpression(GraphScene): self.play( VGroup(h_line, v_line).set_stroke, GREY, 2, ) - self.dither() + self.wait() #Write limit limit = self.limit @@ -1045,9 +1045,9 @@ class GraphLimitExpression(GraphScene): limit_group = VGroup(limit, rhs) self.play(Write(limit_group)) - self.dither() + self.wait() self.play(twelve_copy.next_to, top_h_line, RIGHT) - self.dither() + self.wait() self.twelve_copy = twelve_copy self.rhs = rhs @@ -1076,7 +1076,7 @@ class GraphLimitExpression(GraphScene): self.remove(self.twelve_copy) self.play(randy.look, OUT) self.play(Blink(randy)) - self.dither() + self.wait() self.play(RemovePiCreatureBubble( randy, target_mode = "pondering", look_at_arg = self.limit_point_hole @@ -1097,7 +1097,7 @@ class GraphLimitExpression(GraphScene): FadeIn(self.input_range_brace_group) ) self.ed_group.epsilon_lines.restore() - self.dither() + self.wait() self.play( self.ed_group.delta_lines.restore, Animation(self.input_range_brace_group), @@ -1111,7 +1111,7 @@ class GraphLimitExpression(GraphScene): run_time = 2 ) ) - self.dither() + self.wait() self.play(*map(GrowFromCenter, self.ed_group.epsilon_lines)) self.play(*[ ApplyMethod( @@ -1123,7 +1123,7 @@ class GraphLimitExpression(GraphScene): ) for line in self.ed_group.epsilon_lines ]) - self.dither() + self.wait() holes = VGroup( self.ed_group.input_range.submobjects.pop(), @@ -1143,7 +1143,7 @@ class GraphLimitExpression(GraphScene): for hole in holes ] ) - self.dither() + self.wait() self.holes = holes @@ -1289,11 +1289,11 @@ class LimitCounterExample(GraphLimitExpression): ) self.play(ShowCreation(graph, run_time = 5)) - self.dither() + self.wait() self.play(ReplacementTransform( left_hole.copy().set_stroke(YELLOW), right_hole )) - self.dither() + self.wait() self.graph = graph self.graph_holes = VGroup(left_hole, right_hole) @@ -1324,7 +1324,7 @@ class LimitCounterExample(GraphLimitExpression): run_time = 3 )) self.play(lines.set_stroke, GREY, 3) - self.dither() + self.wait() self.ed_group = ed_group @@ -1342,11 +1342,11 @@ class LimitCounterExample(GraphLimitExpression): limit_group = VGroup(limit, words) self.play(Write(limit)) - self.dither() + self.wait() self.play(Write(words)) - self.dither() + self.wait() self.play(limit_group.to_corner, UP+LEFT) - self.dither() + self.wait() def show_epsilon_delta_intuition(self): ed_group = self.ed_group @@ -1355,7 +1355,7 @@ class LimitCounterExample(GraphLimitExpression): ed_group.epsilon_lines.restore, ) self.play(ShowCreation(ed_group.input_range)) - self.dither() + self.wait() self.play(ReplacementTransform( ed_group.input_range.copy(), ed_group.output_range, @@ -1363,7 +1363,7 @@ class LimitCounterExample(GraphLimitExpression): )) self.graph.remove(*self.graph_holes) self.remove(*self.graph_holes) - self.dither() + self.wait() self.animate_epsilon_delta_group_change( ed_group, target_delta = self.small_delta, run_time = 6 @@ -1376,7 +1376,7 @@ class LimitCounterExample(GraphLimitExpression): GrowFromCenter(brace), Write(brace_text) ) - self.dither() + self.wait() run_time_rate_func_pairs = [ (3, lambda t : 1 - there_and_back(t)), (1, lambda t : 1 - 0.2*there_and_back(3*t % 1)), @@ -1388,7 +1388,7 @@ class LimitCounterExample(GraphLimitExpression): run_time = run_time, rate_func = rate_func, ) - self.dither() + self.wait() ##### @@ -1433,7 +1433,7 @@ class PrefaceToEpsilonDeltaDefinition(TeacherStudentsScene): self.get_teacher().change_mode, "raise_right_hand", ) self.change_student_modes(*["confused"]*3) - self.dither() + self.wait() self.student_says( "Isn't that pretty \\\\ technical?", target_mode = "guilty", @@ -1444,14 +1444,14 @@ class PrefaceToEpsilonDeltaDefinition(TeacherStudentsScene): ] ) self.look_at(self.get_teacher().eyes, self.get_students()) - self.dither() + self.wait() self.teacher_says("", bubble_kwargs = {"stroke_width" : 0}) self.change_student_modes( *["pondering"]*3, look_at_arg = UP+LEFT, added_anims = [self.get_teacher().look_at, UP+LEFT] ) - self.dither(3) + self.wait(3) words = TextMobject( "It's a glimpse of\\\\", "real analysis" @@ -1462,7 +1462,7 @@ class PrefaceToEpsilonDeltaDefinition(TeacherStudentsScene): bubble_kwargs = {"height" : 3, "width" : 6} ) self.change_student_modes(*["happy"]*3) - self.dither(6) + self.wait(6) class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene): CONFIG = { @@ -1513,7 +1513,7 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene): self.play(ShowCreation(twelve_line)) self.play(Write(twelve_copy)) self.play(ReplacementTransform(twelve_copy, twelve)) - self.dither() + self.wait() self.play(*it.chain( [ @@ -1527,13 +1527,13 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene): Write(distance), ShowCreation(arrows) ) - self.dither() + self.wait() self.play(*map(FadeOut, [distance, arrows])) self.play(Transform( epsilon_group, small_epsilon_group, run_time = 2 )) - self.dither() + self.wait() self.epsilon_group = epsilon_group @@ -1551,7 +1551,7 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene): ) self.ed_group.delta = self.delta_list[1] self.ed_group.input_range.make_jagged() - self.dither() + self.wait() def zoom_in(self): self.ed_group.input_range.make_jagged() @@ -1561,15 +1561,15 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene): lil_rect.move_to(self.graph_origin) lil_rect.scale_in_place(self.zoom_factor) self.add(self.holes) - self.dither() + self.wait() self.play(lil_rect.scale_in_place, 1./self.zoom_factor) - self.dither() + self.wait() def introduce_delta(self): delta_group = self.get_delta_group(self.delta_list[1]) self.play(*map(GrowFromCenter, delta_group.braces)) self.play(*map(Write, delta_group.labels)) - self.dither() + self.wait() self.play( ReplacementTransform( self.ed_group.input_range.copy(), @@ -1582,7 +1582,7 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene): VGroup(self.ed_group.output_range, self.holes[1]), direction = RIGHT )) - self.dither(2) + self.wait(2) self.delta_group = delta_group @@ -1593,7 +1593,7 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene): self.epsilon_group, self.get_epsilon_group(new_epsilon) )) - self.dither() + self.wait() self.animate_epsilon_delta_group_change( self.ed_group, target_delta = new_delta, added_anims = [ @@ -1607,7 +1607,7 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene): ] ) self.ed_group.input_range.make_jagged() - self.dither(2) + self.wait(2) ## @@ -1701,7 +1701,7 @@ class EpsilonDeltaCounterExample(LimitCounterExample, EpsilonDeltaExample): )) self.play(*map(Write, epsilon_group.labels)) self.play(Write(rhs)) - self.dither() + self.wait() self.epsilon_group = epsilon_group @@ -1717,13 +1717,13 @@ class EpsilonDeltaCounterExample(LimitCounterExample, EpsilonDeltaExample): )) self.remove(self.graph_holes) self.play(*map(GrowFromCenter, ed_group.epsilon_lines)) - self.dither(2) + self.wait(2) self.animate_epsilon_delta_group_change( ed_group, target_delta = self.small_delta, run_time = 3 ) ed_group.delta = self.small_delta - self.dither() + self.wait() self.ed_group = ed_group @@ -1735,9 +1735,9 @@ class EpsilonDeltaCounterExample(LimitCounterExample, EpsilonDeltaExample): ] for vect in vects: self.play(self.epsilon_group.shift, vect) - self.dither() + self.wait() self.shake_ed_group() - self.dither() + self.wait() ## @@ -1778,7 +1778,7 @@ class TheoryHeavy(TeacherStudentsScene): target_mode = "angry", content_introduction_kwargs = {"run_time" : 2}, ) - self.dither() + self.wait() student = self.get_students()[1] Scene.play(self, Write(lhs), @@ -1816,12 +1816,12 @@ class TheoryHeavy(TeacherStudentsScene): np.linspace(0, 0.5, len(part_tex_pairs)) ) ]) - self.dither(2) + self.wait(2) self.play( Write(epsilon_delta), ShowCreation(arrow) ) - self.dither(3) + self.wait(3) derivative.add(epsilon_delta, arrow) self.student_says( "How do you \\\\ compute limits?", @@ -1832,7 +1832,7 @@ class TheoryHeavy(TeacherStudentsScene): ] ) self.play(self.get_teacher().change_mode, "happy") - self.dither(2) + self.wait(2) class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, ReconfigurableScene): CONFIG = { @@ -1906,12 +1906,12 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi run_time = 3, rate_func = None )) - self.dither(4) ## Overly oscillation + self.wait(4) ## Overly oscillation self.play(ShowCreation(colored_graph, run_time = 2)) - self.dither() + self.wait() self.play(ShowCreation(graph, run_time = 2)) self.remove(colored_graph) - self.dither() + self.wait() self.graph = graph self.func_label = func_label @@ -1968,21 +1968,21 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi func_1 ) ) - self.dither(2) + self.wait(2) self.play(Write(VGroup(*rhs[:-1]))) - self.dither() + self.wait() self.play(Write(rhs[-1])) - self.dither() + self.wait() self.play(GrowFromCenter(hole)) - self.dither() + self.wait() self.play(ShowCreation(alt_v_line)) self.play(GrowFromCenter(alt_hole)) - self.dither() + self.wait() alt_group = VGroup(alt_v_line, alt_hole) self.play(alt_group.set_stroke, GREY, 2) self.play(FocusOn(hole)) - self.dither() + self.wait() self.play(GrowFromCenter(ed_group.input_range)) self.play( @@ -1998,7 +1998,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi ed_group, target_delta = self.small_delta, run_time = 4 ) - self.dither() + self.wait() self.play( Write(lim), MoveToTarget(self.func_label), @@ -2006,12 +2006,12 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi morty.change_mode, "confused", morty.look_at, lim ) - self.dither(2) + self.wait(2) self.play( func_1_group.to_corner, UP+LEFT, *map(FadeOut, [morty, ed_group]) ) - self.dither() + self.wait() self.lim_group = VGroup(lim, self.func_label, equals_q) for part in self.lim_group: @@ -2035,9 +2035,9 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi self.func_label.copy(), label )) - self.dither() + self.wait() self.play(Write(rhs)) - self.dither() + self.wait() self.approx_group = approx_group @@ -2063,7 +2063,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi "width" : 4, }, ) - self.dither(2) + self.wait(2) self.play( RemovePiCreatureBubble( morty, target_mode = "raise_left_hand", @@ -2074,7 +2074,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi morty.get_corner(UP+LEFT), DOWN+LEFT, self.func_1_group.shift, MED_LARGE_BUFF*UP, ) - self.dither(2) + self.wait(2) self.play( morty.change_mode, "raise_right_hand", morty.look, UP+RIGHT, @@ -2083,7 +2083,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi self.lim_group.next_to, morty.get_corner(UP+RIGHT), RIGHT, ) - self.dither(2) + self.wait(2) self.play( FadeOut(self.func_1_group), self.lim_group.scale, self.tex_scale_value, @@ -2092,7 +2092,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi # self.lim_group.to_edge, LEFT, morty.change_mode, "plain" ) - self.dither() + self.wait() self.play(FadeOut(morty)) def show_graph_of_numerator_and_denominator(self): @@ -2128,12 +2128,12 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi Animation(self.lim_group) ) self.play(FadeIn(sine_label)) - self.dither() + self.wait() self.play(ShowCreation(parabola, run_time = 2)) self.play(FadeIn(parabola_label)) - self.dither() + self.wait() self.play(FadeIn(fader, run_time = 2)) - self.dither() + self.wait() self.play(FadeOut(fader)) self.sine_graph = sine_graph @@ -2148,9 +2148,9 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi lil_rect.move_to(self.coords_to_point( *self.zoomed_rect_center_coords )) - self.dither() + self.wait() self.play(lil_rect.scale_in_place, 1./self.zoom_factor) - self.dither() + self.wait() def talk_through_sizes_of_nudges(self): arrow_tip_length = 0.15/self.zoom_factor @@ -2200,18 +2200,18 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi #Show dx self.play(ShowCreation(dx_arrow)) self.play(Write(dx_label)) - self.dither() + self.wait() #Show d_sine bump point = VectorizedPoint(self.coords_to_point(1, 0)) self.play(ReplacementTransform(point, d_sine_arrow)) - self.dither() + self.wait() self.play(ReplacementTransform( VGroup(dx_label[1].copy()), d_sine_label, run_time = 2 )) - self.dither(2) + self.wait(2) self.play( d_sine_label.shift, d_sine_label.get_height()*UP ) @@ -2238,9 +2238,9 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi ) for t1, t2 in tex_pairs ]) - self.dither() + self.wait() self.play(FadeOut(d_sine_label)) - self.dither() + self.wait() #Substitute x = 1 self.substitute_x_equals_1(cos_dx, zoom_tex_scale_factor) @@ -2268,7 +2268,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi self.play(GrowFromCenter(brace)) self.play(Write(brace_text)) - self.dither(2) + self.wait(2) self.play( brace.scale_to_fit_width, cos.get_width(), brace.next_to, cos, UP, SMALL_BUFF/self.zoom_factor, @@ -2276,7 +2276,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi ) neg_one.next_to(brace, UP, SMALL_BUFF/self.zoom_factor) self.play(Write(neg_one)) - self.dither() + self.wait() self.play(FadeOut(cos)) neg = neg_one.get_part_by_tex("-").copy() self.play(neg.next_to, cos_dx[-2], LEFT, SMALL_BUFF/self.zoom_factor) @@ -2286,7 +2286,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi neg_pi_dx.next_to, d_sine_arrow, RIGHT, SMALL_BUFF/self.zoom_factor ) - self.dither() + self.wait() #Show d_parabola bump point = VectorizedPoint(self.coords_to_point(1, 0)) @@ -2296,7 +2296,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi d_parabola_label, run_time = 2 )) - self.dither(2) + self.wait(2) self.play( d_parabola_label.shift, d_parabola_label.get_height()*UP ) @@ -2318,9 +2318,9 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi ) for t1, t2 in tex_pairs ]) - self.dither() + self.wait() self.play(FadeOut(d_parabola_label)) - self.dither() + self.wait() #Substitute x = 1 self.substitute_x_equals_1(two_x_dx, zoom_tex_scale_factor) @@ -2343,17 +2343,17 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi dot_one.move_to(x, DOWN+LEFT) self.play(x.move_to, eq_x) - self.dither() + self.wait() self.play( ReplacementTransform(x.copy(), eq_x), Transform(x, one), Write(equals) ) - self.dither() + self.wait() self.play(Transform(x, dot_one)) - self.dither() + self.wait() self.play(*map(FadeOut, [eq_x, equals])) - self.dither() + self.wait() def show_final_ratio(self): lim, ratio, equals_q = self.lim_group @@ -2383,25 +2383,25 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi self.play(ApplyWave( mob, direction = UP+RIGHT, amplitude = 0.1 )) - self.dither() + self.wait() self.play(ReplacementTransform(equals_q, rhs)) - self.dither() + self.wait() #Cancel dx's self.play(*map(ShowCreation, circles), run_time = 2) - self.dither() + self.wait() self.play(dxs.fade, 0.75, FadeOut(circles)) - self.dither() + self.wait() #Shrink dx self.transition_to_alt_config( transformation_kwargs = {"run_time" : 2}, dx = self.dx/10 ) - self.dither() + self.wait() self.play(Transform(approx, equals)) self.play(Indicate(approx)) - self.dither() + self.wait() self.final_ratio = rhs @@ -2419,7 +2419,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi ]) self.play(GrowFromCenter(brace)) self.play(Write(height)) - self.dither(2) + self.wait(2) ## @@ -2474,9 +2474,9 @@ class DerivativeLimitReciprocity(Scene): self.play(FadeIn(lim, submobject_mode = "lagged_start")) self.play(ShowCreation(arrow)) self.play(FadeIn(deriv, submobject_mode = "lagged_start")) - self.dither() + self.wait() self.play(Rotate(arrow, np.pi, run_time = 2)) - self.dither() + self.wait() class GeneralLHoptial(LHopitalExample): CONFIG = { @@ -2523,14 +2523,14 @@ class GeneralLHoptial(LHopitalExample): self.play(ShowCreation(f_graph), Write(f_label)) self.play(ShowCreation(g_graph), Write(g_label)) - self.dither() + self.wait() self.play( Write(a_label), ShowCreation(a_arrow), ShowCreation(a_dot), ) - self.dither() + self.wait() self.play(*map(FadeOut, [a_label, a_arrow])) self.a_dot = a_dot @@ -2546,13 +2546,13 @@ class GeneralLHoptial(LHopitalExample): lil_rect.move_to(self.coords_to_point( *self.zoomed_rect_center_coords )) - self.dither() + self.wait() self.play( lil_rect.scale_in_place, 1./self.zoom_factor, self.a_dot.scale_in_place, 1./self.zoom_factor, run_time = 3, ) - self.dither() + self.wait() def show_limit_in_symbols(self): frac_a = self.get_frac("a", self.x_color) @@ -2581,9 +2581,9 @@ class GeneralLHoptial(LHopitalExample): Write(frac_a.over), run_time = 2 ) - self.dither() + self.wait() self.play(Write(equals_zero_over_zero)) - self.dither(2) + self.wait(2) self.play( ReplacementTransform( VGroup(*frac_a.get_parts_by_tex("a")), @@ -2598,7 +2598,7 @@ class GeneralLHoptial(LHopitalExample): self.play(ReplacementTransform( equals_zero_over_zero, equals_q )) - self.dither() + self.wait() self.remove(frac_a) self.add(frac_x) @@ -2653,15 +2653,15 @@ class GeneralLHoptial(LHopitalExample): self.play(ShowCreation(dx_arrow)) self.play(Write(dx_label)) self.play(Indicate(dx_label)) - self.dither(2) + self.wait(2) self.play(ShowCreation(df_arrow)) self.play(Write(df_label)) - self.dither() + self.wait() self.play(ShowCreation(dg_arrow)) self.play(Write(dg_label)) - self.dither() + self.wait() def show_derivative_ratio(self): q_marks = VGroup(*self.equals_q[1:]) @@ -2684,18 +2684,18 @@ class GeneralLHoptial(LHopitalExample): self.play(FadeOut(q_marks)) self.play(Write(deriv_ratio)) - self.dither(2) + self.wait(2) self.play(FadeIn(circles)) - self.dither() + self.wait() self.play(FadeOut(circles), dxs.fade, 0.75) - self.dither(2) + self.wait(2) self.transition_to_alt_config( transformation_kwargs = {"run_time" : 2}, dx = self.dx/10, ) - self.dither() + self.wait() def show_example(self): lhs = TexMobject( @@ -2724,24 +2724,24 @@ class GeneralLHoptial(LHopitalExample): name.to_edge(UP) self.play(Write(lhs)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(brace_text) ) - self.dither() + self.wait() self.play(Write(rhs[0]), ReplacementTransform( VGroup(*lhs[3:6]).copy(), VGroup(*rhs[1:4]) )) - self.dither() + self.wait() self.play(ReplacementTransform( VGroup(*lhs[6:8]).copy(), VGroup(*rhs[4:6]), )) - self.dither() + self.wait() self.play(Write(VGroup(*rhs[6:]))) - self.dither(2) + self.wait(2) ##Slide away example = VGroup(lhs, rhs, brace, brace_text) @@ -2751,7 +2751,7 @@ class GeneralLHoptial(LHopitalExample): path_arc = 7*np.pi/6, ) self.play(Write(name)) - self.dither(2) + self.wait(2) self.rule_name = name @@ -2787,7 +2787,7 @@ class GeneralLHoptial(LHopitalExample): Write(bernoulli_name), FadeIn(bernoulli_image) ) - self.dither() + self.wait() self.play( FadeIn(lhopital_image), bernoulli_image.next_to, arrow, DOWN, SMALL_BUFF, @@ -2849,12 +2849,12 @@ class CannotUseLHopital(TeacherStudentsScene): for pi in self.get_pi_creatures() ]) ) - self.dither() + self.wait() self.student_says( "Use L'Hôpital's rule!", target_mode = "hooray" ) - self.dither() + self.wait() answer = TexMobject( "\\text{That requires knowing }", "{d(e^x)", "\\over \\,", "dx}" @@ -2867,7 +2867,7 @@ class CannotUseLHopital(TeacherStudentsScene): target_mode = "hesitant" ) self.change_student_modes(*["confused"]*3) - self.dither(3) + self.wait(3) class NextVideo(TeacherStudentsScene): def construct(self): @@ -2895,7 +2895,7 @@ class NextVideo(TeacherStudentsScene): self.get_teacher().look_at, next_video ) self.play(Write(integral)) - self.dither(2) + self.wait(2) self.play(*[ ReplacementTransform( VGroup(*integral.get_parts_by_tex(p1)), @@ -2914,7 +2914,7 @@ class NextVideo(TeacherStudentsScene): for part in "-", "=", "over", "(x)" ]) self.change_student_modes(*["pondering"]*3) - self.dither(3) + self.wait(3) class Chapter7PatreonThanks(PatreonThanks): CONFIG = { diff --git a/old_projects/eoc/chapter8.py b/old_projects/eoc/chapter8.py index feeedcdd..00b75026 100644 --- a/old_projects/eoc/chapter8.py +++ b/old_projects/eoc/chapter8.py @@ -75,7 +75,7 @@ class Chapter8OpeningQuote(OpeningQuote, PiCreatureScene): author.next_to, self.pi_creature.get_corner(UP+LEFT), UP, self.pi_creature.change_mode, "raise_right_hand" ) - self.dither(3) + self.wait(3) self.play( author.restore, self.pi_creature.change_mode, "plain" @@ -85,12 +85,12 @@ class Chapter8OpeningQuote(OpeningQuote, PiCreatureScene): LEFT, MED_SMALL_BUFF, UP, self.pi_creature.change_mode, "thinking" ) - self.dither(2) + self.wait(2) self.play( Write(formula), self.pi_creature.change_mode, "confused" ) - self.dither() + self.wait() def get_formula(self): result = TexMobject( @@ -132,10 +132,10 @@ class ThisVideo(TeacherStudentsScene): ) self.play(Write(VGroup(integral, v_t, dt))) self.change_student_modes(*["erm"]*3) - self.dither() + self.wait() self.play(Write(VGroup(deriv, equals, v_T)), ) self.change_student_modes(*["confused"]*3) - self.dither(3) + self.wait(3) self.play( this_video.restore, next_video.shift, next_video.get_height()*DOWN/2, @@ -147,7 +147,7 @@ class ThisVideo(TeacherStudentsScene): for pi in self.pi_creatures ]) ) - self.dither(2) + self.wait(2) class InCarRestrictedView(ShowSpeedometer): CONFIG = { @@ -187,12 +187,12 @@ class InCarRestrictedView(ShowSpeedometer): self.play(Blink(car.randy)) self.play(car.randy.restore, Animation(car)) self.play(ShowCreation(window, run_time = 2)) - self.dither() + self.wait() #Show speedometer self.introduce_added_mobjects() self.play(ShowCreation(square)) - self.dither() + self.wait() #Travel self.play(FadeIn(time_label)) @@ -211,7 +211,7 @@ class InCarRestrictedView(ShowSpeedometer): time_label[1], eight, rate_func = squish_rate_func(smooth, 0, 0.5) )) - self.dither() + self.wait() #Ask about distance self.play(*map(ShowCreation, dots)) @@ -220,7 +220,7 @@ class InCarRestrictedView(ShowSpeedometer): GrowFromCenter(brace), Write(brace_text) ) - self.dither(2) + self.wait(2) class GraphDistanceVsTime(GraphCarTrajectory): CONFIG = { @@ -334,7 +334,7 @@ class PlotVelocity(GraphScene): ), run_time = 5 ) - self.dither() + self.wait() def draw_curve(self): graph, label = self.get_v_graph_and_label() @@ -342,7 +342,7 @@ class PlotVelocity(GraphScene): self.revert_to_original_skipping_status() self.play(ShowCreation(graph, run_time = 3)) self.play(Write(graph_label)) - self.dither() + self.wait() ## @@ -376,7 +376,7 @@ class Chapter2Wrapper(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither(3) + self.wait(3) class GivenDistanceWhatIsVelocity(GraphCarTrajectory): def construct(self): @@ -431,7 +431,7 @@ class AskAboutAntiderivative(PlotVelocity): Write(ds_dt, run_time = 2), ShowCreation(arrow) ) - self.dither() + self.wait() def write_antiderivative(self): randy = Randolph() @@ -452,7 +452,7 @@ class AskAboutAntiderivative(PlotVelocity): bubble_kwargs = {"height" : 3, "width" : 4}, )) self.play(Blink(randy)) - self.dither() + self.wait() class Antiderivative(PiCreatureScene): def construct(self): @@ -463,19 +463,19 @@ class Antiderivative(PiCreatureScene): group = VGroup(functions, arcs, derivative, antiderivative) self.add(functions, top_arc, derivative) - self.dither() + self.wait() self.play( ShowCreation(bottom_arc), Write(antiderivative), self.pi_creature.change_mode, "raise_right_hand" ) - self.dither(2) + self.wait(2) for pair in reversed(zip(functions, alt_functions)): self.play( Transform(*pair), self.pi_creature.change_mode, "pondering" ) - self.dither(2) + self.wait(2) self.pi_creature_says( "But first!", @@ -484,7 +484,7 @@ class Antiderivative(PiCreatureScene): added_anims = [group.to_edge, LEFT], run_time = 1, ) - self.dither() + self.wait() def get_functions(self, left_tex, right_tex): left = TexMobject(left_tex) @@ -552,7 +552,7 @@ class AreaUnderVGraph(PlotVelocity): run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() class ConstantVelocityCar(Scene): def construct(self): @@ -560,13 +560,13 @@ class ConstantVelocityCar(Scene): car.move_to(5*LEFT + 3*DOWN) self.add(car) - self.dither() + self.wait() self.play(MoveCar( car, 7*RIGHT+3*DOWN, run_time = 5, rate_func = None, )) - self.dither() + self.wait() class ConstantVelocityPlot(PlotVelocity): CONFIG = { @@ -590,7 +590,7 @@ class ConstantVelocityPlot(PlotVelocity): ) self.play(ShowCreation(graph, rate_func = None, run_time = 3)) - self.dither() + self.wait() self.graph = graph @@ -634,7 +634,7 @@ class ConstantVelocityPlot(PlotVelocity): Write(s_label), Animation(self.graph) ) - self.dither(2) + self.wait(2) self.area_rect = rect self.s_label = s_label @@ -667,9 +667,9 @@ class ConstantVelocityPlot(PlotVelocity): ShowCreation(bubble), Write(bubble.content), ) - self.dither() + self.wait() self.play(Blink(randy)) - self.dither() + self.wait() self.play( randy.change_mode, "pondering", FadeOut(bubble), @@ -727,7 +727,7 @@ class ConstantVelocityPlot(PlotVelocity): self.randy.look_at, self.area_rect ) self.play(Blink(self.randy)) - self.dither() + self.wait() class PiecewiseConstantCar(Scene): def construct(self): @@ -736,7 +736,7 @@ class PiecewiseConstantCar(Scene): car.move_to(start_point) self.add(car) - self.dither() + self.wait() for shift in 2, 6, 12: car.randy.rotate_in_place(np.pi/8) anim = MoveCar( @@ -748,7 +748,7 @@ class PiecewiseConstantCar(Scene): # for mob in anim.starting_mobject, anim.mobject: # mob.randy.rotate_in_place(np.pi/6) self.play(anim) - self.dither() + self.wait() class PiecewiseConstantPlot(PlotVelocity): CONFIG = { @@ -814,7 +814,7 @@ class PiecewiseConstantPlot(PlotVelocity): rate_func = there_and_back, run_time = 5 )) - self.dither() + self.wait() self.play(FadeOut(group)) def show_piecewise_constant_graph(self): @@ -837,9 +837,9 @@ class PiecewiseConstantPlot(PlotVelocity): self.play(*map(MoveToTarget, faders)) self.play(ShowCreation(pw_constant_graph, run_time = 2)) - self.dither() + self.wait() self.play(ShowCreation(line)) - self.dither() + self.wait() for new_line in alt_lines[1:]: for mob in line.end_dot, new_line.start_dot, new_line: self.play(Transform( @@ -848,7 +848,7 @@ class PiecewiseConstantPlot(PlotVelocity): )) self.remove(line) self.add(new_line) - self.dither(2) + self.wait(2) line = new_line self.play(FadeOut(line)) @@ -883,7 +883,7 @@ class PiecewiseConstantPlot(PlotVelocity): Write(brace.label, run_time = 1), ) brace.add(brace.label) - self.dither() + self.wait() self.play( ReplacementTransform( flat_rects, rects, @@ -893,7 +893,7 @@ class PiecewiseConstantPlot(PlotVelocity): Animation(right_brace) ) self.play(*map(FadeOut, [top_brace, right_brace])) - self.dither() + self.wait() self.rects = rects self.rect_list = rect_list @@ -909,7 +909,7 @@ class PiecewiseConstantPlot(PlotVelocity): ) for new_rects in self.rect_list[1:]: self.transform_between_riemann_rects(rects, new_rects) - self.dither() + self.wait() def revert_to_specific_approximation(self): rects = self.rects @@ -935,7 +935,7 @@ class PiecewiseConstantPlot(PlotVelocity): submobject_mode = "lagged_start" )) rects.restore() - self.dither() + self.wait() self.play( ShowCreation(ticks), FadeOut(self.x_axis.numbers) @@ -944,7 +944,7 @@ class PiecewiseConstantPlot(PlotVelocity): GrowFromCenter(brace), Write(dt_label) ) - self.dither() + self.wait() self.play( FadeIn( example_text, @@ -956,7 +956,7 @@ class PiecewiseConstantPlot(PlotVelocity): example_text.get_part_by_tex("dt") ) ) - self.dither() + self.wait() self.rects = rects = target_rects self.ticks = ticks @@ -1015,30 +1015,30 @@ class PiecewiseConstantPlot(PlotVelocity): rects.set_fill, None, 0.25, Animation(rect) ) - self.dither() + self.wait() for label in t_labels: self.play(FadeIn(label)) - self.dither() + self.wait() for v_line, h_line, label in zip(v_lines, h_lines, height_labels): self.play(ShowCreation(v_line)) self.play(ShowCreation(h_line)) self.play(Write(label, run_time = 1)) - self.dither() - self.dither() + self.wait() + self.wait() t_label_copy = t_labels[0].copy() self.play( t_label_copy.scale, 1./0.7, t_label_copy.next_to, self.v_graph_label, DOWN+LEFT, 0 ) - self.dither() + self.wait() self.play(FadeOut(t_label_copy)) - self.dither() + self.wait() self.play(ShowCreation(circle)) self.play(ShowCreation(rect_top)) self.play(FadeOut(circle)) rect.add(rect_top) - self.dither() + self.wait() for x in range(2): self.play( rect.stretch_to_fit_height, v_lines[1].get_height(), @@ -1056,7 +1056,7 @@ class PiecewiseConstantPlot(PlotVelocity): v_lines[0].highlight, RED, rate_func = there_and_back, ) - self.dither() + self.wait() area = TextMobject( "7$\\frac{\\text{m}}{\\text{s}}$", @@ -1077,7 +1077,7 @@ class PiecewiseConstantPlot(PlotVelocity): Write(area), ShowCreation(arrow) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ area, arrow, v_lines[0], h_lines[0], height_labels[0], @@ -1109,7 +1109,7 @@ class PiecewiseConstantPlot(PlotVelocity): Write(v_t) ] self.play(*anims) - self.dither() + self.wait() last_rect = rect last_brace = brace @@ -1135,16 +1135,16 @@ class PiecewiseConstantPlot(PlotVelocity): self.play(FadeOut(self.dt_example_text)) self.play(Write(integral.get_part_by_tex("int"))) - self.dither() + self.wait() self.play(Transform(int_copy, int_symbol)) self.play(Write(alt_sum_word), Animation(int_copy)) self.remove(int_copy) self.play(ReplacementTransform(alt_sum_word, sum_word)) - self.dither() + self.wait() for bound in bounds: self.play(Write(bound)) - self.dither() + self.wait() for bound, num in zip(bounds, [0, 8]): bound_copy = bound.copy() point = self.coords_to_point(num, 0) @@ -1153,7 +1153,7 @@ class PiecewiseConstantPlot(PlotVelocity): bound_copy.next_to, point, DOWN, MED_LARGE_BUFF ) self.play(ApplyWave(self.ticks, direction = UP)) - self.dither() + self.wait() for mob, tex in (self.v_t, "v(t)"), (self.dt_label, "dt"): self.play(ReplacementTransform( @@ -1161,7 +1161,7 @@ class PiecewiseConstantPlot(PlotVelocity): integral.get_part_by_tex(tex), run_time = 2 )) - self.dither() + self.wait() self.integral = integral self.sum_word = sum_word @@ -1190,7 +1190,7 @@ class PiecewiseConstantPlot(PlotVelocity): ), morty.look_at, int_dt ) - self.dither(2) + self.wait(2) self.play( ReplacementTransform(dt_copy.copy(), self.dt_label), morty.look_at, self.dt_label @@ -1209,7 +1209,7 @@ class PiecewiseConstantPlot(PlotVelocity): np.linspace(0, 0.8, len(self.ticks)) ) ]) - self.dither() + self.wait() #Shrink dt just a bit self.play( @@ -1237,7 +1237,7 @@ class PiecewiseConstantPlot(PlotVelocity): ), ) self.rects = rects = next_rects - self.dither() + self.wait() self.play(Blink(morty)) self.play(*[ ApplyFunction( @@ -1256,7 +1256,7 @@ class PiecewiseConstantPlot(PlotVelocity): ]+[ morty.change_mode, "thinking", ]) - self.dither() + self.wait() self.morty = morty @@ -1285,9 +1285,9 @@ class PiecewiseConstantPlot(PlotVelocity): target_mode = "sassy" )) self.play(Blink(morty)) - self.dither() + self.wait() self.play(Write(cross)) - self.dither() + self.wait() self.play( RemovePiCreatureBubble(morty, target_mode = "plain"), *map(FadeOut, [ @@ -1308,7 +1308,7 @@ class PiecewiseConstantPlot(PlotVelocity): ), morty.look_at, rects, ) - self.dither() + self.wait() self.play( Write(distance_words), @@ -1316,9 +1316,9 @@ class PiecewiseConstantPlot(PlotVelocity): morty.change_mode, "pondering", morty.look_at, distance_words, ) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() self.area_arrow = arrow @@ -1333,7 +1333,7 @@ class PiecewiseConstantPlot(PlotVelocity): self.play(Indicate(self.integral)) self.play(Write(words, run_time = 2)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.play(*[ ApplyFunction( lambda r : r.shift(0.2*UP).set_fill(None, 1), @@ -1353,7 +1353,7 @@ class PiecewiseConstantPlot(PlotVelocity): self.morty.change_mode, "happy", self.morty.look_at, self.rects, ]) - self.dither() + self.wait() ##### @@ -1388,7 +1388,7 @@ class DontKnowHowToHandleNonConstant(TeacherStudentsScene): ApplyMethod(pi.change, "maybe", UP) for pi in self.get_pi_creatures() ]) - self.dither(3) + self.wait(3) class CarJourneyApproximation(Scene): CONFIG = { @@ -1407,7 +1407,7 @@ class CarJourneyApproximation(Scene): self.add(h_line, *cars + words) - self.dither() + self.wait() self.play(*[ MoveCar( car, point+10*RIGHT, @@ -1419,7 +1419,7 @@ class CarJourneyApproximation(Scene): self.get_approximated_rate_func(self.n_jumps) ]) ]) - self.dither() + self.wait() def get_approximated_rate_func(self, n): new_v_rate_func = lambda t : v_rate_func(np.floor(t*n)/n) @@ -1444,7 +1444,7 @@ class TellMeThatsNotSurprising(TeacherStudentsScene): target_mode = "hooray", run_time = 1 ) - self.dither(3) + self.wait(3) class HowDoesThisHelp(TeacherStudentsScene): def construct(self): @@ -1456,14 +1456,14 @@ class HowDoesThisHelp(TeacherStudentsScene): self.change_student_modes( "confused", "angry", "confused", ) - self.dither(2) + self.wait(2) self.teacher_says( "You're right.", target_mode = "shruggie", run_time = 1 ) self.change_student_modes(*["sassy"]*3) - self.dither(2) + self.wait(2) class AreaUnderACurve(GraphScene): CONFIG = { @@ -1491,7 +1491,7 @@ class AreaUnderACurve(GraphScene): run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() def func(self, x): @@ -1549,7 +1549,7 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene): rate_func = there_and_back, run_time = 2 ) - self.dither() + self.wait() def write_integral(self): integral = TexMobject("\\int", "^T", "_0", "v(t)", "\\,dt") @@ -1576,7 +1576,7 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene): self.play(Write(integral)) self.play(ShowCreation(int_arrow)) self.foreground_mobjects.append(int_arrow) - self.dither() + self.wait() self.change_area_bounds( new_t_max = 8, rate_func = there_and_back, @@ -1591,13 +1591,13 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene): rate_func = there_and_back, run_time = 3 ) - self.dither() + self.wait() self.play(Write(distance_word, run_time = 2)) self.play( ReplacementTransform(int_arrow, s_arrow), FadeIn(s_T) ) - self.dither() + self.wait() self.play(FadeOut(distance_word)) self.change_area_bounds(new_t_max = 0, run_time = 2) self.change_area_bounds( @@ -1605,9 +1605,9 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene): rate_func = None, run_time = 7.9, ) - self.dither() + self.wait() self.change_area_bounds(new_t_max = 5) - self.dither() + self.wait() def nudge_input(self): dark_area = self.area.copy() @@ -1650,19 +1650,19 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene): FadeOut(self.T_label_group), FadeIn(dT_label_group) ) - self.dither() + self.wait() self.play(Write(ds_label)) self.play(ShowCreation(ds_arrow)) - self.dither(2) + self.wait(2) self.play(GrowFromCenter(v_brace)) self.play(ReplacementTransform( self.v_graph_label.get_part_by_tex("v").copy(), v_T_label, run_time = 2 )) - self.dither() + self.wait() self.play(Indicate(dT_label)) - self.dither() + self.wait() self.rect = rect self.dT_label_group = dT_label_group @@ -1682,7 +1682,7 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene): DrawBorderThenFill(self.rect), Animation(self.ds_arrow) ) - self.dither() + self.wait() self.play(*[ ReplacementTransform( mob, formula1.get_part_by_tex(tex), @@ -1695,12 +1695,12 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene): (self.dT_label_group[0].copy(), "dT"), ] ]) - self.dither() + self.wait() self.transition_to_alt_config( dT = self.dT/5.0, transformation_kwargs = {"run_time" : 2}, ) - self.dither() + self.wait() self.play(*[ ReplacementTransform( formula1.get_part_by_tex(tex), @@ -1710,7 +1710,7 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene): ] + [ Write(formula2.get_part_by_tex("over")) ]) - self.dither() + self.wait() #### @@ -1815,10 +1815,10 @@ class DirectInterpretationOfDsDt(TeacherStudentsScene): self.students[1].change_mode, "raise_right_hand" ) self.play(part.highlight, words.get_color()) - self.dither() + self.wait() self.play(Write(VGroup(equals, v))) self.change_student_modes(*["pondering"]*3) - self.dither(3) + self.wait(3) class FindAntiderivative(Antiderivative): def construct(self): @@ -1845,9 +1845,9 @@ class FindAntiderivative(Antiderivative): self.play(*map(ShowCreation, arcs)) for word in words: self.play(FadeIn(word, submobject_mode = "lagged_start")) - self.dither() + self.wait() self.change_mode("confused") - self.dither(2) + self.wait(2) self.play(*[ ReplacementTransform( rhs[i], expanded_rhs[j], @@ -1858,7 +1858,7 @@ class FindAntiderivative(Antiderivative): ]+[ self.pi_creature.change_mode, "hesitant" ]) - self.dither() + self.wait() self.q_marks = q_marks self.arcs = arcs @@ -1881,7 +1881,7 @@ class FindAntiderivative(Antiderivative): direction = UP, amplitude = SMALL_BUFF )) - self.dither(2) + self.wait(2) self.play( FadeOut(self.q_marks), FadeIn(t_squared), @@ -1896,13 +1896,13 @@ class FindAntiderivative(Antiderivative): for i in 0, 1 ]) self.change_mode("thinking") - self.dither() + self.wait() self.play(four.set_fill, YELLOW, 1) self.play(four.shift, DOWN) self.play(FadeOut(two_t)) self.play(self.v_part1.restore) self.play(four.highlight, DISTANCE_COLOR) - self.dither(2) + self.wait(2) self.s_part1 = four_t_squared @@ -1934,7 +1934,7 @@ class FindAntiderivative(Antiderivative): self.v_part2.shift, LEFT ) self.play(FadeIn(self.q_marks)) - self.dither() + self.wait() self.play( FadeOut(self.q_marks), @@ -1949,16 +1949,16 @@ class FindAntiderivative(Antiderivative): ) for i, j in (0, 1), (1, 0), (1, 2) ]) - self.dither() + self.wait() self.play(FadeIn(third)) self.play(FadeOut(three)) - self.dither(2) + self.wait(2) self.play(Write(neg)) self.play( FadeOut(t_squared), self.v_part2.shift, UP+LEFT ) - self.dither(2) + self.wait(2) self.s_part2 = neg_third_t_cubed @@ -1973,7 +1973,7 @@ class FindAntiderivative(Antiderivative): run_time = 2, ) self.change_mode("happy") - self.dither(2) + self.wait(2) def add_plus_C(self): s_group = VGroup(self.s_part1, self.s_part2) @@ -1987,15 +1987,15 @@ class FindAntiderivative(Antiderivative): plus_C = plus_Cs[0] self.change_mode("sassy") - self.dither() + self.wait() self.play( s_group.next_to, plus_C.copy(), LEFT, GrowFromCenter(plus_C), ) - self.dither() + self.wait() for new_plus_C in plus_Cs[1:]: self.play(Transform(plus_C, new_plus_C)) - self.dither() + self.wait() class GraphSPlusC(GraphDistanceVsTime): CONFIG = { @@ -2026,7 +2026,7 @@ class GraphSPlusC(GraphDistanceVsTime): self.play(ShowCreation(graph)) self.play(FadeIn(graph_label)) - self.dither() + self.wait() self.play( graph.shift, UP, run_time = 2, @@ -2046,7 +2046,7 @@ class GraphSPlusC(GraphDistanceVsTime): rate_func = there_and_back, run_time = 4, ) - self.dither() + self.wait() class LowerBound(AreaIsDerivative): CONFIG = { @@ -2082,7 +2082,7 @@ class LowerBound(AreaIsDerivative): zero_label.next_to, self.graph_origin, DOWN, MED_LARGE_BUFF, FadeOut(circle) ) - self.dither() + self.wait() self.zero_label = zero_label @@ -2107,7 +2107,7 @@ class LowerBound(AreaIsDerivative): self.zero_label.copy(), equals_zero )) self.play(Transform(self.integral, zero_integral)) - self.dither(2) + self.wait(2) for bound in zero_int_bounds: self.play(ShowCreation(bound.circle)) self.play(FadeOut(bound.circle)) @@ -2117,7 +2117,7 @@ class LowerBound(AreaIsDerivative): ) for bound in zero_int_bounds ]) - self.dither(2) + self.wait(2) self.change_area_bounds(0, 5) self.play( self.integral.restore, @@ -2156,23 +2156,23 @@ class LowerBound(AreaIsDerivative): Write(antideriv_text, run_time = 2) ) self.change_area_bounds(0, 5.5, rate_func = there_and_back) - self.dither() + self.wait() self.play( ReplacementTransform(at_T.copy(), at_zero), Write(minus) ) - self.dither() + self.wait() self.play( ReplacementTransform(at_T.brace, big_brace), ReplacementTransform(antideriv_text, cancel_text) ) self.change_area_bounds(0, 0, run_time = 4) - self.dither() + self.wait() self.play( ReplacementTransform(big_brace, at_zero.brace), ReplacementTransform(cancel_text, happens_to_be_zero), ) - self.dither(2) + self.wait(2) self.change_area_bounds(0, 8, run_time = 2) self.play( Transform(self.integral, integral_at_eight), @@ -2184,7 +2184,7 @@ class LowerBound(AreaIsDerivative): GrowFromCenter(at_eight.brace), Write(value_at_eight) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ at_eight.brace, value_at_eight, at_zero.brace, happens_to_be_zero, @@ -2217,10 +2217,10 @@ class LowerBound(AreaIsDerivative): Transform(self.integral, new_integral), Transform(self.antideriv_diff, new_antideriv_diff), ) - self.dither(3) + self.wait(3) for part in self.antideriv_diff[1::2]: self.play(Indicate(part, scale_factor = 1.1)) - self.dither() + self.wait() def add_constant_to_antiderivative(self): antideriv_diff = self.antideriv_diff @@ -2235,14 +2235,14 @@ class LowerBound(AreaIsDerivative): ) self.play(Write(plus_fives, run_time = 2)) - self.dither(2) + self.wait(2) self.play( group.arrange_submobjects, group.next_to, antideriv_diff, DOWN, MED_LARGE_BUFF ) - self.dither() + self.wait() self.play(FadeOut(group, run_time = 2)) - self.dither() + self.wait() ##### @@ -2371,7 +2371,7 @@ class FundamentalTheorem(GraphScene): map(GrowFromCenter, [f_brace, dx_brace]), map(Write, [f_brace.label, dx_brace.label]), )) - self.dither() + self.wait() for i in range(start_rect_index+1, last_rect_index): self.play( rects[i-1].set_fill, None, low_opacity, @@ -2384,7 +2384,7 @@ class FundamentalTheorem(GraphScene): for brace in f_brace, dx_brace ] ) - self.dither() + self.wait() self.play(*it.chain( map(FadeOut, [ f_brace, dx_brace, @@ -2411,7 +2411,7 @@ class FundamentalTheorem(GraphScene): rhs.next_to(self.integral, RIGHT) self.play(Write(deriv)) - self.dither(2) + self.wait(2) self.play(*it.chain( [ ReplacementTransform(deriv_F.copy(), part) @@ -2427,8 +2427,8 @@ class FundamentalTheorem(GraphScene): self.integral.get_part_by_tex(tex).copy(), rhs.get_part_by_tex(tex) )) - self.dither() - self.dither(2) + self.wait() + self.wait(2) self.deriv = deriv self.rhs = rhs @@ -2442,7 +2442,7 @@ class FundamentalTheorem(GraphScene): words.to_edge(RIGHT) self.play(Write(words, lag_factor = 3)) - self.dither() + self.wait() def show_integral_considering_continuum(self): self.play(*[ @@ -2454,7 +2454,7 @@ class FundamentalTheorem(GraphScene): run_time = 3, rate_func = there_and_back ) - self.dither() + self.wait() for x in range(2): self.play(*[ ApplyFunction( @@ -2471,7 +2471,7 @@ class FundamentalTheorem(GraphScene): np.linspace(0, 0.8, len(self.rects)) ) ]) - self.dither() + self.wait() def show_antiderivative_considering_bounds(self): self.play( @@ -2487,9 +2487,9 @@ class FundamentalTheorem(GraphScene): self.play(ShowCreation(line)) self.remove(new_line) self.play(label.restore) - self.dither() + self.wait() self.play(self.integral.set_fill, None, 1) - self.dither(3) + self.wait(3) class LetsRecap(TeacherStudentsScene): def construct(self): @@ -2498,7 +2498,7 @@ class LetsRecap(TeacherStudentsScene): target_mode = "hesitant", ) self.change_student_modes(*["happy"]*3) - self.dither(3) + self.wait(3) class NegativeArea(GraphScene): CONFIG = { @@ -2565,7 +2565,7 @@ class NegativeArea(GraphScene): Write(words, run_time = 2), ShowCreation(arrow) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [self.area, arrow])) self.negative_area_words = words @@ -2576,7 +2576,7 @@ class NegativeArea(GraphScene): color = RED ) self.play(ShowCreation(v_line)) - self.dither() + self.wait() self.v_line = v_line def show_car_going_backwards(self): @@ -2596,7 +2596,7 @@ class NegativeArea(GraphScene): moving_forward = False, run_time = 3 )) - self.dither() + self.wait() ghost_car = car.copy().fade() right_nose_line = self.get_car_nose_line(car) self.play(ShowCreation(right_nose_line)) @@ -2635,15 +2635,15 @@ class NegativeArea(GraphScene): GrowFromCenter(brace), Write(equation) ) - self.dither() + self.wait() self.play(FadeIn(negative)) self.play(ShowCreation(v_arrow)) - self.dither(2) + self.wait(2) self.play(ReplacementTransform( v_arrow.copy(), ds_arrow )) - self.dither(2) + self.wait(2) self.ds_equation = equation self.negative_word = negative @@ -2674,17 +2674,17 @@ class NegativeArea(GraphScene): Write(dt_label), Write(v_label), ) - self.dither(2) + self.wait(2) self.play(*it.chain( [FadeIn(r) for r in rects if r is not rect], map(FadeOut, [ dt_brace, v_brace, dt_label, v_label ]) )) - self.dither() + self.wait() for new_rects in rect_list[1:]: self.transform_between_riemann_rects(rects, new_rects) - self.dither() + self.wait() def write_signed_area(self): words = TextMobject("``Signed area''") @@ -2699,7 +2699,7 @@ class NegativeArea(GraphScene): ]) self.play(Write(words)) self.play(Write(symbols)) - self.dither() + self.wait() #### @@ -2723,7 +2723,7 @@ class NextVideo(TeacherStudentsScene): self.teacher.change_mode, "raise_right_hand" ) self.play(Write(integral)) - self.dither(5) + self.wait(5) class Chapter8PatreonThanks(PatreonThanks): CONFIG = { diff --git a/old_projects/eoc/chapter9.py b/old_projects/eoc/chapter9.py index 0228e83a..a8f860b6 100644 --- a/old_projects/eoc/chapter9.py +++ b/old_projects/eoc/chapter9.py @@ -85,8 +85,8 @@ class AverageOfContinuousVariable(GraphScene): v_line, graph, bound, run_time = 3, )) - self.dither() - self.dither() + self.wait() + self.wait() def get_v_line_change_anim(self, v_line, graph, target_x, **kwargs): start_x = self.x_axis.point_to_number(v_line.get_bottom()) @@ -115,7 +115,7 @@ class ThisVideo(TeacherStudentsScene): ] ) self.change_student_modes(*["pondering"]*3) - self.dither(3) + self.wait(3) class AverageOfSineStart(AverageOfContinuousVariable): CONFIG = { @@ -264,7 +264,7 @@ class LengthOfDayGraph(GraphScene): ), run_time = 3, ) - self.dither() + self.wait() self.graph = graph self.graph_label = graph_label @@ -347,7 +347,7 @@ class LengthOfDayGraph(GraphScene): FadeIn(rect), Write(words, run_time = 2) ) - self.dither() + self.wait() def mention_constants(self): #2.7\\sin(2\\pi t/365) + 12.4 @@ -368,7 +368,7 @@ class LengthOfDayGraph(GraphScene): np.linspace(0, 0.3, len(constants)) ) ]) - self.dither() + self.wait() ##### @@ -381,7 +381,7 @@ class AskAboutAverageOfContinuousVariables(TeacherStudentsScene): ) self.change_student_modes("confused", "sassy", "confused") self.play(self.teacher.change_mode, "happy") - self.dither(2) + self.wait(2) class AverageOfFiniteSet(Scene): CONFIG = { @@ -450,21 +450,21 @@ class AverageOfFiniteSet(Scene): submobject_mode = "lagged_start", run_time = 3 )) - self.dither() + self.wait() self.play( GrowFromCenter(brace), *map(MoveToTarget, [lines, labels, symbols]), run_time = 2 ) self.play(Write(sum_mob)) - self.dither() + self.wait() self.play(ShowCreation(dividing_lines, run_time = 2)) self.play(*it.chain( map(Write, averages), map(GrowFromCenter, lower_braces) )) self.play(ShowCreation(circle)) - self.dither(2) + self.wait(2) class TryToAddInfinitelyManyPoints(AverageOfSineStart): CONFIG = { @@ -520,7 +520,7 @@ class TryToAddInfinitelyManyPoints(AverageOfSineStart): run_time = 3, )) self.add(ghost_lines, v_lines) - self.dither(2) + self.wait(2) self.play( MoveToTarget( v_lines, @@ -531,7 +531,7 @@ class TryToAddInfinitelyManyPoints(AverageOfSineStart): ) self.play(ShowCreation(h_line)) self.play(Write(infinity)) - self.dither() + self.wait() def show_continuum(self): arrow = Arrow(ORIGIN, UP+LEFT) @@ -558,7 +558,7 @@ class TryToAddInfinitelyManyPoints(AverageOfSineStart): run_time = 3 ) self.play(FadeOut(arrow)) - self.dither() + self.wait() def mention_integral(self): randy = Randolph() @@ -580,7 +580,7 @@ class TryToAddInfinitelyManyPoints(AverageOfSineStart): randy.change_mode, "shruggie", ) self.play(Blink(randy)) - self.dither() + self.wait() class FiniteSample(TryToAddInfinitelyManyPoints): CONFIG = { @@ -617,7 +617,7 @@ class FiniteSample(TryToAddInfinitelyManyPoints): denominator.next_to(frac_line, DOWN) self.play(ShowCreation(v_lines, run_time = 3)) - self.dither() + self.wait() self.play( ReplacementTransform( v_lines.copy(), @@ -632,7 +632,7 @@ class FiniteSample(TryToAddInfinitelyManyPoints): ) self.play(Write(frac_line, run_time = 1)) self.play(Write(denominator)) - self.dither() + self.wait() self.plusses = plusses self.average = VGroup(numerator, frac_line, denominator) @@ -666,7 +666,7 @@ class FeelsRelatedToAnIntegral(TeacherStudentsScene): target_mode = "maybe" ) self.play(self.teacher.change_mode, "happy") - self.dither(2) + self.wait(2) class IntegralOfSine(FiniteSample): CONFIG = { @@ -704,7 +704,7 @@ class IntegralOfSine(FiniteSample): integral.to_edge(UP) self.play(Write(integral)) - self.dither(2) + self.wait(2) self.integral = integral @@ -747,7 +747,7 @@ class IntegralOfSine(FiniteSample): replace_mobject_with_target_in_scene = True, ) self.remove(self.v_lines) - self.dither() + self.wait() rects.save_state() self.play(*it.chain( @@ -762,7 +762,7 @@ class IntegralOfSine(FiniteSample): map(GrowFromCenter, [side_brace, bottom_brace]), map(Write, [sin_x, dx]), )) - self.dither() + self.wait() for i in range(start_index+1, end_index): self.play( rects[i-1].set_fill, None, low_opacity, @@ -773,7 +773,7 @@ class IntegralOfSine(FiniteSample): MaintainPositionRelativeTo(sin_x, side_brace), MaintainPositionRelativeTo(dx, bottom_brace), ) - self.dither() + self.wait() self.play( rects.restore, *map(FadeOut, [sin_x, dx, side_brace, bottom_brace]) @@ -789,7 +789,7 @@ class IntegralOfSine(FiniteSample): self.rects, self.thin_rects, run_time = 3 ) - self.dither(2) + self.wait(2) if restore: self.transform_between_riemann_rects( self.rects, start_state.copy(), @@ -802,7 +802,7 @@ class IntegralOfSine(FiniteSample): self.rects.set_fill, None, self.rect_opacity, ) - self.dither() + self.wait() def bring_back_average(self): num_samples = self.average[-1] @@ -824,21 +824,21 @@ class IntegralOfSine(FiniteSample): self.integral.to_edge, DOWN, run_time = 2 ) - self.dither() + self.wait() self.play( Write(self.dx_brace), Write(self.dx_label), ) - self.dither() + self.wait() self.play( FadeOut(self.dx_label), FadeIn(example_dx) ) self.play(Indicate(example_dx)) - self.dither() + self.wait() self.play(ShowCreation(input_range)) self.play(FadeOut(input_range)) - self.dither() + self.wait() #Ask how many there are num_samples_copy = num_samples.copy() @@ -860,7 +860,7 @@ class IntegralOfSine(FiniteSample): num_samples_copy.highlight, GREEN ]) self.play(FadeOut(v_lines)) - self.dither() + self.wait() #Count number of samples num_samples_copy.generate_target() @@ -884,7 +884,7 @@ class IntegralOfSine(FiniteSample): ), Write(rhs.get_part_by_tex("/")) ) - self.dither(2) + self.wait(2) #Substitute number of samples self.play(ReplacementTransform( @@ -894,7 +894,7 @@ class IntegralOfSine(FiniteSample): self.play(Transform( dx, TexMobject("dx").move_to(dx) )) - self.dither(2) + self.wait(2) approx = rhs.get_part_by_tex("approx") rhs.remove(approx) self.play( @@ -903,7 +903,7 @@ class IntegralOfSine(FiniteSample): FadeOut(approx), rhs.next_to, self.average[1], DOWN ) - self.dither() + self.wait() self.pi_over_dx = rhs @@ -927,7 +927,7 @@ class IntegralOfSine(FiniteSample): frac_line.shift, dx.get_width()*RIGHT/2, FadeOut(over) ) - self.dither(2) + self.wait(2) average = VGroup(parens, numerator, dx, frac_line, pi) integral.generate_target() @@ -947,7 +947,7 @@ class IntegralOfSine(FiniteSample): Write(over_pi), MoveToTarget(integral, run_time = 2) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [self.dx_label, self.dx_brace])) self.integral_over_pi = VGroup(integral, over_pi) @@ -971,7 +971,7 @@ class IntegralOfSine(FiniteSample): average_height.next_to(area_over_width, LEFT) self.play(*map(FadeIn, [average_height, area_over_width])) - self.dither() + self.wait() def show_moving_v_line(self): mean = np.mean(self.bounds) @@ -994,7 +994,7 @@ class Approx31(Scene): tex.scale_to_fit_width(2*SPACE_WIDTH - LARGE_BUFF) tex.to_edge(LEFT) self.play(Write(tex)) - self.dither(3) + self.wait(3) class LetsSolveThis(TeacherStudentsScene): def construct(self): @@ -1012,9 +1012,9 @@ class LetsSolveThis(TeacherStudentsScene): self.add(expression) self.teacher_says("Let's compute it.") - self.dither() + self.wait() self.student_thinks(question) - self.dither(2) + self.wait(2) class Antiderivative(AverageOfSineStart): CONFIG = { @@ -1087,8 +1087,8 @@ class Antiderivative(AverageOfSineStart): ), run_time = 2 ) - self.dither() - self.dither() + self.wait() + self.wait() self.play(*[ ReplacementTransform(*pair) for pair in [ @@ -1099,7 +1099,7 @@ class Antiderivative(AverageOfSineStart): (neg_sin.label, sin.label), ] ]) - self.dither(2) + self.wait(2) self.neg_cos = neg_cos self.sin = sin @@ -1136,7 +1136,7 @@ class Antiderivative(AverageOfSineStart): ApplyMethod(m.fade, 0.6) for m in faders ]) - self.dither() + self.wait() self.play(*map(ShowCreation, ss_group), run_time = 2) kwargs = { "run_time" : 20, @@ -1158,7 +1158,7 @@ class Antiderivative(AverageOfSineStart): self.play( *map(FadeOut, [ss_group, v_line, sin_copy]) ) - self.dither() + self.wait() self.ss_group = ss_group @@ -1195,7 +1195,7 @@ class Antiderivative(AverageOfSineStart): self.deriv.to_edge, LEFT, MED_SMALL_BUFF, self.deriv.shift, UP, ) - self.dither() + self.wait() self.play(FadeIn( VGroup(*filter( @@ -1205,14 +1205,14 @@ class Antiderivative(AverageOfSineStart): submobject_mode = "lagged_start", run_time = 2, )) - self.dither() + self.wait() for start, end in start_end_pairs: self.play(ReplacementTransform( start.copy(), end, path_arc = np.pi/6, run_time = 2 )) - self.dither() + self.wait() self.integral = integral self.rhs = rhs @@ -1245,7 +1245,7 @@ class Antiderivative(AverageOfSineStart): self.play(ReplacementTransform( cos_tex.copy(), pi_dot )) - self.dither() + self.wait() moving_dot = pi_dot.copy() self.play( ShowCreation(v_line), @@ -1258,9 +1258,9 @@ class Antiderivative(AverageOfSineStart): ReplacementTransform(moving_dot, zero_dot) ) self.play(GrowFromCenter(v_line_brace)) - self.dither(2) + self.wait(2) self.play(Write(two_height_label)) - self.dither(2) + self.wait(2) self.v_line = v_line self.h_line = h_line @@ -1283,9 +1283,9 @@ class Antiderivative(AverageOfSineStart): ) self.play(Write(rects)) - self.dither() + self.wait() self.play(area_two.move_to, rects) - self.dither(2) + self.wait(2) self.rects = rects self.area_two = area_two @@ -1342,7 +1342,7 @@ class Antiderivative(AverageOfSineStart): ) for tex in "\\pi", "-", "0" ]) - self.dither(2) + self.wait(2) full_equation = VGroup( integral, frac_lines, rhs, pi_minus_zeros @@ -1355,7 +1355,7 @@ class Antiderivative(AverageOfSineStart): (answer.get_width()+MED_LARGE_BUFF)*LEFT ) self.play(Write(answer)) - self.dither() + self.wait() self.antiderivative_fraction = VGroup( rhs_without_eq, @@ -1388,7 +1388,7 @@ class Antiderivative(AverageOfSineStart): ) self.play(morty.change, "raise_right_hand", fraction) self.play(Blink(morty)) - self.dither(2) + self.wait(2) self.play( FadeOut(big_rect), FadeOut(morty), @@ -1418,9 +1418,9 @@ class Antiderivative(AverageOfSineStart): ShowCreation(new_h_line), Write(pi) ) - self.dither() + self.wait() self.play(ShowCreation(line, run_time = 2)) - self.dither() + self.wait() def bring_back_derivative(self): self.play( @@ -1429,7 +1429,7 @@ class Antiderivative(AverageOfSineStart): self.deriv.to_corner, UP+LEFT, MED_LARGE_BUFF, self.deriv.shift, MED_SMALL_BUFF*DOWN, ) - self.dither() + self.wait() def show_tangent_slope(self): ss_group = self.get_secant_slope_group( @@ -1497,7 +1497,7 @@ class GeneralAverage(AverageOfContinuousVariable): Write(label), ShowCreation(line) ) - self.dither() + self.wait() self.graph = graph self.graph_label = graph_label @@ -1611,7 +1611,7 @@ class GeneralAverage(AverageOfContinuousVariable): self.transform_between_riemann_rects(rects, new_rects) self.play(Write(plus)) self.play(Write(minus)) - self.dither(2) + self.wait(2) self.area = VGroup(rects, plus, minus) @@ -1621,7 +1621,7 @@ class GeneralAverage(AverageOfContinuousVariable): self.average_expression.scale, 0.75, self.average_expression.to_corner, DOWN+RIGHT, ) - self.dither() + self.wait() def show_finite_sample(self): v_lines = self.get_vertical_lines_to_graph( @@ -1658,12 +1658,12 @@ class GeneralAverage(AverageOfContinuousVariable): self.play(ShowCreation(v_lines, run_time = 2)) self.play(*map(Write, [brace, dx])) - self.dither() + self.wait() self.play(Write(VGroup(num_samples, approx, *rhs[:-1]))) self.play(ReplacementTransform( dx.copy(), rhs.get_part_by_tex("dx") )) - self.dither(2) + self.wait(2) self.play( FadeIn(add_up_f_over), @@ -1688,7 +1688,7 @@ class GeneralAverage(AverageOfContinuousVariable): ]) self.play(*[vl.restore for vl in v_lines]) self.play(rhs_copy.next_to, add_up_f_over, DOWN) - self.dither(2) + self.wait(2) frac_line = add_up_f_over[1] self.play( FadeOut(rhs_copy.get_part_by_tex("over")), @@ -1698,7 +1698,7 @@ class GeneralAverage(AverageOfContinuousVariable): frac_line.stretch_to_fit_height, frac_line.get_height(), ) rhs_copy.remove(rhs_copy.get_part_by_tex("over")) - self.dither(2) + self.wait(2) int_fraction = self.average_expression[1].copy() int_fraction.generate_target() @@ -1717,7 +1717,7 @@ class GeneralAverage(AverageOfContinuousVariable): self.play(*map(FadeOut, [ dx, brace, num_samples, approx, rhs ])) - self.dither() + self.wait() self.v_lines = v_lines @@ -1745,7 +1745,7 @@ class GeneralAverage(AverageOfContinuousVariable): run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() #### @@ -1819,9 +1819,9 @@ class GeneralAntiderivative(GeneralAverage): ), run_time = 2, ) - self.dither() + self.wait() self.play(Write(deriv)) - self.dither() + self.wait() self.antideriv_graph = antideriv_graph @@ -1860,12 +1860,12 @@ class GeneralAntiderivative(GeneralAverage): self.bounds_labels, "ab", [0, 0.3] ) ]) - self.dither() + self.wait() self.show_change_in_height(numerator.copy()) self.shift_antideriv_graph_up_and_down() self.play(Write(VGroup(*new_fraction[-4:]))) - self.dither() + self.wait() h_line_brace = Brace(self.h_line, DOWN) denominator_copy = denominator.copy() @@ -1879,7 +1879,7 @@ class GeneralAntiderivative(GeneralAverage): denominator_copy.next_to, h_line_brace, DOWN, SMALL_BUFF ) - self.dither(3) + self.wait(3) def show_change_in_height(self, numerator): numerator.add_to_back(BackgroundRectangle(numerator)) @@ -1917,7 +1917,7 @@ class GeneralAntiderivative(GeneralAverage): numerator.next_to, brace.copy(), RIGHT, SMALL_BUFF, GrowFromCenter(brace), ) - self.dither(2) + self.wait(2) self.antideriv_graph.add( graph_within_bounds, v_line, h_line, numerator, brace @@ -1931,7 +1931,7 @@ class GeneralAntiderivative(GeneralAverage): self.antideriv_graph.shift, vect, run_time = 2 ) - self.dither() + self.wait() def draw_slope(self): line = Line(*self.graph_points_at_bounds) @@ -1939,7 +1939,7 @@ class GeneralAntiderivative(GeneralAverage): line.scale_in_place(1.3) self.play(ShowCreation(line, run_time = 2)) - self.dither() + self.wait() def show_tangent_line_slopes(self): ss_group = self.get_secant_slope_group( @@ -1969,7 +1969,7 @@ class LastVideoWrapper(Scene): rect.next_to(title, DOWN) self.play(Write(title), ShowCreation(rect)) - self.dither(5) + self.wait(5) class ASecondIntegralSensation(TeacherStudentsScene): def construct(self): @@ -2001,7 +2001,7 @@ class ASecondIntegralSensation(TeacherStudentsScene): "A second integral \\\\ sensation" ) self.change_student_modes(*["erm"]*3) - self.dither() + self.wait() self.play( Write(numbers), RemovePiCreatureBubble(self.teacher), @@ -2011,9 +2011,9 @@ class ASecondIntegralSensation(TeacherStudentsScene): look_at_arg = numbers ) self.play(Write(plusses)) - self.dither() + self.wait() self.play(Write(denominator)) - self.dither() + self.wait() self.change_student_modes( *["confused"]*3, @@ -2028,7 +2028,7 @@ class ASecondIntegralSensation(TeacherStudentsScene): run_time = 2 ) self.play(*map(FadeOut, [arrow])) - self.dither(2) + self.wait(2) self.change_student_modes( *["pondering"]*3, look_at_arg = sigma_to_integral, @@ -2037,7 +2037,7 @@ class ASecondIntegralSensation(TeacherStudentsScene): self.teacher.change_mode, "raise_right_hand" ] ) - self.dither(3) + self.wait(3) class Chapter9PatreonThanks(PatreonThanks): CONFIG = { diff --git a/old_projects/eoc/footnote.py b/old_projects/eoc/footnote.py index 62dcd456..0eca1562 100644 --- a/old_projects/eoc/footnote.py +++ b/old_projects/eoc/footnote.py @@ -74,17 +74,17 @@ class Introduce(TeacherStudentsScene): color = WHITE ) self.play(FadeIn(second_deriv)) - self.dither(2) + self.wait(2) self.play(Transform(second_deriv, derivs[1])) - self.dither(2) + self.wait(2) self.play(MoveToTarget(card_dot)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.play(Transform(second_deriv, derivs[2])) self.change_student_modes(*["erm"]*3) - self.dither() + self.wait() self.play(second_deriv.restore) - self.dither(2) + self.wait(2) class SecondDerivativeGraphically(GraphScene): CONFIG = { @@ -122,7 +122,7 @@ class SecondDerivativeGraphically(GraphScene): rate_func = squish_rate_func(smooth, 0.5, 1) ) ) - self.dither() + self.wait() self.graph = graph self.graph_label = graph_label @@ -145,12 +145,12 @@ class SecondDerivativeGraphically(GraphScene): ss_group, target_x = self.x3, run_time = 5 ) - self.dither() + self.wait() self.animate_secant_slope_group_change( ss_group, target_x = self.x2, run_time = 3 ) - self.dither() + self.wait() self.ss_group = ss_group self.deriv = deriv @@ -173,7 +173,7 @@ class SecondDerivativeGraphically(GraphScene): ] self.play(Write(second_deriv)) - self.dither() + self.wait() self.play( Write(words), ShowCreation( @@ -227,7 +227,7 @@ class SecondDerivativeGraphically(GraphScene): UpdateFromFunc(dot, get_dot_update_func(positive_curve)) ) self.play(FadeOut(dot)) - self.dither() + self.wait() self.animate_secant_slope_group_change( self.ss_group, target_x = self.x3, run_time = 4, @@ -250,7 +250,7 @@ class SecondDerivativeGraphically(GraphScene): run_time = 4, added_anims = [Animation(negative_curve)] ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ self.graph, self.ss_group, negative_curve, self.second_deriv_words @@ -305,14 +305,14 @@ class SecondDerivativeGraphically(GraphScene): if submob is not graph.arg_rhs.get_part_by_tex(str(x0)) ])) ) - self.dither() + self.wait() self.play(FadeIn(graph.ss_group)) self.animate_secant_slope_group_change( graph.ss_group, target_x = x0 + 1, run_time = 3, ) self.play(FadeOut(graph.ss_group)) - self.dither() + self.wait() for new_graph in graphs[1:]: self.play(Transform(graph, new_graph)) self.play(Transform( @@ -377,20 +377,20 @@ class IntroduceNotation(TeacherStudentsScene): RemovePiCreatureBubble(self.get_students()[1]), self.teacher.change_mode, "raise_right_hand" ) - self.dither() + self.wait() self.play(ShowCreation(numerator.circle)) - self.dither() + self.wait() self.play(ReplacementTransform( numerator.circle, denominator.circle, )) - self.dither() + self.wait() self.play( FadeOut(denominator.circle), Write(dx_to_zero), dxs.highlight, YELLOW ) - self.dither() + self.wait() self.play( FadeOut(dx_to_zero), *[ApplyMethod(pi.change, "plain") for pi in self.get_pi_creatures()] @@ -401,7 +401,7 @@ class IntroduceNotation(TeacherStudentsScene): FadeOut(VGroup(lp, rp)), d_over_dx.shift, 0.8*LEFT + 0.05*UP, ) - self.dither() + self.wait() self.play(*[ ReplacementTransform( group, @@ -414,13 +414,13 @@ class IntroduceNotation(TeacherStudentsScene): (VGroup(dxs[1].copy()), "^2}"), ] ]) - self.dither(2) + self.wait(2) self.student_says( "How does one... \\\\ read that?", student_index = 0, ) self.play(self.teacher.change, "happy") - self.dither(2) + self.wait(2) class HowToReadNotation(GraphScene, ReconfigurableScene): CONFIG = { @@ -481,7 +481,7 @@ class HowToReadNotation(GraphScene, ReconfigurableScene): brace.dx.next_to(brace, DOWN, SMALL_BUFF) self.play(ShowCreation(v_lines[0])) - self.dither() + self.wait() for brace, line in zip(braces, v_lines[1:]): self.play( ReplacementTransform( @@ -491,7 +491,7 @@ class HowToReadNotation(GraphScene, ReconfigurableScene): Write(brace.dx, run_time = 1), ) self.play(ShowCreation(line)) - self.dither() + self.wait() self.v_lines = v_lines self.braces = braces @@ -546,7 +546,7 @@ class HowToReadNotation(GraphScene, ReconfigurableScene): ShowCreation(df_line.arrow), Write(df_line.label) ) - self.dither(2) + self.wait(2) self.df_dx_groups = df_dx_groups self.df_labels = df_labels @@ -598,7 +598,7 @@ class HowToReadNotation(GraphScene, ReconfigurableScene): self.play(ShowCreation(h_lines, run_time = 2)) self.play(GrowFromCenter(ddf_brace)) self.play(Write(ddf)) - self.dither(2) + self.wait(2) self.ddf = ddf @@ -620,9 +620,9 @@ class HowToReadNotation(GraphScene, ReconfigurableScene): self.play(MoveToTarget(ddf)) self.play(Write(rhs)) - self.dither() + self.wait() self.play(Write(example_dx)) - self.dither(2) + self.wait(2) self.play(FadeOut(example_dx)) self.ddf = ddf @@ -663,7 +663,7 @@ class HowToReadNotation(GraphScene, ReconfigurableScene): for mob, tex in (self.ddf, "df"), (self.dx_squared, "dx") ] ) - self.dither(2) + self.wait(2) self.play(FadeOut(parens)) self.play( left_shifter.shift, 0.2*LEFT, @@ -671,7 +671,7 @@ class HowToReadNotation(GraphScene, ReconfigurableScene): ReplacementTransform(pre_exp_two, exp_two), ddf_over_dx_squared.get_part_by_tex("over").scale_in_place, 0.8 ) - self.dither(2) + self.wait(2) class Footnote(Scene): def construct(self): @@ -730,7 +730,7 @@ class SecondDerivativeAsAcceleration(Scene): a_words.to_corner(UP+RIGHT ) self.add(a_words) self.show_car_movement() - self.dither() + self.wait() self.a_words = a_words @@ -824,32 +824,32 @@ class SecondDerivativeAsAcceleration(Scene): s_graph.next_to, s_words, LEFT ) self.play(*map(FadeIn, [v_graph, v_words]) ) - self.dither(2) + self.wait(2) self.play( v_graph.scale, 0.3, v_graph.next_to, v_words, LEFT ) - self.dither(2) + self.wait(2) self.play( Indicate(self.a_words), FadeIn(a_graph), ) - self.dither() + self.wait() self.play(FadeIn(positive_rect)) for x in range(2): self.show_car_movement( run_time = 3, rate_func = lambda t : smooth(t/2.0) ) - self.dither() + self.wait() self.play(FadeIn(negative_rect)) - self.dither() + self.wait() self.play(MoveCar( self.car, self.line.get_end(), run_time = 3, rate_func = lambda t : 2*smooth((t+1)/2.0) - 1 )) - self.dither() + self.wait() self.play( a_graph.scale, 0.3, a_graph.next_to, self.a_words, LEFT, @@ -866,7 +866,7 @@ class SecondDerivativeAsAcceleration(Scene): self.car.move_to(self.line.get_start()) self.play(FadeIn(self.car)) self.show_car_movement() - self.dither(2) + self.wait(2) ########## @@ -893,7 +893,7 @@ class NextVideo(Scene): rect.next_to(title, DOWN) self.add(rect) self.play(Write(title)) - self.dither() + self.wait() class Thumbnail(SecondDerivativeGraphically): CONFIG = { diff --git a/old_projects/eoc/old_chapter1.py b/old_projects/eoc/old_chapter1.py index 2d8db1a9..da371ad4 100644 --- a/old_projects/eoc/old_chapter1.py +++ b/old_projects/eoc/old_chapter1.py @@ -132,7 +132,7 @@ class CircleScene(PiCreatureScene): Write(nudge_label), run_time = run_time/2. ) - self.dither(run_time/2.) + self.wait(run_time/2.) self.nudge_line = nudge_line self.nudge_arrow = nudge_arrow self.nudge_label = nudge_label @@ -227,7 +227,7 @@ class PatronsOnly(Scene): morty.look_at, title ) self.play(Blink(morty)) - self.dither() + self.wait() class Introduction(TeacherStudentsScene): def construct(self): @@ -365,7 +365,7 @@ class Introduction(TeacherStudentsScene): bubble.add_content(big_derivative) self.play(Write(big_derivative)) self.play(Blink(pi3)) - self.dither() + self.wait() def zoom_in_on_first(self): this_video = self.this_video @@ -433,7 +433,7 @@ class IntroduceCircle(Scene): Animation(radius), Animation(R), ) - self.dither() + self.wait() self.play( circle.set_stroke, circumference.get_color(), FadeIn(circumference), @@ -446,7 +446,7 @@ class IntroduceCircle(Scene): path_arc = -np.pi/2, run_time = 3 )) - self.dither() + self.wait() self.play( area_form.copy().replace, derivative[1], circum_form.copy().replace, derivative[3], @@ -454,7 +454,7 @@ class IntroduceCircle(Scene): Write(derivative[2]), run_time = 1 ) - self.dither() + self.wait() self.play( area_form.copy().replace, integral[3], Transform(circum_form.copy(), integral[1]), @@ -462,14 +462,14 @@ class IntroduceCircle(Scene): Write(integral[2]), run_time = 1 ) - self.dither() + self.wait() self.play(Write(up_down_arrow)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(to_be_explained) ) - self.dither() + self.wait() class HeartOfCalculus(GraphScene): CONFIG = { @@ -596,7 +596,7 @@ class IntroduceTinyChangeInArea(CircleScene): self.play(Write(area_group)) self.change_mode("happy") outer_ring = self.increase_radius() - self.dither() + self.wait() self.play( area_group.restore, GrowFromCenter(expression_brace), @@ -609,12 +609,12 @@ class IntroduceTinyChangeInArea(CircleScene): Write(new_area_word), GrowFromCenter(new_area_brace) ) - self.dither(2) + self.wait(2) self.play( group.fade, 0.7, self.pi_creature.change_mode, "happy" ) - self.dither() + self.wait() self.play( outer_ring.highlight, YELLOW, Animation(self.nudge_arrow), @@ -629,7 +629,7 @@ class IntroduceTinyChangeInArea(CircleScene): insignificant.highlight(self.dR_color) insignificant.move_to(self.error_words) self.play(Transform(self.error_words, insignificant)) - self.dither() + self.wait() big_rect = Rectangle( width = 2*SPACE_WIDTH, @@ -680,12 +680,12 @@ class IntroduceTinyChangeInArea(CircleScene): GrowFromCenter(circum_brace), Write(two_pi_R) ) - self.dither() + self.wait() self.play( GrowFromCenter(dR_brace), Write(dR) ) - self.dither() + self.wait() self.play( MoveToTarget(two_pi_R.copy()), MoveToTarget(dR.copy()), @@ -699,7 +699,7 @@ class IntroduceTinyChangeInArea(CircleScene): self.pi_creature.change_mode, "happy", self.pi_creature.look_at, final_area ) - self.dither() + self.wait() group = VGroup( almost_rect, final_area, two_pi_R, dR, circum_brace, dR_brace @@ -737,7 +737,7 @@ class IntroduceTinyChangeInArea(CircleScene): Write(writer) ) to_remove += self.get_mobjects_from_last_animation() - self.dither() + self.wait() self.play( Transform(minus.copy(), minus2), Transform(area_form.copy(), pi_R_squared2), @@ -745,17 +745,17 @@ class IntroduceTinyChangeInArea(CircleScene): to_remove += self.get_mobjects_from_last_animation() self.remove(*to_remove) self.add(self.pi_creature, *expanded) - self.dither(2) + self.wait(2) self.play(*[ ApplyMethod(mob.highlight, RED) for mob in pi_R_squared, pi_R_squared2 ]) - self.dither() + self.wait() self.play(*[ ApplyMethod(mob.fade, 0.7) for mob in plus, pi_R_squared, pi_R_squared2, minus2 ]) - self.dither() + self.wait() approx_brace = Brace(two_pi_R_dR) error_brace = Brace(pi_dR_squared, buff = SMALL_BUFF) @@ -767,13 +767,13 @@ class IntroduceTinyChangeInArea(CircleScene): GrowFromCenter(approx_brace), self.pi_creature.change_mode, "hooray" ) - self.dither() + self.wait() self.play( GrowFromCenter(error_brace), Write(error_words), self.pi_creature.change_mode, "confused" ) - self.dither() + self.wait() self.two_pi_R = VGroup(*two_pi_R_dR[:3]) def second_unwrapping(self, outer_ring): @@ -790,10 +790,10 @@ class IntroduceTinyChangeInArea(CircleScene): self.pi_creature.change_mode, "pondering" ) self.unwrap_ring(almost_rect) - self.dither() + self.wait() rect.move_to(almost_rect) self.play(FadeIn(rect)) - self.dither() + self.wait() def create_pi_creature(self): morty = Mortimer() @@ -847,17 +847,17 @@ class BuildToDADR(CircleScene): Write(change, run_time = 1), self.pi_creature.change_mode, "pondering", ) - self.dither() + self.wait() self.play(*it.chain( map(Write, [equals, two_pi_R, dR]), map(FadeIn, [circum_text, circum_brace]) )) - self.dither() + self.wait() self.play(*it.chain( map(Write, [plus, pi, dR2, squared]), map(FadeIn, [error_brace, error_text]) )) - self.dither(2) + self.wait(2) self.change = change self.circum_term = VGroup(two_pi_R, dR) self.circum_term.label = VGroup(circum_brace, circum_text) @@ -888,7 +888,7 @@ class BuildToDADR(CircleScene): map(MoveToTarget, [self.equals, self.plus]) )) self.play(*[term.denom.restore for term in terms]) - self.dither(2) + self.wait(2) self.play( self.outer_ring.highlight, YELLOW, rate_func = there_and_back @@ -897,7 +897,7 @@ class BuildToDADR(CircleScene): self.nudge_label.scale_in_place, 2, rate_func = there_and_back ) - self.dither(2) + self.wait(2) canceleres = VGroup(self.circum_term[1], self.circum_term.denom) self.play(canceleres.highlight, RED) self.play(FadeOut(canceleres)) @@ -912,7 +912,7 @@ class BuildToDADR(CircleScene): ) ) self.circum_term = self.circum_term[0] - self.dither(2) + self.wait(2) self.play( FadeOut(self.error_term[-1]), FadeOut(self.error_term.denom) @@ -928,7 +928,7 @@ class BuildToDADR(CircleScene): self.error_term ) ) - self.dither() + self.wait() def transition_to_dR(self): dRs = VGroup( @@ -961,7 +961,7 @@ class BuildToDADR(CircleScene): for pair in zip(dRs, new_dRs) ] ) - self.dither() + self.wait() if s == "(0.001)": self.plus.generate_target() self.plus.target.next_to(self.circum_term) @@ -973,7 +973,7 @@ class BuildToDADR(CircleScene): self.play(*map(MoveToTarget, [ error_brace, error_text, self.plus, self.error_term ])) - self.dither() + self.wait() difference_text = TextMobject( "``Tiny " , "d", "ifference in ", "$R$", "''", @@ -988,7 +988,7 @@ class BuildToDADR(CircleScene): ShowCreation(difference_arrow), self.pi_creature.change_mode, "speaking" ) - self.dither() + self.wait() dA = TexMobject("dA") dA.highlight(self.change.get_color()) @@ -1009,7 +1009,7 @@ class BuildToDADR(CircleScene): difference_text[1].highlight, dA.get_color(), MoveToTarget(difference_arrow), ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [difference_text, difference_arrow])) def elaborate_on_d(self): @@ -1024,10 +1024,10 @@ class BuildToDADR(CircleScene): ShowCreation(arc), self.pi_creature.change_mode, "sassy" ) - self.dither() + self.wait() self.play(self.pi_creature.shrug) self.play(FadeOut(arc)) - self.dither() + self.wait() d = TextMobject("``$d$''") arrow = TexMobject("\\Rightarrow") @@ -1049,7 +1049,7 @@ class BuildToDADR(CircleScene): ) self.play(*map(Write, [arrow, ignore_error])) self.play(error_group.fade, 0.8) - self.dither(2) + self.wait(2) equality_brace = Brace(VGroup(self.change.denom, self.circum_term)) equal_word = equality_brace.get_text("Equality") VGroup(equality_brace, equal_word).highlight(BLUE) @@ -1057,13 +1057,13 @@ class BuildToDADR(CircleScene): GrowFromCenter(equality_brace), Write(equal_word, run_time = 1) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [equality_brace, equal_word])) less_wrong_philosophy = TextMobject("``Less wrong'' philosophy") less_wrong_philosophy.move_to(ignore_error, LEFT) self.play(Transform(ignore_error, less_wrong_philosophy)) - self.dither() + self.wait() big_dR = 0.3 big_outer_ring = self.get_ring(self.radius, big_dR) @@ -1114,7 +1114,7 @@ class BuildToDADR(CircleScene): Write(bubble.content), self.pi_creature.change_mode, "confused" ) - self.dither() + self.wait() to_infs = [self.change, self.change.denom, self.nudge_label] for mob in to_infs: @@ -1126,9 +1126,9 @@ class BuildToDADR(CircleScene): Transform(mob, mob.inf) for mob in to_infs ]) - self.dither() + self.wait() self.play(self.pi_creature.change_mode, "pleading") - self.dither() + self.wait() self.play(*it.chain( [mob.restore for mob in to_infs], map(FadeOut, [bubble, bubble.content]), @@ -1146,7 +1146,7 @@ class BuildToDADR(CircleScene): MoveToTarget(self.outer_ring), self.nudge_line.stretch_to_fit_width, 0.1/(n+1) ) - self.dither() + self.wait() bubble.write("Wrong!") bubble.resize_to_content() bubble.stretch(0.7, 1) @@ -1159,7 +1159,7 @@ class BuildToDADR(CircleScene): ) self.play(randy.highlight, RED) self.play(self.pi_creature.change_mode, "guilty") - self.dither() + self.wait() new_bubble = self.pi_creature.get_bubble(SpeechBubble) new_bubble.set_fill(BLACK, opacity = 0.8) @@ -1176,7 +1176,7 @@ class BuildToDADR(CircleScene): randy.highlight, BLUE_E, self.pi_creature.change_mode, "shruggie" ) - self.dither(2) + self.wait(2) class NameDerivative(IntroduceTinyChangeInArea): def construct(self): @@ -1199,7 +1199,7 @@ class NameDerivative(IntroduceTinyChangeInArea): self.nudge_label = new_label self.nudge_arrow = new_arrow self.add(self.nudge_label, self.nudge_arrow) - self.dither() + self.wait() def name_derivative_for_cricle(self): dA_dR, equals, d_formula_dR, equals2, two_pi_R = dArea_fom = TexMobject( @@ -1233,17 +1233,17 @@ class NameDerivative(IntroduceTinyChangeInArea): Transform(self.nudge_line.copy(), dR, run_time = 2), Write(frac_line) ) - self.dither() + self.wait() self.play( ShowCreation(dA_dR_circle), ShowCreation(arrow), Write(words) ) - self.dither() + self.wait() self.play(Write(VGroup(equals, d_formula_dR))) - self.dither() + self.wait() self.play(Write(VGroup(equals2, two_pi_R))) - self.dither() + self.wait() self.dArea_fom = dArea_fom self.words = words self.two_pi_R = two_pi_R @@ -1284,7 +1284,7 @@ class NameDerivative(IntroduceTinyChangeInArea): ), self.pi_creature.change_mode, "hooray" ) - self.dither() + self.wait() self.play(Transform(area_circle.copy(), area_form)) self.remove(area_form) self.play(Transform(circum_circle.copy(), circum_form)) @@ -1356,18 +1356,18 @@ class NameDerivative(IntroduceTinyChangeInArea): elif n > num_fracs: anims.append(ShowCreation(arrows[-1])) self.play(*anims) - self.dither(2) + self.wait(2) self.play( FadeOut(arrows), ring_group.restore, self.pi_creature.change_mode, "happy", ) - self.dither() + self.wait() def reference_approximation(self): ring_copy = self.outer_ring.copy() self.unwrap_ring(ring_copy) - self.dither() + self.wait() self.last_mover = ring_copy def emphasize_equality(self): @@ -1386,7 +1386,7 @@ class NameDerivative(IntroduceTinyChangeInArea): rate_func = there_and_back, run_time = 2 ) - self.dither() + self.wait() new_words = TextMobject( "Systematically\\\\", @@ -1394,7 +1394,7 @@ class NameDerivative(IntroduceTinyChangeInArea): ) new_words.move_to(self.words) self.play(Transform(self.words, new_words)) - self.dither() + self.wait() class DerivativeAsTangentLine(ZoomedScene): CONFIG = { @@ -1463,7 +1463,7 @@ class DerivativeAsTangentLine(ZoomedScene): self.play(ShowCreation(graph)) self.play(Write(graph_label)) self.play(Write(VGroup(x_label, y_label))) - self.dither() + self.wait() self.x_axis, self.y_axis = x_axis, y_axis self.graph = graph @@ -1517,7 +1517,7 @@ class DerivativeAsTangentLine(ZoomedScene): line.text.next_to(line.brace, vect, buff = tiny_buff) self.play(ShowCreation(line)) self.play(Write(VGroup(line.brace, line.text))) - self.dither() + self.wait() deriv_is_slope = TexMobject( "\\frac{dA}{dR} =", "\\text{Slope}" @@ -1529,7 +1529,7 @@ class DerivativeAsTangentLine(ZoomedScene): deriv_is_slope.shift(UP) self.play(Write(deriv_is_slope)) - self.dither() + self.wait() ### Whoa boy, this aint' gonna be pretty self.dot = dot @@ -1577,7 +1577,7 @@ class DerivativeAsTangentLine(ZoomedScene): rect.move_to(self.graph_point(R) + self.little_rect_nudge) self.play(ShowCreation(line)) - self.dither() + self.wait() self.note_R_value_of_point() alphas = np.arange(0, 1, 0.01) @@ -1602,11 +1602,11 @@ class DerivativeAsTangentLine(ZoomedScene): for alpha in 0.95, 0.2: shift_everything_to_alpha(alpha) - self.dither() + self.wait() self.play(Write(two_pi_R)) - self.dither() + self.wait() shift_everything_to_alpha(0.8, 4) - self.dither() + self.wait() def note_R_value_of_point(self): R = self.R_to_zoom_in_on @@ -1624,7 +1624,7 @@ class DerivativeAsTangentLine(ZoomedScene): self.play(ShowCreation(dot)) self.play(ShowCreation(arrow)) self.play(dot.scale_in_place, 2, rate_func = there_and_back) - self.dither() + self.wait() self.play(*map(FadeOut, [dashed_line, dot, arrow])) def state_commonality(self): @@ -1643,7 +1643,7 @@ class DerivativeAsTangentLine(ZoomedScene): morty.change_mode, "surprised" ) self.play(Blink(morty)) - self.dither() + self.wait() new_words = TextMobject("Which is...fine...") new_words.move_to(bubble.content, RIGHT) self.play( @@ -1653,7 +1653,7 @@ class DerivativeAsTangentLine(ZoomedScene): morty.change_mode, "hesitant" ) self.play(Blink(morty)) - self.dither() + self.wait() class SimpleConfusedPi(Scene): def construct(self): @@ -1665,7 +1665,7 @@ class SimpleConfusedPi(Scene): pi.scale(2) pi.rotate(np.pi/2) self.play(Transform(randy, confused)) - self.dither() + self.wait() class TangentLinesAreNotEverything(TeacherStudentsScene): def construct(self): @@ -1736,7 +1736,7 @@ class IntroduceConcentricRings(CircleScene): ) foreground_group.add(dr_line, dr_arrow, dr_text) self.change_mode("pondering") - self.dither() + self.wait() self.play( FadeIn( VGroup(*rings[:-1]), @@ -1745,7 +1745,7 @@ class IntroduceConcentricRings(CircleScene): ), Animation(foreground_group) ) - self.dither() + self.wait() self.foreground_group = foreground_group self.rings = rings @@ -1781,7 +1781,7 @@ class IntroduceConcentricRings(CircleScene): Animation(self.foreground_group), run_time = 5, ) - self.dither() + self.wait() self.area_sum = area_sum def unwrap_special_ring(self): @@ -1810,7 +1810,7 @@ class IntroduceConcentricRings(CircleScene): self.play(ShowCreation(radial_line)) self.play(Write(r_label)) self.foreground_group.add(radial_line, r_label) - self.dither() + self.wait() self.unwrap_ring(special_ring, to_edge = RIGHT) brace = Brace(special_ring, UP) @@ -1826,7 +1826,7 @@ class IntroduceConcentricRings(CircleScene): Write(two_pi_r) ) self.play(GrowFromCenter(left_brace), Write(dr)) - self.dither() + self.wait() think_concrete = TextMobject("Think $dr = 0.1$") think_concrete.next_to(dr, DOWN+LEFT, buff = LARGE_BUFF) @@ -1836,7 +1836,7 @@ class IntroduceConcentricRings(CircleScene): ShowCreation(arrow), self.pi_creature.change_mode, "speaking" ) - self.dither() + self.wait() less_wrong = TextMobject(""" Approximations get @@ -1844,7 +1844,7 @@ class IntroduceConcentricRings(CircleScene): """) less_wrong.next_to(self.pi_creature, LEFT, aligned_edge = UP) self.play(Write(less_wrong)) - self.dither() + self.wait() self.special_ring = special_ring self.radial_line = radial_line @@ -1876,7 +1876,7 @@ class IntroduceConcentricRings(CircleScene): Write(formula_q), self.pi_creature.change_mode, "pondering" ) - self.dither(2) + self.wait(2) last = VMobject() last.save_state() @@ -1892,42 +1892,42 @@ class IntroduceConcentricRings(CircleScene): ) last = ring self.play(last.restore) - self.dither() + self.wait() ghost = self.rings.copy() for mob in self.area_sum_rhs, self.two_pi_r: ghost.set_fill(opacity = 0.1) self.play(Transform(ghost, mob)) - self.dither() + self.wait() self.remove(ghost) - self.dither() + self.wait() self.play(FadeOut(formula_q)) self.play(Write(int_sym)) - self.dither() + self.wait() self.rings.generate_target() self.rings.target.set_fill(opacity = 1) self.play( MoveToTarget(self.rings, rate_func = there_and_back), Animation(self.foreground_group) ) - self.dither() + self.wait() self.grow_and_shrink_r_line(zero, R) - self.dither() + self.wait() self.play( MoveToTarget(self.two_pi_r), MoveToTarget(self.dr), run_time = 2 ) - self.dither() + self.wait() self.play( FadeOut(self.to_fade), ApplyMethod(self.rings.restore, run_time = 2), Animation(self.foreground_group) ) - self.dither() + self.wait() self.play(Write(equals_pi_R_squared)) - self.dither() + self.wait() self.equals = equals_pi_R_squared[0] self.integral_terms = VGroup( self.integral_expression[1], @@ -1958,7 +1958,7 @@ class IntroduceConcentricRings(CircleScene): self.play(equals_0[-1].copy().replace, zero_target) self.remove(self.get_mobjects_from_last_animation()[0]) self.add(zero_target) - self.dither() + self.wait() self.radial_line.target.scale_in_place( self.radius/self.radial_line.get_length() ) @@ -1976,7 +1976,7 @@ class IntroduceConcentricRings(CircleScene): self.play(equals_0[-1].copy().replace, R_target) self.remove(self.get_mobjects_from_last_animation()[0]) self.add(R_target) - self.dither() + self.wait() self.play( self.radial_line.restore, self.r_label.restore, @@ -2004,7 +2004,7 @@ class IntroduceConcentricRings(CircleScene): ShowCreation(arrow), self.pi_creature.change_mode, "confused" ) - self.dither(2) + self.wait(2) self.play(*[ ApplyMethod(ring.set_stroke, ring.get_color(), width = 1) for ring in self.rings @@ -2012,25 +2012,25 @@ class IntroduceConcentricRings(CircleScene): FadeOut(self.dr_group), Animation(self.foreground_group) ]) - self.dither() + self.wait() self.play( Transform(question, approach_words), Transform(arrow, Arrow(approach_words, approx)), self.equals.restore, self.pi_creature.change_mode, "happy" ) - self.dither(2) + self.wait(2) self.play( self.integral_expression.gradient_highlight, BLUE, GREEN, GrowFromCenter(int_brace), Write(integral_word) ) - self.dither() + self.wait() for term in self.integral_terms: term.save_state() self.play(term.highlight, YELLOW) self.play(term.restore) - self.dither(3) + self.wait(3) class AskAboutGeneralCircles(TeacherStudentsScene): def construct(self): @@ -2071,7 +2071,7 @@ class GraphIntegral(GraphScene): self.little_r = integral[5] self.play(Write(integral)) - self.dither() + self.wait() self.setup_axes() self.show_horizontal_axis() self.add_rectangles() @@ -2138,12 +2138,12 @@ class GraphIntegral(GraphScene): Write(values_words), ShowCreation(arrows) ) - self.dither() + self.wait() self.play( GrowFromCenter(dr_brace), Write(dr_text) ) - self.dither() + self.wait() rectangles.save_state() rectangles.stretch_to_fit_height(0) rectangles.move_to(self.graph_origin, DOWN+LEFT) @@ -2153,7 +2153,7 @@ class GraphIntegral(GraphScene): Animation(ticks), run_time = 2 ) - self.dither() + self.wait() self.play(*[ ApplyMethod(rect.fade, 0.7) for rect in rectangles @@ -2163,7 +2163,7 @@ class GraphIntegral(GraphScene): GrowFromCenter(left_brace), Write(height_label) ) - self.dither() + self.wait() graph = self.graph_function( lambda r : 2*np.pi*r, @@ -2182,7 +2182,7 @@ class GraphIntegral(GraphScene): Transform(height_label, graph_label), ShowCreation(graph) ) - self.dither(3) + self.wait(3) self.play(*map(FadeOut, [ticks, dr_brace, dr_text])) self.rectangles = rectangles @@ -2192,7 +2192,7 @@ class GraphIntegral(GraphScene): dr = self.dr/x, stroke_width = 1./x ) self.play(Transform(self.rectangles, new_rects)) - self.dither() + self.wait() def ask_about_area(self): question = TextMobject("What's this \\\\ area") @@ -2206,7 +2206,7 @@ class GraphIntegral(GraphScene): Write(question), ShowCreation(arrow) ) - self.dither() + self.wait() def get_rectangles(self, dr, stroke_width = 1): return self.get_riemann_rectangles( @@ -2304,7 +2304,7 @@ class FundamentalTheorem(CircleScene): Write(self.derivative_terms), self.pi_creature.change_mode, "hooray" ) - self.dither() + self.wait() def add_integral_terms(self): symbolic = TexMobject( @@ -2339,12 +2339,12 @@ class FundamentalTheorem(CircleScene): self.integral_terms.next_to(ORIGIN, RIGHT, buff = LARGE_BUFF) self.play(Write(self.integral_terms)) - self.dither() + self.wait() def think_about_it(self): for mode in "confused", "pondering", "surprised": self.change_mode(mode) - self.dither() + self.wait() def bring_in_circle(self): self.play( @@ -2359,7 +2359,7 @@ class FundamentalTheorem(CircleScene): def show_outer_ring(self): self.increase_radius(numerical_dr = False) self.foreground_group.add(self.nudge_line, self.nudge_arrow) - self.dither() + self.wait() ring_copy = self.outer_ring.copy() ring_copy.save_state() self.unwrap_ring(ring_copy, to_edge = LEFT) @@ -2414,7 +2414,7 @@ class FundamentalTheorem(CircleScene): ShowCreation(arrow), Write(opposites) ) - self.dither() + self.wait() class NameTheFundamentalTheorem(TeacherStudentsScene): def construct(self): @@ -2446,7 +2446,7 @@ class NameTheFundamentalTheorem(TeacherStudentsScene): in due time. """) self.change_student_modes(*["happy"]*3) - self.dither(2) + self.wait(2) class CalculusInANutshell(CircleScene): CONFIG = { @@ -2474,13 +2474,13 @@ class CalculusInANutshell(CircleScene): rings.set_stroke(width = 0) self.play(Write(calculus)) - self.dither() + self.wait() self.play(Transform( calculus, rings, submobject_mode = "lagged_start", run_time = 5 )) - self.dither() + self.wait() def show_remainder_of_series(self): series = VideoSeries() @@ -2510,12 +2510,12 @@ class CalculusInANutshell(CircleScene): submobject_mode = "lagged_start", run_time = 2, )) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(derivatives) ) - self.dither() + self.wait() class Thumbnail(CircleScene): CONFIG = { diff --git a/old_projects/eola/chapter0.py b/old_projects/eola/chapter0.py index bd29a26f..eb1315dd 100644 --- a/old_projects/eola/chapter0.py +++ b/old_projects/eola/chapter0.py @@ -67,9 +67,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN) self.play(FadeIn(words)) - self.dither(3) + self.wait(3) self.play(Write(author, run_time = 5)) - self.dither() + self.wait() class VideoIcon(SVGMobject): def __init__(self, **kwargs): @@ -103,7 +103,7 @@ class UpcomingSeriesOfVidoes(Scene): ) for icon, offset in zip(icons, np.linspace(0, 0.5, len(icons))) ]) - self.dither() + self.wait() class AboutLinearAlgebra(Scene): @@ -134,13 +134,13 @@ class AboutLinearAlgebra(Scene): ]) self.play(Write(linalg, run_time = 1)) - self.dither() + self.wait() self.play( ShowCreation(arrows, submobject_mode = "lagged_start"), FadeIn(all_subs), run_time = 2 ) - self.dither() + self.wait() self.linalg = linalg def to_thought_bubble(self): @@ -160,7 +160,7 @@ class AboutLinearAlgebra(Scene): Write(bubble), FadeIn(randy) ) - self.dither() + self.wait() topics = [ self.get_matrix_multiplication(), @@ -191,9 +191,9 @@ class AboutLinearAlgebra(Scene): if count %3 == 0: self.play(Blink(randy)) - self.dither() + self.wait() else: - self.dither(2) + self.wait(2) def get_matrix_multiplication(self): @@ -301,10 +301,10 @@ class NumericVsGeometric(Scene): FadeIn(matrix_vector_product), run_time = 2 ) - self.dither() + self.wait() self.play(Write(self.geometric, run_time = 2)) ### Paste in linear transformation - self.dither() + self.wait() digest_locals(self) def clear_way_for_geometric(self): @@ -359,7 +359,7 @@ class NumericVsGeometric(Scene): ) curr_randy = randy curr_thought = thought - self.dither(1.5) + self.wait(1.5) class ExampleTransformation(LinearTransformationScene): @@ -367,7 +367,7 @@ class ExampleTransformation(LinearTransformationScene): self.setup() self.add_vector(np.array(TRANFORMED_VECTOR).flatten()) self.apply_matrix(EXAMPLE_TRANFORM) - self.dither() + self.wait() class NumericToComputations(Scene): @@ -381,7 +381,7 @@ class NumericToComputations(Scene): self.add(top) self.play(ShowCreation(arrow, submobject_mode = "one_at_a_time")) self.play(FadeIn(bottom)) - self.dither() + self.wait() @@ -399,12 +399,12 @@ class LinAlgPyramid(Scene): ShowCreation(rect), run_time = 1 ) - self.dither() + self.wait() self.play(*[ ApplyMethod(m.highlight, DARK_GREY) for m in words[0], rects[0] ]) - self.dither() + self.wait() self.list_applications(rects[-1]) def get_rects(self): @@ -448,7 +448,7 @@ class LinAlgPyramid(Scene): else: curr_subject = subject self.play(FadeIn(curr_subject, run_time = 0.5)) - self.dither() + self.wait() class IntimidatingProf(Scene): @@ -481,21 +481,21 @@ class IntimidatingProf(Scene): ShowCreation(arrow, submobject_mode = "one_at_a_time") ) self.play(Transform(morty_name1, morty_name2)) - self.dither() + self.wait() self.play(FadeOut(morty_name1), FadeOut(arrow)) self.play( FadeIn(speech_bubble), ApplyMethod(morty.change_mode, "speaking") ) self.play(FadeIn(thought_bubble)) - self.dither() + self.wait() self.play( ApplyMethod(randy.change_mode, "confused"), Write(q_marks, run_time = 1) ) self.play(FadeOut(VMobject(speech_bubble, thought_bubble))) self.play(FadeIn(randy_bubble)) - self.dither() + self.wait() class ThoughtBubbleTransformation(LinearTransformationScene): @@ -511,7 +511,7 @@ class ThoughtBubbleTransformation(LinearTransformationScene): rotation, path_arc = np.pi/3, ) - self.dither() + self.wait() class SineApproximations(Scene): @@ -529,15 +529,15 @@ class SineApproximations(Scene): pi_sixts_approx.next_to(one_approx, DOWN, buff = 1.5) self.play(Write(series)) - self.dither() + self.wait() self.play(FadeIn(words)) - self.dither(2) + self.wait(2) self.play(FadeOut(words)) self.remove(words) - self.dither() + self.wait() self.play(Write(one_approx)) self.play(Write(pi_sixts_approx)) - self.dither() + self.wait() def get_series(self): return TexMobject(""" @@ -570,7 +570,7 @@ class LooseConnectionToTriangles(Scene): self.play(ShowCreation(arrow)) self.play(ShowCreation(triangle)) self.play(Write(q_mark)) - self.dither() + self.wait() class PhysicsExample(Scene): @@ -598,7 +598,7 @@ class PhysicsExample(Scene): MoveAlongPath(dot, parabola.copy(), **kwargs), ShowCreation(parabola, **kwargs) ) - self.dither() + self.wait() def velocity_vector(self, parabola): @@ -645,7 +645,7 @@ class PhysicsExample(Scene): ) for label in v_label, vx_label, vy_label: self.play(Write(label, run_time = 1)) - self.dither() + self.wait() def approximate_sine(self): approx = TexMobject("\\sin(\\theta) \\approx 0.7\\text{-ish}") @@ -663,7 +663,7 @@ class PhysicsExample(Scene): Write(approx), run_time = 2 ) - self.dither() + self.wait() class LinearAlgebraIntuitions(Scene): @@ -692,10 +692,10 @@ class LinearAlgebraIntuitions(Scene): mob.scale(0.7) mob.next_to(h_line, DOWN) self.play(FadeIn(mob)) - self.dither(4) + self.wait(4) self.play(FadeOut(mob)) self.remove(mob) - self.dither() + self.wait() class MatricesAre(Scene): def construct(self): @@ -708,13 +708,13 @@ class MatricesAre(Scene): self.play(Write(matrix, run_time = 1)) self.play(ShowCreation(arrow, submobject_mode = "one_at_a_time")) - self.dither() + self.wait() class ExampleTransformationForIntuitionList(LinearTransformationScene): def construct(self): self.setup() self.apply_matrix([[1, -1], [1, 2]]) - self.dither() + self.wait() class MatrixMultiplicationIs(Scene): def construct(self): @@ -741,22 +741,22 @@ class MatrixMultiplicationIs(Scene): Write(apply_first), run_time = 1 ) - self.dither() + self.wait() self.play( Write(matrix2), GrowFromCenter(brace2), Write(apply_second), run_time = 1 ) - self.dither() + self.wait() class ComposedTransformsForIntuitionList(LinearTransformationScene): def construct(self): self.setup() self.apply_matrix([[1, -1], [1, 2]]) - self.dither() + self.wait() self.apply_matrix([[2, 1], [1, 2]]) - self.dither() + self.wait() class DeterminantsAre(Scene): def construct(self): @@ -857,7 +857,7 @@ class TableOfContents(Scene): for chapter in chapters.split(): chapter.to_edge(LEFT, buff = 1) self.play(FadeIn(chapter)) - self.dither(2) + self.wait(2) entry3 = chapters.split()[2] added_words = TextMobject("(Personally, I'm most excited \\\\ to do this one)") @@ -873,7 +873,7 @@ class TableOfContents(Scene): Write(added_words), run_time = 1 ) - self.dither() + self.wait() removeable = VMobject(added_words, arrow, h_line, title) self.play(FadeOut(removeable)) self.remove(removeable) @@ -908,14 +908,14 @@ class TableOfContents(Scene): self.add(icons) self.play(FadeIn(randy)) self.play(Blink(randy)) - self.dither() + self.wait() self.play( ShowCreation(bubble), Transform(icons, new_icons) ) self.remove(icons) bubble.make_green_screen() - self.dither() + self.wait() class ResourceForTeachers(Scene): @@ -938,7 +938,7 @@ class ResourceForTeachers(Scene): self.play(FadeIn(bubble), Write(words), run_time = 3) for randy in np.array(randys.split())[[2,0,1]]: self.play(Blink(randy)) - self.dither() + self.wait() class AboutPacing(Scene): def construct(self): @@ -947,7 +947,7 @@ class AboutPacing(Scene): words.remove(*dots) self.play(FadeIn(words)) self.play(Write(VMobject(*dots))) - self.dither() + self.wait() class DifferingBackgrounds(Scene): def construct(self): @@ -982,8 +982,8 @@ class DifferingBackgrounds(Scene): ApplyMethod(student.change_mode, mode) ) self.play(Blink(student)) - self.dither() - self.dither() + self.wait() + self.wait() @@ -998,7 +998,7 @@ class PauseAndPonder(Scene): self.play(FadeIn(pause)) self.play(ShowCreation(bubble)) - self.dither() + self.wait() class NextVideo(Scene): @@ -1011,7 +1011,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() diff --git a/old_projects/eola/chapter1.py b/old_projects/eola/chapter1.py index c3e7732b..e4e4616e 100644 --- a/old_projects/eola/chapter1.py +++ b/old_projects/eola/chapter1.py @@ -55,9 +55,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(FadeIn(words)) - self.dither(1) + self.wait(1) self.play(Write(author, run_time = 4)) - self.dither() + self.wait() class DifferentConceptions(Scene): @@ -82,7 +82,7 @@ class DifferentConceptions(Scene): FadeIn(pi), run_time = 1 ) - self.dither(2) + self.wait(2) self.remove(symbol, coordinates) self.physics_conception(creatures, vector) self.cs_conception(creatures) @@ -110,7 +110,7 @@ class DifferentConceptions(Scene): Write(coordinates), Write(symbol) ) - self.dither(2) + self.wait(2) self.play( FadeOut(plane), FadeOut(labels), @@ -160,13 +160,13 @@ class DifferentConceptions(Scene): ) self.remove(original_vector) self.add(vector ) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(length), run_time = 1 ) - self.dither() + self.wait() self.remove(brace, length) self.play( Rotate(vector, np.pi/3, in_place = True), @@ -183,17 +183,17 @@ class DifferentConceptions(Scene): self.remove(direction) for point in 2*UP, 4*RIGHT, ORIGIN: self.play(ApplyMethod(vector.move_to, point)) - self.dither() + self.wait() self.play( Write(two_dimensional), ApplyMethod(physy.change_mode, "pondering"), ShowCreation(random_vectors, submobject_mode = "lagged_start"), run_time = 1 ) - self.dither(2) + self.wait(2) self.remove(random_vectors, vector) self.play(Transform(two_dimensional, three_dimensional)) - self.dither(5) + self.wait(5) self.remove(two_dimensional) self.restore_creatures(creatures) @@ -217,7 +217,7 @@ class DifferentConceptions(Scene): Write(title, run_time = 1) ) self.play(Write(vectors)) - self.dither() + self.wait() self.play(ApplyMethod(compy.change_mode, "pondering")) self.house_example(vectors, title) self.restore_creatures(creatures) @@ -268,7 +268,7 @@ class DifferentConceptions(Scene): self.play(Write(square_footage, run_time = 2)) self.add(price_words) self.play(Write(price, run_time = 2)) - self.dither() + self.wait() self.play( FadeOut(square_footage_words), FadeOut(price_words), Transform(square_footage, new_square_footage), @@ -277,22 +277,22 @@ class DifferentConceptions(Scene): run_time = 1 ) self.remove(square_footage_words, price_words) - self.dither() + self.wait() self.play( Write(not_equals), Write(alt_vector), run_time = 1 ) - self.dither() + self.wait() self.play(FadeOut(not_equals), FadeOut(alt_vector)) self.remove(not_equals, alt_vector) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(two_dimensional), run_time = 1 ) - self.dither() + self.wait() everything = VMobject( house, square_footage, price, brackets, brace, @@ -355,12 +355,12 @@ class DifferentConceptions(Scene): self.add_scaling(arrows, syms, arrays) self.play(Write(statement)) self.play(ApplyMethod(mathy.change_mode, "sad")) - self.dither() + self.wait() self.play( ShowCreation(circle), ApplyMethod(mathy.change_mode, "plain") ) - self.dither() + self.wait() def add_scaling(self, arrows, syms, arrays): @@ -390,7 +390,7 @@ class DifferentConceptions(Scene): Write(s_arrows), Write(s_arrays), Write(s_syms), run_time = 2 ) - self.dither() + self.wait() @@ -450,7 +450,7 @@ class HelpsToHaveOneThought(Scene): Transform(morty, new_morty), Write(words) ) - self.dither(2) + self.wait(2) self.play( FadeOut(speech_bubble), FadeOut(words), @@ -458,7 +458,7 @@ class HelpsToHaveOneThought(Scene): ShowCreation(thought_bubble), Write(thought) ) - self.dither(2) + self.wait(2) class HowIWantYouToThinkAboutVectors(Scene): @@ -481,25 +481,25 @@ class HowIWantYouToThinkAboutVectors(Scene): line = Line(tail_word, dot) self.play(ShowCreation(vector, submobject_mode = "one_at_a_time")) - self.dither(2) + self.wait(2) self.play( ShowCreation(plane, summobject_mode = "lagged_start"), Animation(vector) ) self.play(Write(axis_labels, run_time = 1)) - self.dither() + self.wait() self.play( GrowFromCenter(dot), ShowCreation(line), Write(tail_word, run_time = 1) ) - self.dither() + self.wait() self.play( FadeOut(tail_word), ApplyMethod(VMobject(dot, line).scale, 0.01) ) self.remove(tail_word, line, dot) - self.dither() + self.wait() self.play(ApplyMethod( vector.shift, shift_val, @@ -511,14 +511,14 @@ class HowIWantYouToThinkAboutVectors(Scene): rate_func = rush_into, run_time = 0.5 )) - self.dither(3) + self.wait(3) self.play(ShowCreation( other_vectors, submobject_mode = "one_at_a_time", run_time = 3 )) - self.dither(3) + self.wait(3) x_axis, y_axis = plane.get_axes().split() x_label = axis_labels.split()[0] @@ -539,7 +539,7 @@ class ListsOfNumbersAddOn(Scene): arrays.arrange_submobjects(buff = 0.4) arrays.scale(2) self.play(Write(arrays)) - self.dither(2) + self.wait(2) class CoordinateSystemWalkthrough(VectorScene): @@ -571,22 +571,22 @@ class CoordinateSystemWalkthrough(VectorScene): one = TexMobject("1").next_to(unit_brace, DOWN) self.add(x_axis, x_label) - self.dither() + self.wait() self.play(ShowCreation(y_axis)) self.play(Write(y_label, run_time = 1)) - self.dither(2) + self.wait(2) self.play( Write(origin_words), GrowFromCenter(dot), ShowCreation(line), run_time = 1 ) - self.dither(2) + self.wait(2) self.play( FadeOut(VMobject(origin_words, dot, line)) ) self.remove(origin_words, dot, line) - self.dither() + self.wait() self.play( ShowCreation(tick_marks, submobject_mode = "one_at_a_time") ) @@ -594,13 +594,13 @@ class CoordinateSystemWalkthrough(VectorScene): GrowFromCenter(unit_brace), Write(one, run_time = 1) ) - self.dither(2) + self.wait(2) self.remove(unit_brace, one) self.play( *map(GrowFromCenter, plane_lines) + [ Animation(x_axis), Animation(y_axis) ]) - self.dither() + self.wait() self.play( FadeOut(plane), Animation(VMobject(x_axis, y_axis, tick_marks)) @@ -632,24 +632,24 @@ class CoordinateSystemWalkthrough(VectorScene): self.play(ShowCreation(vector, submobject_mode = "one_at_a_time")) self.play(Write(array)) - self.dither(2) + self.wait(2) self.play(ApplyMethod(x_label_copy.next_to, x_line, DOWN)) self.play(ShowCreation(x_line)) - self.dither(2) + self.wait(2) self.play(ApplyMethod(y_label_copy.next_to, y_line, LEFT)) self.play(ShowCreation(y_line)) - self.dither(2) + self.wait(2) self.play(FadeIn(point)) - self.dither() + self.wait() self.play(ApplyFunction( lambda m : m.scale_in_place(1.25).highlight(YELLOW), array.get_brackets(), rate_func = there_and_back )) - self.dither() + self.wait() self.play(FadeOut(point)) self.remove(point) - self.dither() + self.wait() self.clear() self.add(*starting_mobjects) @@ -661,7 +661,7 @@ class WriteZ(Scene): z = TexMobject("z").highlight(Z_COLOR) z.scale_to_fit_height(4) self.play(Write(z, run_time = 2)) - self.dither(3) + self.wait(3) class Write3DVector(Scene): @@ -676,7 +676,7 @@ class Write3DVector(Scene): self.add(brackets) for mob in x, y, z: self.play(Write(mob), run_time = 2) - self.dither() + self.wait() class VectorAddition(VectorScene): @@ -692,13 +692,13 @@ class VectorAddition(VectorScene): v2 = self.add_vector([3, -1], color = MAROON_B) l1 = self.label_vector(v1, "v") l2 = self.label_vector(v2, "w") - self.dither() + self.wait() self.play(ApplyMethod(v2.shift, v1.get_end())) - self.dither() + self.wait() v_sum = self.add_vector(v2.get_end(), color = PINK) sum_tex = "\\vec{\\textbf{v}} + \\vec{\\textbf{w}}" self.label_vector(v_sum, sum_tex, rotate = True) - self.dither(3) + self.wait(3) return v1, v2, v_sum def ask_why(self, v1, v2, v_sum): @@ -721,19 +721,19 @@ class VectorAddition(VectorScene): why_not_this.shift(0.5*UP) self.play(Write(why, run_time = 1)) - self.dither(2) + self.wait(2) self.play( Transform(v2, new_v2), Transform(v_sum, new_v_sum), Transform(why, why_not_this) ) - self.dither(2) + self.wait(2) self.play( FadeOut(why), Transform(v_sum, original_v_sum) ) self.remove(why) - self.dither() + self.wait() def answer_why(self, v1, v2, v_sum): randy = Randolph(color = PINK) @@ -744,18 +744,18 @@ class VectorAddition(VectorScene): self.show_ghost_movement(v) self.remove(v) self.add(v1, v2 ) - self.dither() + self.wait() self.play(ApplyMethod(randy.scale, 0.3)) self.play(ApplyMethod(randy.shift, v1.get_end())) - self.dither() + self.wait() self.play(ApplyMethod(v2.shift, v1.get_end())) self.play(ApplyMethod(randy.move_to, v2.get_end())) - self.dither() + self.wait() self.remove(randy) randy.move_to(ORIGIN) self.play(FadeIn(v_sum)) self.play(ApplyMethod(randy.shift, v_sum.get_end())) - self.dither() + self.wait() class AddingNumbersOnNumberLine(Scene): @@ -778,15 +778,15 @@ class AddingNumbersOnNumberLine(Scene): sum_mob = TexMobject("2 + 5").shift(3*UP) self.play(ShowCreation(number_line, submobject_mode = "one_at_a_time")) - self.dither() + self.wait() self.play(Write(sum_mob, run_time = 2)) - self.dither() + self.wait() for vect, num in zip(vects, nums): self.play( ShowCreation(vect, submobject_mode = "one_at_a_time"), Write(num, run_time = 1) ) - self.dither() + self.wait() class VectorAdditionNumerically(VectorScene): @@ -810,7 +810,7 @@ class VectorAdditionNumerically(VectorScene): v2 = self.add_vector([3, -1], color = MAROON_B) coords2, x_line2, y_line2 = self.vector_to_coords(v2, clean_up = False) - self.dither() + self.wait() self.play( ApplyMethod(coords2.next_to, plus, RIGHT), Write(plus, run_time = 1), @@ -820,12 +820,12 @@ class VectorAdditionNumerically(VectorScene): ] ) equals.next_to(coords2, RIGHT) - self.dither() + self.wait() self.play(FadeIn(randy)) for step in [RIGHT, 2*UP, 3*RIGHT, DOWN]: self.play(ApplyMethod(randy.shift, step, run_time = 1.5)) - self.dither() + self.wait() self.play(ApplyMethod(randy.shift, -randy.get_bottom())) self.play(ApplyMethod(x_line2.shift, 2*DOWN)) @@ -845,7 +845,7 @@ class VectorAdditionNumerically(VectorScene): Write(three), run_time = 1 ) - self.dither() + self.wait() two_brace = Brace(y_line1, RIGHT) two = TexMobject("2").next_to(two_brace, RIGHT) @@ -856,14 +856,14 @@ class VectorAdditionNumerically(VectorScene): GrowFromCenter(two_brace), Write(two, run_time = 1) ) - self.dither() + self.wait() self.play( Transform(two_brace, two_minus_one_brace), Transform(two, two_minus_one), Transform(y_line1, new_y_line), Transform(y_line2, new_y_line) ) - self.dither() + self.wait() self.add_vector(v2.get_end(), color = PINK ) sum_coords = Matrix(["1+3", "2+(-1)"]) @@ -882,7 +882,7 @@ class VectorAdditionNumerically(VectorScene): run_time = 1 ) self.play(Transform(sum_y_start, sum_y)) - self.dither(2) + self.wait(2) starters = [x1, y1, x2, y2, sum_x_start, sum_y_start] variables = map(TexMobject, [ @@ -904,14 +904,14 @@ class VectorAdditionNumerically(VectorScene): FadeOut(sum_y_start) ) sum_x_end, sum_y_end = variables[-2:] - self.dither(2) + self.wait(2) self.play( Transform(VMobject(x1, x2).copy(), sum_x_end) ) self.play( Transform(VMobject(y1, y2).copy(), sum_y_end) ) - self.dither(3) + self.wait(3) class MultiplicationByANumberIntro(Scene): def construct(self): @@ -930,7 +930,7 @@ class MultiplicationByANumberIntro(Scene): else: self.play(FadeIn(num)) last = num - self.dither() + self.wait() class ShowScalarMultiplication(VectorScene): def construct(self): @@ -976,7 +976,7 @@ class ShowScalarMultiplication(VectorScene): self.play(Write(factor_mob, run_time = 1)) - self.dither() + self.wait() self.play( ApplyMethod(v.copy().highlight, DARK_GREY), ApplyMethod(v_label.copy().highlight, DARK_GREY), @@ -984,7 +984,7 @@ class ShowScalarMultiplication(VectorScene): Transform(v.copy(), scaled_vector), Transform(v_label.copy(), label_remainder), ) - self.dither(2) + self.wait(2) self.clear() self.add(*starting_mobjects) @@ -1013,10 +1013,10 @@ class ShowScalarMultiplication(VectorScene): ) self.play(Transform(v, long_minus_v, run_time = 3)) self.play(Write(scalars)) - self.dither() + self.wait() self.play(Write(scalars_word)) self.play(Transform(v, original_v), run_time = 3) - self.dither(2) + self.wait(2) class ScalingNumerically(VectorScene): def construct(self): @@ -1041,7 +1041,7 @@ class ScalingNumerically(VectorScene): ApplyMethod(two_v_coords.next_to, equals, RIGHT), Write(equals, run_time = 1) ) - self.dither(2) + self.wait(2) x, y = v_coords.get_mob_matrix().flatten() two_v_elems = two_v_coords.get_mob_matrix().flatten() @@ -1058,7 +1058,7 @@ class ScalingNumerically(VectorScene): Transform(y, y_sym), FadeOut(VMobject(*two_v_elems)) ) - self.dither() + self.wait() self.play( Transform( VMobject(two_dot.copy(), x.copy()), @@ -1069,7 +1069,7 @@ class ScalingNumerically(VectorScene): two_y_sym ) ) - self.dither(2) + self.wait(2) @@ -1095,7 +1095,7 @@ class FollowingVideos(UpcomingSeriesOfVidoes): UpcomingSeriesOfVidoes.construct(self) last_video = self.mobjects[-1] self.play(ApplyMethod(last_video.highlight, YELLOW)) - self.dither() + self.wait() everything = VMobject(*self.mobjects) everything.remove(last_video) big_last_video = last_video.copy() @@ -1145,7 +1145,7 @@ class ItDoesntMatterWhich(Scene): back_and_forth.arrange_submobjects(LEFT).center() - self.dither() + self.wait() self.play( ApplyMethod(physy.change_mode, "speaking"), ShowCreation(physy_speech), @@ -1160,14 +1160,14 @@ class ItDoesntMatterWhich(Scene): ShowCreation(compy_speech), Transform(physy_statement, compy_statement, path_arc = np.pi) ) - self.dither(2) + self.wait(2) self.play( ApplyMethod(physy.change_mode, "pondering"), ApplyMethod(compy.change_mode, "pondering"), Transform(compy_speech, VectorizedPoint(compy_speech.get_tip())), Transform(physy_statement, back_and_forth) ) - self.dither() + self.wait() class DataAnalyst(Scene): @@ -1195,20 +1195,20 @@ class DataAnalyst(Scene): vects = VMobject(*map(Vector, ellipse_points)) self.play(Write(string_vects)) - self.dither(2) + self.wait(2) self.play( FadeIn(plane), Transform(string_vects, vects) ) self.remove(string_vects) self.add(vects) - self.dither() + self.wait() self.play( ApplyMethod(plane.fade, 0.7), ApplyMethod(vects.highlight, DARK_GREY), ShowCreation(ellipse) ) - self.dither(3) + self.wait(3) class ManipulateSpace(LinearTransformationScene): @@ -1246,15 +1246,15 @@ class ManipulateSpace(LinearTransformationScene): self.play(Blink(pi_creature)) self.plane.add(pi_creature) self.play(Homotopy(plane_wave_homotopy, self.plane, run_time = 3)) - self.dither(2) + self.wait(2) self.apply_matrix([[2, 1], [1, 2]]) - self.dither() + self.wait() self.play( FadeOut(self.plane), Write(matrix_rule), run_time = 2 ) - self.dither() + self.wait() class CodingMathyAnimation(Scene): pass @@ -1269,7 +1269,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() diff --git a/old_projects/eola/chapter10.py b/old_projects/eola/chapter10.py index 6a76d93c..2fde6a8b 100644 --- a/old_projects/eola/chapter10.py +++ b/old_projects/eola/chapter10.py @@ -48,9 +48,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(Write(words, run_time = 10)) - self.dither() + self.wait() self.play(FadeIn(author)) - self.dither(3) + self.wait(3) class StudentsFindThisConfusing(TeacherStudentsScene): def construct(self): @@ -151,9 +151,9 @@ class ManyPrerequisites(Scene): rects.next_to(h_line, DOWN, buff = MED_SMALL_BUFF) self.play(Write(rects[0])) - self.dither() + self.wait() self.play(*map(FadeIn, rects[1:])) - self.dither() + self.wait() class ExampleTranformationScene(LinearTransformationScene): CONFIG = { @@ -191,7 +191,7 @@ class IntroduceExampleTransformation(ExampleTranformationScene): coords.add_to_back(coords.rect) coords.next_to(vect.get_end(), RIGHT) self.play(Write(coords)) - self.dither() + self.wait() i_coords_copy = i_coords.copy() self.play(*[ Transform(*pair) @@ -210,7 +210,7 @@ class IntroduceExampleTransformation(ExampleTranformationScene): VGroup(*self.matrix.get_mob_matrix()[:,1]) )) to_remove += self.get_mobjects_from_last_animation() - self.dither() + self.wait() self.remove(*to_remove) self.add(self.matrix) @@ -231,17 +231,17 @@ class VectorKnockedOffSpan(ExampleTranformationScene): text.add_to_back(BackgroundRectangle(text)) self.add_vector(vector) - self.dither() + self.wait() self.play( ShowCreation(line), Write(span_label), Animation(vector), ) self.add_foreground_mobject(span_label) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) self.play(Animation(span_label.copy()), Write(all_words)) - self.dither() + self.wait() class VectorRemainsOnSpan(ExampleTranformationScene): def construct(self): @@ -255,17 +255,17 @@ class VectorRemainsOnSpan(ExampleTranformationScene): self.add_vector(vector) self.play(ShowCreation(line), Animation(vector)) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) self.play(Write(words)) - self.dither() + self.wait() target_vectors = [ vector.copy().scale(scalar) for scalar in 2, -2, 1 ] for target, time in zip(target_vectors, [1, 2, 2]): self.play(Transform(vector, target, run_time = time)) - self.dither() + self.wait() class IHatAsEigenVector(ExampleTranformationScene): def construct(self): @@ -281,9 +281,9 @@ class IHatAsEigenVector(ExampleTranformationScene): self.play(faders.fade, 0.7, Animation(self.matrix)) self.play(column1.scale_in_place, 1.3, rate_func = there_and_back) - self.dither() + self.wait() self.play(faders.restore, Animation(self.matrix)) - self.dither() + self.wait() def highlight_x_axis(self): x_axis = self.plane.axes[0] @@ -300,7 +300,7 @@ class IHatAsEigenVector(ExampleTranformationScene): ShowCreation(line), Transform(self.i_hat, target), ) - self.dither() + self.wait() self.remove(*lines) x_axis.highlight(YELLOW) @@ -322,7 +322,7 @@ class IHatAsEigenVector(ExampleTranformationScene): array.get_entries() ), ) - self.dither() + self.wait() class AllXAxisVectorsAreEigenvectors(ExampleTranformationScene): def construct(self): @@ -333,9 +333,9 @@ class AllXAxisVectorsAreEigenvectors(ExampleTranformationScene): ]) vectors.gradient_highlight(YELLOW, X_COLOR) self.play(ShowCreation(vectors)) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix, path_arc = 0) - self.dither() + self.wait() class SneakierEigenVector(ExampleTranformationScene): def construct(self): @@ -363,7 +363,7 @@ class SneakierEigenVector(ExampleTranformationScene): Animation(vector), Animation(array), ) - self.dither() + self.wait() self.apply_transposed_matrix( self.t_matrix, added_anims = [ @@ -372,7 +372,7 @@ class SneakierEigenVector(ExampleTranformationScene): ], path_arc = 0, ) - self.dither() + self.wait() class FullSneakyEigenspace(ExampleTranformationScene): def construct(self): @@ -393,13 +393,13 @@ class FullSneakyEigenspace(ExampleTranformationScene): words.start.set_fill(opacity = 0) self.play(ShowCreation(vectors)) - self.dither() + self.wait() self.apply_transposed_matrix( self.t_matrix, added_anims = [Transform(words.start, words)], path_arc = 0 ) - self.dither() + self.wait() class NameEigenvectorsAndEigenvalues(ExampleTranformationScene): CONFIG = { @@ -466,11 +466,11 @@ class NameEigenvectorsAndEigenvalues(ExampleTranformationScene): for vectors in x_vectors, sneak_vectors: self.play(ShowCreation(vectors, run_time = 1)) - self.dither() + self.wait() for words in x_words, sneak_words: self.play(Write(words, run_time = 1.5)) self.add_foreground_mobject(words) - self.dither() + self.wait() self.play(ShowCreation(non_eigen)) self.play( ShowCreation(non_eigen_span), @@ -478,19 +478,19 @@ class NameEigenvectorsAndEigenvalues(ExampleTranformationScene): Animation(non_eigen) ) self.add_vector(non_eigen, animate = False) - self.dither() + self.wait() self.apply_transposed_matrix( self.t_matrix, added_anims = [FadeOut(non_eigen_words)], path_arc = 0, ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [non_eigen, non_eigen_span])) self.play(*map(MoveToTarget, [x_words, sneak_words])) - self.dither() + self.wait() for words in x_words, sneak_words: self.play(Write(words.eigen_val_words), run_time = 2) - self.dither() + self.wait() class CanEigenvaluesBeNegative(TeacherStudentsScene): def construct(self): @@ -533,24 +533,24 @@ class EigenvalueNegativeOneHalf(LinearTransformationScene): Animation(vector), Animation(words), ) - self.dither() + self.wait() self.apply_transposed_matrix( self.t_matrix, added_anims = [FadeOut(words)] ) - self.dither() + self.wait() self.play( Rotate(span, np.pi/12, rate_func = wiggle), Animation(vector), ) - self.dither() + self.wait() class ThreeDRotationTitle(Scene): def construct(self): title = TextMobject("3D Rotation") title.scale(2) self.play(Write(title)) - self.dither() + self.wait() class ThreeDShowRotation(Scene): pass @@ -567,16 +567,16 @@ class EigenvectorToAxisOfRotation(Scene): for word in words: word.scale(2) self.play(Write(words[0])) - self.dither() + self.wait() self.play(Transform(*words)) - self.dither() + self.wait() class EigenvalueOne(Scene): def construct(self): text = TextMobject("Eigenvalue = $1$") text.highlight(MAROON_B) self.play(Write(text)) - self.dither() + self.wait() class ContrastMatrixUnderstandingWithEigenvalue(TeacherStudentsScene): def construct(self): @@ -652,7 +652,7 @@ class DeduceTransformationFromMatrix(ColumnsToBasisVectors): words.next_to(ORIGIN, DOWN+LEFT, buff = MED_SMALL_BUFF) words.shift_onto_screen() self.play(Write(words)) - self.dither() + self.wait() class WordsOnComputation(TeacherStudentsScene): def construct(self): @@ -708,22 +708,22 @@ class SymbolicEigenvectors(Scene): ]) self.play(Write(self.expression)) - self.dither() + self.wait() self.play( GrowFromCenter(A_brace), Write(A_text) ) - self.dither() + self.wait() self.play( Write(v_text), ShowCreation(v_arrows) ) - self.dither() + self.wait() self.play( GrowFromCenter(lamb_brace), Write(lamb_text) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ A_brace, A_text, lamb_brace, lamb_text, @@ -748,7 +748,7 @@ class SymbolicEigenvectors(Scene): Write(group.text, run_time = 2) ) self.play(group.scale_in_place, 1.2, rate_func = there_and_back) - self.dither() + self.wait() morty = Mortimer().to_edge(DOWN) morty.change_mode("speaking") @@ -768,14 +768,14 @@ class SymbolicEigenvectors(Scene): Write(solve_text) ) self.play(Blink(morty)) - self.dither(2) + self.wait(2) bubble.write("Fix different", "\\\\ multiplication", "types") self.play( Transform(solve_text, bubble.content), morty.change_mode, "sassy" ) self.play(Blink(morty)) - self.dither() + self.wait() self.play(*map(FadeOut, [ left_group.brace, left_group.text, right_group.brace, right_group.text, @@ -836,7 +836,7 @@ class SymbolicEigenvectors(Scene): q_marks, ), run_time = 2 )) - self.dither() + self.wait() self.play(Transform( q_marks, matrix.get_entries(), submobject_mode = "lagged_start", @@ -844,7 +844,7 @@ class SymbolicEigenvectors(Scene): )) self.remove(q_marks) self.add(*matrix.get_entries()) - self.dither() + self.wait() self.play( Transform(diag_entries.copy(), new_lamb), diag_entries.restore @@ -855,7 +855,7 @@ class SymbolicEigenvectors(Scene): GrowFromCenter(id_brace), Write(id_text) ) - self.dither() + self.wait() id_text_copy = id_text.copy() self.add(id_text_copy) @@ -870,7 +870,7 @@ class SymbolicEigenvectors(Scene): Write(parens), *map(MoveToTarget, [lamb, id_text, v2]) ) - self.dither() + self.wait() self.play(*map(FadeOut, [ corner_group, id_brace, id_text_copy, new_lamb ])) @@ -901,7 +901,7 @@ class SymbolicEigenvectors(Scene): *map(MoveToTarget, movers), path_arc = np.pi/3 ) - self.dither() + self.wait() A.target.next_to(minus, LEFT) l_paren.target = l_paren.copy() l_paren.target.next_to(A.target, LEFT) @@ -911,7 +911,7 @@ class SymbolicEigenvectors(Scene): Transform(v1, v2, path_arc = np.pi/3) ) self.remove(v1) - self.dither() + self.wait() brace = Brace(VGroup(l_paren, r_paren)) brace.text = TextMobject("This matrix looks \\\\ something like") @@ -936,7 +936,7 @@ class SymbolicEigenvectors(Scene): Write(brace.text), Write(matrix) ) - self.dither() + self.wait() vect_words = TextMobject( "We want a nonzero solution for" @@ -949,7 +949,7 @@ class SymbolicEigenvectors(Scene): Write(vect_words), ShowCreation(arrow) ) - self.dither() + self.wait() def bring_in_determinant(self): randy = Randolph(mode = "speaking").to_edge(DOWN) @@ -971,7 +971,7 @@ class SymbolicEigenvectors(Scene): Write(words) ) self.play(Blink(randy)) - self.dither() + self.wait() everything = self.get_mobjects() equation_copy = equation.copy() self.play( @@ -982,7 +982,7 @@ class SymbolicEigenvectors(Scene): equation_copy.center, equation_copy.scale, 1.5 ) - self.dither() + self.wait() class NonZeroSolutionsVisually(LinearTransformationScene): CONFIG = { @@ -1014,14 +1014,14 @@ class NonZeroSolutionsVisually(LinearTransformationScene): self.add_foreground_mobject(equation) v = self.add_vector(self.v_coords) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() transform = Transform( equation_matrix.copy(), det_equation_matrix ) self.play(Write(det_equation), transform) - self.dither() + self.wait() class TweakLambda(LinearTransformationScene): CONFIG = { @@ -1084,16 +1084,16 @@ class TweakLambda(LinearTransformationScene): Write(det) ) self.matrix.add(det_text, equals, det.rect) - self.dither() + self.wait() self.range_lambda(0, 3, run_time = 5) - self.dither() + self.wait() self.range_lambda(3, 0.5, run_time = 5) - self.dither() + self.wait() self.range_lambda(0.5, 1.5, run_time = 3) - self.dither() + self.wait() self.range_lambda(1.5, 1, run_time = 2) - self.dither() + self.wait() def get_t_matrix(self, lambda_val): return self.t_matrix - lambda_val*np.identity(2) @@ -1146,7 +1146,7 @@ class TweakLambda(LinearTransformationScene): self.det = new_det self.add(self.det) - self.dither(self.frame_duration) + self.wait(self.frame_duration) class ShowEigenVectorAfterComputing(LinearTransformationScene): CONFIG = { @@ -1189,9 +1189,9 @@ class ShowEigenVectorAfterComputing(LinearTransformationScene): self.play(Write(v_label)) self.add_foreground_mobject(v_label) self.play(ShowCreation(line), Animation(v)) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() class LineOfReasoning(Scene): def construct(self): @@ -1212,7 +1212,7 @@ class LineOfReasoning(Scene): expression.highlight_by_tex(v_tex, YELLOW) expression.highlight_by_tex("\\lambda", MAROON_B) self.play(FadeIn(expression)) - self.dither() + self.wait() class IfYouDidntKnowDeterminants(TeacherStudentsScene): def construct(self): @@ -1243,10 +1243,10 @@ class RevisitExampleTransformation(ExampleTranformationScene): words.arrange_submobjects() words.next_to(self.matrix, DOWN, buff = LARGE_BUFF) self.play(Write(words)) - self.dither() + self.wait() self.play(*self.get_lambda_to_diag_movements(lamb.copy())) self.add_foreground_mobject(*self.get_mobjects_from_last_animation()) - self.dither() + self.wait() self.show_determinant(to_fade = words) self.show_diagonally_altered_transform() self.show_unaltered_transform() @@ -1273,7 +1273,7 @@ class RevisitExampleTransformation(ExampleTranformationScene): Write(i_coords), Write(j_coords), ) - self.dither() + self.wait() self.play(*[ Transform(*pair) for pair in [ @@ -1295,7 +1295,7 @@ class RevisitExampleTransformation(ExampleTranformationScene): ), ) to_remove += self.get_mobjects_from_last_animation() - self.dither() + self.wait() self.remove(*to_remove) self.add_foreground_mobject(self.matrix) @@ -1383,14 +1383,14 @@ class RevisitExampleTransformation(ExampleTranformationScene): Write(det_text), Write(equals) ) - self.dither() + self.wait() self.play( Write(parens), MoveToTarget(three_minus_lamb), MoveToTarget(two_minus_lamb), run_time = 2 ) - self.dither() + self.wait() self.play( FadeIn(new_rect), MoveToTarget(one), @@ -1403,19 +1403,19 @@ class RevisitExampleTransformation(ExampleTranformationScene): GrowFromCenter(brace), Write(brace_text) ) - self.dither() + self.wait() self.play(*it.chain( map(MoveToTarget, [brace, brace_text]), map(FadeOut, [one, zero, minus, cdot, new_rect]) )) - self.dither() + self.wait() self.play(Write(equals_0)) - self.dither() + self.wait() self.play( Transform(brace, final_brace), Transform(brace_text, final_text) ) - self.dither() + self.wait() faders = [ det_text, equals, parens, three_minus_lamb, two_minus_lamb, @@ -1432,7 +1432,7 @@ class RevisitExampleTransformation(ExampleTranformationScene): )) self.add_foreground_mobject(lambda_equals_two) self.lambda_equals_two = lambda_equals_two - self.dither() + self.wait() def show_diagonally_altered_transform(self): for entry in self.diag_entries: @@ -1457,7 +1457,7 @@ class RevisitExampleTransformation(ExampleTranformationScene): equals.add_background_rectangle() zero_array.next_to(equals) self.play(*map(Write, [xy_array, equals, zero_array])) - self.dither() + self.wait() vectors = VGroup(*[ self.add_vector(u*x*(LEFT+UP), animate = False) @@ -1474,11 +1474,11 @@ class RevisitExampleTransformation(ExampleTranformationScene): ), *map(Animation, self.foreground_mobjects) ) - self.dither() + self.wait() self.apply_transposed_matrix( self.t_matrix - 2*np.identity(2) ) - self.dither() + self.wait() self.play(*it.chain( [mob.restore for mob in self.plane, self.i_hat, self.j_hat, vectors], map(FadeOut, [xy_array, equals, zero_array]), @@ -1506,9 +1506,9 @@ class RevisitExampleTransformation(ExampleTranformationScene): )) VGroup(*faders).set_fill(opacity = 0) self.add_foreground_mobject(brace) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() class ThereMightNotBeEigenvectors(TeacherStudentsScene): def construct(self): @@ -1540,9 +1540,9 @@ class Rotate90Degrees(LinearTransformationScene): self.add_foreground_mobject(line) def construct(self): - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() class Rotate90DegreesWithVector(Rotate90Degrees): CONFIG = { @@ -1552,7 +1552,7 @@ class Rotate90DegreesWithVector(Rotate90Degrees): class SolveRotationEigenvalues(Rotate90Degrees): def construct(self): self.apply_transposed_matrix(self.t_matrix, run_time = 0) - self.dither() + self.wait() diag_entries = [ self.matrix.get_mob_matrix()[i, i] for i in range(2) @@ -1566,12 +1566,12 @@ class SolveRotationEigenvalues(Rotate90Degrees): minus_lambda.highlight(MAROON_B) minus_lambda.move_to(entry) self.play(Transform(entry, minus_lambda)) - self.dither() + self.wait() det_text = get_det_text(self.matrix) equals = TexMobject("=").next_to(det_text) self.play(*map(Write, [det_text, equals])) - self.dither() + self.wait() minus = TexMobject("-") for entries, sym in (diag_entries, equals), (off_diag_entries, minus): lp1, rp1, lp2, rp2 = parens = TexMobject("()()") @@ -1589,7 +1589,7 @@ class SolveRotationEigenvalues(Rotate90Degrees): *[MoveToTarget(entry.copy()) for entry in entries], run_time = 2 ) - self.dither() + self.wait() if entries == diag_entries: minus.next_to(parens) self.play(Write(minus)) @@ -1600,7 +1600,7 @@ class SolveRotationEigenvalues(Rotate90Degrees): polynomial.add_background_rectangle() polynomial.next_to(equals, DOWN, buff = MED_LARGE_BUFF, aligned_edge = LEFT) self.play(Write(polynomial)) - self.dither() + self.wait() result = TexMobject( "\\lambda", "= i", "\\text{ or }", @@ -1610,7 +1610,7 @@ class SolveRotationEigenvalues(Rotate90Degrees): result.add_background_rectangle() result.next_to(polynomial, DOWN, buff = MED_LARGE_BUFF, aligned_edge = LEFT) self.play(Write(result)) - self.dither() + self.wait() interesting_tidbit = TextMobject(""" Interestingly, though, the fact that multiplication by i @@ -1626,7 +1626,7 @@ class SolveRotationEigenvalues(Rotate90Degrees): interesting_tidbit.scale_to_fit_height(SPACE_HEIGHT-0.5) interesting_tidbit.to_corner(DOWN+RIGHT) self.play(FadeIn(interesting_tidbit)) - self.dither() + self.wait() class ShearExample(RevisitExampleTransformation): CONFIG = { @@ -1648,7 +1648,7 @@ class ShearExample(RevisitExampleTransformation): self.play(FadeIn(lamb)) self.play(*self.get_lambda_to_diag_movements(lamb)) self.add_foreground_mobject(*self.get_mobjects_from_last_animation()) - self.dither() + self.wait() self.show_determinant() def point_out_eigenvectors(self): @@ -1669,7 +1669,7 @@ class ShearExample(RevisitExampleTransformation): words.next_to(ORIGIN, DOWN+RIGHT, buff = MED_SMALL_BUFF) self.play(ShowCreation(vectors), run_time = 2) self.play(Write(words)) - self.dither() + self.wait() def show_determinant(self): det_text = get_det_text(self.matrix) @@ -1720,14 +1720,14 @@ class ShearExample(RevisitExampleTransformation): Write(det_text), Write(equals) ) - self.dither() + self.wait() self.play( Write(parens), MoveToTarget(three_minus_lamb), MoveToTarget(two_minus_lamb), run_time = 2 ) - self.dither() + self.wait() self.play( FadeIn(new_rect), MoveToTarget(one), @@ -1740,18 +1740,18 @@ class ShearExample(RevisitExampleTransformation): GrowFromCenter(brace), Write(brace_text) ) - self.dither() + self.wait() self.play(* map(FadeOut, [ one, zero, minus, cdot, new_rect, brace, brace_text ])) - self.dither() + self.wait() self.play(Write(equals_0)) - self.dither() + self.wait() self.play( FadeIn(final_brace), FadeIn(final_text) ) - self.dither() + self.wait() # faders = [ # det_text, equals, parens, # three_minus_lamb, two_minus_lamb, @@ -1768,7 +1768,7 @@ class ShearExample(RevisitExampleTransformation): # )) # self.add_foreground_mobject(lambda_equals_two) # self.lambda_equals_two = lambda_equals_two - # self.dither() + # self.wait() class EigenvalueCanHaveMultipleEigenVectors(TeacherStudentsScene): def construct(self): @@ -1796,9 +1796,9 @@ class ScalingExample(LinearTransformationScene): self.add_foreground_mobject(matrix, words) for coords in [2, 1], [-2.5, -1], [1, -1]: self.add_vector(coords, color = random_color()) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() class IntroduceEigenbasis(TeacherStudentsScene): def construct(self): @@ -1849,11 +1849,11 @@ class BasisVectorsAreEigenvectors(LinearTransformationScene): self.play(Write(words)) self.add_foreground_mobject(words) - self.dither() + self.wait() self.apply_transposed_matrix([self.t_matrix[0], [0, 1]]) - self.dither() + self.wait() self.apply_transposed_matrix([[1, 0], self.t_matrix[1]]) - self.dither() + self.wait() i_coords = Matrix(self.t_matrix[0]) i_coords.next_to(self.i_hat.get_end(), DOWN+LEFT) @@ -1866,7 +1866,7 @@ class BasisVectorsAreEigenvectors(LinearTransformationScene): array.rect = BackgroundRectangle(array) array.add_to_back(array.rect) self.play(*map(Write, [i_coords, j_coords])) - self.dither() + self.wait() self.play( Transform(i_coords.rect, matrix.rect), Transform(i_coords.get_brackets(), matrix.get_brackets()), @@ -1883,7 +1883,7 @@ class BasisVectorsAreEigenvectors(LinearTransformationScene): ) self.remove(i_coords, j_coords) self.add(matrix) - self.dither() + self.wait() diag_entries = VGroup(*[ @@ -1901,7 +1901,7 @@ class BasisVectorsAreEigenvectors(LinearTransformationScene): run_time = 2, rate_func = there_and_back ) - self.dither() + self.wait() class DefineDiagonalMatrix(Scene): def construct(self): @@ -1925,27 +1925,27 @@ class DefineDiagonalMatrix(Scene): title.to_edge(UP) self.add(matrix) - self.dither() + self.wait() for entries in off_diag_entries, diag_entries: self.play( entries.scale_in_place, 1.1, entries.highlight, YELLOW, rate_func = there_and_back, ) - self.dither() + self.wait() self.play(Write(title)) - self.dither() + self.wait() self.play( matrix.highlight_columns, X_COLOR, Y_COLOR, Z_COLOR, YELLOW ) - self.dither() + self.wait() self.play(diag_entries.highlight, MAROON_B) self.play( diag_entries.scale_in_place, 1.1, rate_func = there_and_back, ) - self.dither() + self.wait() class RepeatedMultiplicationInAction(Scene): def construct(self): @@ -1966,12 +1966,12 @@ class RepeatedMultiplicationInAction(Scene): self.add(vector) self.play(*map(FadeIn, [matrix]+scalars)) - self.dither() + self.wait() self.play( FadeOut(matrix), *map(MoveToTarget, scalars + [l_bracket]) ) - self.dither() + self.wait() #nth multiplications for scalar in scalars: scalar.exp = VectorizedPoint(scalar.get_corner(UP+RIGHT)) @@ -1998,13 +1998,13 @@ class RepeatedMultiplicationInAction(Scene): movers.append(l_bracket) self.play(*map(FadeIn, [matrix]+new_scalars)) - self.dither() + self.wait() self.play( FadeOut(matrix), *map(MoveToTarget, movers) ) self.remove(*to_remove) - self.dither() + self.wait() def get_matrix(self, vector): @@ -2044,12 +2044,12 @@ class RepeatedMultilpicationOfMatrices(Scene): self.add(vector) for matrix in reversed(list(matrices)): self.play(FadeIn(matrix)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(brace_text) ) - self.dither() + self.wait() if self.diagonal: last_matrix.target = last_matrix.copy() @@ -2071,15 +2071,15 @@ class RepeatedMultilpicationOfMatrices(Scene): map(FadeOut, [brace, brace_text[1]] + list(matrices[:-1])), map(MoveToTarget, [hundred, hundred_copy, last_matrix]) ), run_time = 2) - self.dither() + self.wait() else: randy = Randolph().to_corner() self.play(FadeIn(randy)) self.play(randy.change_mode, "angry") self.play(Blink(randy)) - self.dither() + self.wait() self.play(Blink(randy)) - self.dither() + self.wait() class RepeatedMultilpicationOfNonDiagonalMatrices(RepeatedMultilpicationOfMatrices): CONFIG = { @@ -2107,7 +2107,7 @@ class LastVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class ChangeToEigenBasis(ExampleTranformationScene): CONFIG = { @@ -2139,7 +2139,7 @@ class ChangeToEigenBasis(ExampleTranformationScene): self.remove(x_vectors, v_vectors) self.play(ShowCreation(x_vectors, run_time = 2)) self.play(ShowCreation(v_vectors, run_time = 2)) - self.dither() + self.wait() self.plane.save_state() self.apply_transposed_matrix( self.t_matrix, @@ -2165,9 +2165,9 @@ class ChangeToEigenBasis(ExampleTranformationScene): Animation(x_vector), Animation(v_vector), ) - self.dither() + self.wait() self.play(Transform(words, new_words)) - self.dither() + self.wait() self.b1, self.b2 = x_vector, v_vector self.moving_vectors = [self.b1, self.b2] self.to_fade = [words] @@ -2183,7 +2183,7 @@ class ChangeToEigenBasis(ExampleTranformationScene): b2.coords.next_to(b2.get_end(), LEFT) for vect in b1, b2: self.play(Write(vect.coords)) - self.dither() + self.wait() cob_matrix = Matrix(np.array([ list(vect.entries.target) @@ -2217,7 +2217,7 @@ class ChangeToEigenBasis(ExampleTranformationScene): Write(brace_text) ) self.to_fade += [brace, brace_text] - self.dither() + self.wait() inv_cob = cob_matrix.copy() inv_cob.target = inv_cob.copy() @@ -2234,10 +2234,10 @@ class ChangeToEigenBasis(ExampleTranformationScene): MoveToTarget(inv_cob, path_arc = -np.pi/2), Write(neg_1) ) - self.dither() + self.wait() self.add_foreground_mobject(cob_matrix, inv_cob, neg_1) self.play(*map(FadeOut, self.to_fade)) - self.dither() + self.wait() self.play(FadeOut(self.plane)) cob_transform = self.get_matrix_transformation([[1, 0], [-1, 1]]) ApplyMethod(self.plane.apply_function, cob_transform).update(1) @@ -2260,13 +2260,13 @@ class ChangeToEigenBasis(ExampleTranformationScene): Write(equals), Write(final_matrix) ) - self.dither() + self.wait() eigenbasis = TextMobject("``Eigenbasis''") eigenbasis.add_background_rectangle() eigenbasis.next_to(ORIGIN, DOWN) self.play(Write(eigenbasis)) - self.dither() + self.wait() def ask_about_power(self): morty = Mortimer() @@ -2291,7 +2291,7 @@ class ChangeToEigenBasis(ExampleTranformationScene): ) for x in range(2): self.play(Blink(morty)) - self.dither(2) + self.wait(2) class CannotDoWithWithAllTransformations(TeacherStudentsScene): def construct(self): diff --git a/old_projects/eola/chapter11.py b/old_projects/eola/chapter11.py index 91b93d86..f3ca6cbe 100644 --- a/old_projects/eola/chapter11.py +++ b/old_projects/eola/chapter11.py @@ -68,9 +68,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = MED_LARGE_BUFF) self.play(Write(words, run_time = 8)) - self.dither() + self.wait() self.play(FadeIn(author)) - self.dither(3) + self.wait(3) class RevisitOriginalQuestion(TeacherStudentsScene): def construct(self): @@ -125,7 +125,7 @@ class WhatIsA2DVector(LinearTransformationScene): Write(coords), run_time = 2 ) - self.dither() + self.wait() self.v, self.coords = v, coords def bring_in_students(self): @@ -143,7 +143,7 @@ class WhatIsA2DVector(LinearTransformationScene): ) self.play(*map(FadeIn, students)) self.play(Blink(physics_student)) - self.dither() + self.wait() for student, vect in zip(students, [RIGHT, LEFT]): for mob in v, coords: mob.target = mob.copy() @@ -163,7 +163,7 @@ class WhatIsA2DVector(LinearTransformationScene): Transform(student.coords, coords.target), ) self.play(Blink(student)) - self.dither() + self.wait() anims = [] for student in students: v, coords = student.v, student.coords @@ -188,7 +188,7 @@ class WhatIsA2DVector(LinearTransformationScene): self.play(*anims) for student in students: self.play(Blink(student)) - self.dither() + self.wait() self.play(*it.chain( map(FadeOut, everything + [ physics_student.bubble, @@ -212,7 +212,7 @@ class WhatIsA2DVector(LinearTransformationScene): Write(bubble.content) ) self.play(Blink(physics_student)) - self.dither() + self.wait() class HigherDimensionalVectorsNumerically(Scene): def construct(self): @@ -237,7 +237,7 @@ class HigherDimensionalVectorsNumerically(Scene): for word in words: self.play(FadeIn(word)) self.play(Write(vectors)) - self.dither() + self.wait() for index, dim, direction in (0, 4, RIGHT), (2, 100, LEFT): v = vectors[index] v.target = v.copy() @@ -265,7 +265,7 @@ class HigherDimensionalVectorsNumerically(Scene): ) for i in range(num_entries) ]) - self.dither() + self.wait() class HyperCube(VMobject): CONFIG = { @@ -330,9 +330,9 @@ class AskAbout4DPhysicsStudent(Scene): if i%2 == 1: self.play(Blink(physy)) else: - self.dither() + self.wait() self.play(Blink(compy)) - self.dither() + self.wait() class ManyCoordinateSystems(LinearTransformationScene): CONFIG = { @@ -404,11 +404,11 @@ class ManyCoordinateSystems(LinearTransformationScene): ) self.play(Write(array, run_time = 1)) - self.dither() + self.wait() self.play(*map(MoveToTarget, [self.i_hat, coord1])) self.play(*map(MoveToTarget, [self.j_hat, coord2])) self.play(VGroup(self.j_hat, coord2).shift, self.i_hat.get_end()) - self.dither(2) + self.wait(2) self.play( self.i_hat.restore, self.j_hat.restore, @@ -460,7 +460,7 @@ class DeterminantAndEigenvectorDontCare(LinearTransformationScene): eigenvectors = VGroup(*self.get_eigenvectors()) self.add_foreground_mobject(words) - self.dither() + self.wait() self.play( FadeIn(blob), Write(det_label) @@ -473,7 +473,7 @@ class DeterminantAndEigenvectorDontCare(LinearTransformationScene): ), Animation(words) ) - self.dither() + self.wait() self.add_transformable_mobject(blob) self.add_moving_mobject(det_label, det_label_target) @@ -506,7 +506,7 @@ class DeterminantAndEigenvectorDontCare(LinearTransformationScene): FadeIn(self.plane), *map(Animation, non_plane_mobs) ) - self.dither() + self.wait() self.apply_transposed_matrix( self.t_matrix, rate_func = special_rate_func, @@ -557,9 +557,9 @@ class WhatIsSpace(Scene): Write(compy.bubble.content) ) self.play(Blink(physy)) - self.dither() + self.wait() self.play(Blink(compy)) - self.dither() + self.wait() class OtherVectorishThings(TeacherStudentsScene): def construct(self): @@ -691,11 +691,11 @@ class AddTwoFunctions(FunctionGraphScene): Write(prefix, run_time = 2), FadeIn(brace) ) - self.dither() + self.wait() for lines in f_lines, g_lines: self.add_lines(lines) self.play(*map(FadeOut, [f_graph, g_graph])) - self.dither() + self.wait() self.play(FadeOut(brace)) fg_group = VGroup(*list(f_label)+list(g_label)) self.play( @@ -708,7 +708,7 @@ class AddTwoFunctions(FunctionGraphScene): self.play(ShowCreation(arrow)) self.show_line_addition(f_lines[0], g_lines[0], sum_lines[0]) - self.dither() + self.wait() curr_x_point = f_lines[1].get_start() new_sum_def = self.get_sum_definition(DecimalNumber(curr_x_point[0])) @@ -719,7 +719,7 @@ class AddTwoFunctions(FunctionGraphScene): Transform(arrow, new_arrow), ) self.show_line_addition(f_lines[1], g_lines[1], sum_lines[1]) - self.dither() + self.wait() final_sum_def = self.get_sum_definition(TexMobject("x")) final_sum_def.to_corner(UP+LEFT) @@ -781,7 +781,7 @@ class AddTwoFunctions(FunctionGraphScene): # *[mob.fade for mob in g_lines, f_lines]+[ # Animation(dots) # ]) - self.dither() + self.wait() class AddVectorsCoordinateByCoordinate(Scene): def construct(self): @@ -796,7 +796,7 @@ class AddVectorsCoordinateByCoordinate(Scene): VGroup(v1, plus, v2, equals, v_sum).arrange_submobjects() self.add(v1, plus, v2) - self.dither() + self.wait() self.play( Write(equals), Write(v_sum.get_brackets()) @@ -805,7 +805,7 @@ class AddVectorsCoordinateByCoordinate(Scene): Transform(v1.get_entries().copy(), v_sum.get_entries()), Transform(v2.get_entries().copy(), v_sum.get_entries()), ) - self.dither() + self.wait() class ScaleFunction(FunctionGraphScene): def construct(self): @@ -832,12 +832,12 @@ class ScaleFunction(FunctionGraphScene): self.add(title) self.add_lines(graph_lines) - self.dither() + self.wait() self.play(Transform(graph_lines, scaled_lines)) self.play(ShowCreation(scaled_graph)) self.play(Write(two_f_label)) self.play(FadeOut(graph_lines)) - self.dither() + self.wait() class ScaleVectorByCoordinates(Scene): def construct(self): @@ -862,7 +862,7 @@ class ScaleVectorByCoordinates(Scene): Transform(two.copy(), two_targets), Transform(v1.get_entries().copy(), v2.get_entries()) ) - self.dither() + self.wait() class ShowSlopes(Animation): CONFIG = { @@ -906,7 +906,7 @@ class FromVectorsToFunctions(VectorScene): w.save_state() self.play(w.shift, v.get_end()) vw_sum = self.add_vector(w.get_end(), color = PINK) - self.dither() + self.wait() self.play( Transform(words1, words2), FadeOut(vw_sum), @@ -918,7 +918,7 @@ class FromVectorsToFunctions(VectorScene): ) self.play(v.scale, 2) self.play(w.scale, -0.5) - self.dither() + self.wait() def bring_in_functions(self): everything = VGroup(*self.get_mobjects()) @@ -949,7 +949,7 @@ class FromVectorsToFunctions(VectorScene): submobject_mode = "lagged_start", run_time = 3 )) - self.dither() + self.wait() self.play(*[ ApplyMethod(mob.shift, 2*SPACE_WIDTH*RIGHT) for mob in axes, everything @@ -957,7 +957,7 @@ class FromVectorsToFunctions(VectorScene): ) self.play(ShowCreation(graph), Animation(words)) self.play(Write(func_tex, run_time = 2)) - self.dither(2) + self.wait(2) top_word = words[0] words.remove(top_word) @@ -965,7 +965,7 @@ class FromVectorsToFunctions(VectorScene): FadeOut(words), top_word.shift, top_word.get_center()[0]*LEFT ) - self.dither() + self.wait() self.func_tex = func_tex self.graph = graph @@ -997,17 +997,17 @@ class FromVectorsToFunctions(VectorScene): ) self.remove(func_tex) self.add(func_tex.target) - self.dither() + self.wait() faded_graph = graph.copy().fade() self.add(faded_graph) self.play( Transform(graph, new_graph, run_time = 2), Animation(group) ) - self.dither() + self.wait() self.play(Transform(L, deriv)) self.play(ShowSlopes(faded_graph)) - self.dither() + self.wait() class TransformationsAndOperators(TeacherStudentsScene): def construct(self): @@ -1034,7 +1034,7 @@ class ManyFunctions(FunctionGraphScene): for i in range(100): if i < 3: run_time = 1 - self.dither() + self.wait() elif i < 10: run_time = 0.4 else: @@ -1136,10 +1136,10 @@ class FormalDefinitionOfLinear(LinearTransformationScene): properties.next_to(h_line, DOWN, buff = MED_LARGE_BUFF).to_edge(LEFT) self.play(Write(title), ShowCreation(h_line)) - self.dither() + self.wait() for words in properties: self.play(Write(words)) - self.dither() + self.wait() self.add_foreground_mobject(title, h_line, *properties) self.additivity, self.scaling = properties @@ -1193,7 +1193,7 @@ class FormalDefinitionOfLinear(LinearTransformationScene): self.t_matrix, added_anims = [MoveToTarget(vw_label)] ) - self.dither() + self.wait() self.play(w_group.shift, v.get_end()) v_label_copy, w_label_copy = v_label.copy(), w_label.copy() v_label_copy.generate_target() @@ -1213,7 +1213,7 @@ class FormalDefinitionOfLinear(LinearTransformationScene): to_fade = [self.plane, v, v_label, w_group, vw_label, vw_sum] to_fade += self.get_mobjects_from_last_animation() - self.dither() + self.wait() self.play(*it.chain( map(FadeOut, to_fade), map(Animation, self.foreground_mobjects) @@ -1244,7 +1244,7 @@ class FormalDefinitionOfLinear(LinearTransformationScene): self.remove(v_copy, v_label_copy) self.add(scaled_v_label) self.add_vector(scaled_v, animate = False) - self.dither() + self.wait() transform = self.get_matrix_transformation(self.t_matrix) point = transform(scaled_v.get_end()) @@ -1259,7 +1259,7 @@ class FormalDefinitionOfLinear(LinearTransformationScene): self.t_matrix, added_anims = [MoveToTarget(scaled_v_label)] ) - self.dither() + self.wait() scaled_v = v.copy().scale(2) rhs = TexMobject("=", "c", "L(", "\\vec{\\textbf{v}}", ")") rhs.highlight_by_tex("c", GREEN) @@ -1271,7 +1271,7 @@ class FormalDefinitionOfLinear(LinearTransformationScene): self.add(v_copy) self.play(Transform(v, scaled_v)) self.play(Write(rhs)) - self.dither() + self.wait() faders = [ scaled_v_label, scaled_v, v_copy, v, rhs @@ -1300,7 +1300,7 @@ class FormalDefinitionOfLinear(LinearTransformationScene): randy.change_mode, "speaking", ) self.play(Blink(randy)) - self.dither() + self.wait() class CalcStudentsKnowThatDerivIsLinear(TeacherStudentsScene): def construct(self): @@ -1377,14 +1377,14 @@ class DerivativeIsLinear(Scene): outer_deriv2 = VGroup(deriv[12], deriv[13], deriv[15]) self.play(FadeIn(group)) - self.dither() + self.wait() self.point_out(inner_sum) self.point_out(outer_sum_deriv) - self.dither() + self.wait() self.point_out(outer_deriv1, outer_deriv2) self.point_out(inner_func1, inner_func2) self.point_out(plus) - self.dither() + self.wait() self.play(FadeOut(group)) def show_scaling(self): @@ -1398,13 +1398,13 @@ class DerivativeIsLinear(Scene): outer_scaling = deriv[6] self.play(FadeIn(group)) - self.dither() + self.wait() self.point_out(inner_scaling) self.point_out(lhs_deriv) - self.dither() + self.wait() self.point_out(rhs_deriv) self.point_out(outer_scaling) - self.dither() + self.wait() def point_out(self, *terms): anims = [] @@ -1458,13 +1458,13 @@ class PolynomialsHaveArbitrarilyLargeDegree(Scene): polys.next_to(arrow, LEFT) self.play(Write(polys)) - self.dither() + self.wait() self.play( FadeIn(arrow), Write(words), GrowFromCenter(brace) ) - self.dither() + self.wait() class GeneneralPolynomialCoordinates(Scene): def construct(self): @@ -1503,18 +1503,18 @@ class GeneneralPolynomialCoordinates(Scene): ) self.add(poly, equals, array.get_brackets()) - self.dither() + self.wait() self.play( Transform(pre_entries.copy(), array.get_entries()) ) - self.dither() + self.wait() class SimplePolynomialCoordinates(Scene): def construct(self): matrix = Matrix(["5", "3", "1", "0", "\\vdots"]) matrix.to_edge(LEFT) self.play(Write(matrix)) - self.dither() + self.wait() class IntroducePolynomialSpace(Scene): def construct(self): @@ -1530,7 +1530,7 @@ class IntroducePolynomialSpace(Scene): title.to_edge(UP) title[1].highlight(BLUE) self.play(Write(title)) - self.dither() + self.wait() self.title = title def show_polynomial_cloud(self): @@ -1554,7 +1554,7 @@ class IntroducePolynomialSpace(Scene): self.play(ShowCreation(cloud)) for poly in polys: self.play(Write(poly), run_time = 1) - self.dither() + self.wait() self.poly1, self.poly2 = polys[0], polys[1] polys.remove(self.poly1) self.play( @@ -1591,7 +1591,7 @@ class IntroducePolynomialSpace(Scene): for index, color in index_to_color.items() ] ) - self.dither() + self.wait() self.brace = brace def list_basis_functions(self): @@ -1637,7 +1637,7 @@ class IntroducePolynomialSpace(Scene): for basis_func in basis_functions: self.play(Write(basis_func, run_time = 1)) self.play(Write(dots)) - self.dither() + self.wait() self.basis = basis_group self.basis_functions = basis_functions @@ -1666,7 +1666,7 @@ class IntroducePolynomialSpace(Scene): submobject_mode = "lagged_start", run_time = 3 ) - self.dither() + self.wait() target = self.poly1.copy() terms = [ VGroup(*target[6:8]), @@ -1685,13 +1685,13 @@ class IntroducePolynomialSpace(Scene): more_terms[-1].shift(MED_SMALL_BUFF*LEFT) self.play(Transform(self.poly1, target)) - self.dither() + self.wait() self.play(FadeIn( VGroup(*more_terms), submobject_mode = "lagged_start", run_time = 2 )) - self.dither() + self.wait() self.play(*map(FadeOut, [self.poly1]+more_terms)) self.poly2.next_to(equals, LEFT) @@ -1708,7 +1708,7 @@ class IntroducePolynomialSpace(Scene): Write(self.poly2), Transform(coords, new_coords) ) - self.dither() + self.wait() for i, mob in (2, VGroup(*self.poly2[3:5])), (7, self.poly2[0]): self.play( new_coords.get_entries()[i].scale_in_place, 1.3, @@ -1717,7 +1717,7 @@ class IntroducePolynomialSpace(Scene): ) self.remove(*self.get_mobjects_from_last_animation()) self.add(self.poly2) - self.dither() + self.wait() self.play(*map(FadeOut, [self.poly2, coords, equals])) def derivative_as_matrix(self): @@ -1750,7 +1750,7 @@ class IntroducePolynomialSpace(Scene): self.play(FadeIn(deriv), FadeIn(equals)) self.play(Write(matrix)) - self.dither() + self.wait() diag_entries.save_state() diag_entries.generate_target() diag_entries.target.scale_in_place(1.2) @@ -1761,7 +1761,7 @@ class IntroducePolynomialSpace(Scene): submobject_mode = "lagged_start", run_time = 1.5, ) - self.dither() + self.wait() matrix.generate_target() matrix.target.to_corner(DOWN+LEFT).shift(0.25*UP) deriv.generate_target() @@ -1866,7 +1866,7 @@ class IntroducePolynomialSpace(Scene): self.play(Write(result_array.get_brackets())) for entry, diag_entry, result_entry, rect, result_term, coef in tuples: self.play(FadeIn(rect), FadeIn(vert_rect)) - self.dither() + self.wait() self.play( entry.scale_in_place, 1.2, diag_entry.scale_in_place, 1.2, @@ -1879,12 +1879,12 @@ class IntroducePolynomialSpace(Scene): diag_entry.scale_in_place, 1/1.2, Write(dot) ) - self.dither() + self.wait() self.play(Transform(coef.copy(), VGroup(result_term))) - self.dither() + self.wait() self.play(FadeOut(rect), FadeOut(vert_rect)) self.play(*map(Write, result_array.get_entries()[3:])) - self.dither() + self.wait() class MatrixVectorMultiplicationAndDerivative(TeacherStudentsScene): def construct(self): @@ -1945,7 +1945,7 @@ class CompareTermsInLinearAlgebraToFunction(Scene): self.add(l_title, r_title) self.play(*map(ShowCreation, [h_line, v_line])) - self.dither() + self.wait() lin_alg_concepts = VGroup(*map(TextMobject, [ "Linear transformations", @@ -1965,7 +1965,7 @@ class CompareTermsInLinearAlgebraToFunction(Scene): for concept in concepts: self.play(Write(concept, run_time = 1)) - self.dither() + self.wait() class BackToTheQuestion(TeacherStudentsScene): def construct(self): @@ -2006,7 +2006,7 @@ class YouAsAMathematician(Scene): mathy.look, OUT ) self.play(Blink(mathy)) - self.dither() + self.wait() self.play( FadeOut(words), FadeOut(arrow), @@ -2015,7 +2015,7 @@ class YouAsAMathematician(Scene): ) self.play(Write(equations)) self.play(Blink(mathy)) - self.dither() + self.wait() bubble.write("Does this make any sense \\\\ for functions too?") self.play( @@ -2024,7 +2024,7 @@ class YouAsAMathematician(Scene): mathy.look, RIGHT, Write(bubble.content) ) - self.dither() + self.wait() self.play(Blink(mathy)) def get_content(self): @@ -2071,7 +2071,7 @@ class ShowVectorSpaces(Scene): )) self.play(Write(arrays)) self.play(Write(functions)) - self.dither() + self.wait() self.play(Write(title)) def get_vectors(self, n_vectors = 10): @@ -2133,7 +2133,7 @@ class ToolsOfLinearAlgebra(Scene): submobject_mode = "lagged_start", run_time = 3 )) - self.dither() + self.wait() class MathematicianSpeakingToAll(Scene): def construct(self): @@ -2161,7 +2161,7 @@ class MathematicianSpeakingToAll(Scene): mathy.look_at, others ) self.play(Blink(others[3])) - self.dither() + self.wait() thought_bubble = mathy.get_bubble(ThoughtBubble) self.play( FadeOut(bubble.content), @@ -2251,13 +2251,13 @@ class ListAxioms(Scene): submobject_mode = "lagged_start", run_time = 5 )) - self.dither() + self.wait() axioms_word = TextMobject("``Axioms''") axioms_word.highlight(YELLOW) axioms_word.scale(2) axioms_word.shift(SPACE_WIDTH*RIGHT/2, SPACE_HEIGHT*DOWN/2) self.play(Write(axioms_word, run_time = 3)) - self.dither() + self.wait() class AxiomsAreInterface(Scene): def construct(self): @@ -2293,13 +2293,13 @@ class AxiomsAreInterface(Scene): ) self.play(Write(words)) - self.dither() + self.wait() self.play(ShowCreation(red_line)) self.play(Transform( rules_of_nature.copy(), an_interface )) - self.dither() + self.wait() self.play(FadeIn(mathy)) self.play( ShowCreation(double_arrow), @@ -2307,7 +2307,7 @@ class AxiomsAreInterface(Scene): ) self.play(axioms.copy().next_to, double_arrow, UP) self.play(Blink(mathy)) - self.dither() + self.wait() class VectorSpaceOfPiCreatures(Scene): def construct(self): @@ -2350,7 +2350,7 @@ class VectorSpaceOfPiCreatures(Scene): submobject_mode = "lagged_start", run_time = 3 )) - self.dither() + self.wait() return creatures def show_sum(self, creatures): @@ -2420,13 +2420,13 @@ class MathematicianDoesntHaveToThinkAboutThat(Scene): Write(words) ) self.play(Blink(mathy)) - self.dither() + self.wait() self.play( mathy.change_mode, "pondering", Transform(words, new_words) ) self.play(Blink(mathy)) - self.dither() + self.wait() class TextbooksAreAbstract(TeacherStudentsScene): def construct(self): @@ -2484,7 +2484,7 @@ class WhatIsThree(Scene): ) words.scale(1.5) self.play(Write(words)) - self.dither() + self.wait() self.play( FadeOut(what_is), FadeOut(q_mark), @@ -2519,7 +2519,7 @@ class WhatIsThree(Scene): m3.next_to(VGroup(m1, m2), DOWN, buff = MED_SMALL_BUFF) group.next_to(three, vect, buff = LARGE_BUFF) self.play(FadeIn(group)) - self.dither() + self.wait() self.play(*[ Transform( trip, three, @@ -2548,7 +2548,7 @@ class AbstractionIsThePrice(Scene): words.highlight_by_tex("Abstractness", YELLOW) words.highlight_by_tex("generality", BLUE) self.play(Write(words)) - self.dither() + self.wait() class ThatsAWrap(TeacherStudentsScene): def construct(self): diff --git a/old_projects/eola/chapter2.py b/old_projects/eola/chapter2.py index f4528e0d..93ec2130 100644 --- a/old_projects/eola/chapter2.py +++ b/old_projects/eola/chapter2.py @@ -36,9 +36,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(FadeIn(words)) - self.dither(3) + self.wait(3) self.play(Write(author, run_time = 3)) - self.dither() + self.wait() class CoordinatesWereFamiliar(TeacherStudentsScene): @@ -48,7 +48,7 @@ class CoordinatesWereFamiliar(TeacherStudentsScene): self.random_blink() self.teacher_says("Ah, but there is a subtlety") self.random_blink() - self.dither() + self.wait() class CoordinatesAsScalars(VectorScene): @@ -62,7 +62,7 @@ class CoordinatesAsScalars(VectorScene): vector = self.add_vector(self.vector_coords) array, x_line, y_line = self.vector_to_coords(vector) self.add(array) - self.dither() + self.wait() new_array = self.general_idea_of_scalars(array, vector) self.scale_basis_vectors(new_array) self.show_symbolic_sum(new_array, vector) @@ -105,13 +105,13 @@ class CoordinatesAsScalars(VectorScene): Write(title), ) self.play(FadeIn(i_hat), FadeIn(j_hat)) - self.dither() + self.wait() self.play( Transform(i_hat, new_i_hat), Transform(j_hat, new_j_hat), run_time = 3 ) - self.dither() + self.wait() starting_mobjects.remove(array) new_x, new_y = new_array.get_mob_matrix().flatten() @@ -142,7 +142,7 @@ class CoordinatesAsScalars(VectorScene): color = Y_COLOR, label_scale_factor = 1 ) - self.dither() + self.wait() x, y = new_array.get_mob_matrix().flatten() for coord, v, label, factor, shift_right in [ @@ -162,13 +162,13 @@ class CoordinatesAsScalars(VectorScene): Transform(v, scaled_v), Transform(VMobject(coord_copy, label), scaled_label), ) - self.dither() + self.wait() if shift_right: group = VMobject(v, coord_copy, label) self.play(ApplyMethod( group.shift, self.vector_coords[0]*RIGHT )) - self.dither() + self.wait() def show_symbolic_sum(self, new_array, vector): @@ -184,7 +184,7 @@ class CoordinatesAsScalars(VectorScene): j_hat.highlight(Y_COLOR) self.play(Transform(new_array, new_mob)) - self.dither() + self.wait() @@ -210,7 +210,7 @@ class CoordinatesAsScalarsExample2(CoordinatesAsScalars): VMobject(*text.split()[:2]).highlight(X_COLOR) VMobject(*text.split()[5:7]).highlight(Y_COLOR) self.play(Write(text)) - self.dither(2) + self.wait(2) self.remove(*basis_vectors + labels) CoordinatesAsScalars.construct(self) @@ -221,7 +221,7 @@ class WhatIfWeChoseADifferentBasis(Scene): "What if we chose different basis vectors?", run_time = 2 )) - self.dither(2) + self.wait(2) class ShowVaryingLinearCombinations(VectorScene): CONFIG = { @@ -315,7 +315,7 @@ class ShowVaryingLinearCombinations(VectorScene): ] anims += label_anims + scalar_anims self.play(*anims, **{"run_time" : 2}) - self.dither() + self.wait() self.last_scalar_pair = scalar_pair def show_sum(self, v1, v2, label_anims, scalar_anims): @@ -326,7 +326,7 @@ class ShowVaryingLinearCombinations(VectorScene): self.sum_vector = self.add_vector( v2.get_end(), color = self.sum_color ) - self.dither() + self.wait() def scale_with_sum(self, v1, v2, label_anims, scalar_anims): v2_anim, sum_anim = self.get_sum_animations(v1, v2) @@ -345,7 +345,7 @@ class ShowVaryingLinearCombinations(VectorScene): self.play(*anims, **{"run_time" : 2}) if self.leave_sum_vector_copies: self.add(self.sum_vector.copy()) - self.dither() + self.wait() self.last_scalar_pair = scalar_pair def get_sum_animations(self, v1, v2): @@ -384,7 +384,7 @@ class ShowVaryingLinearCombinations(VectorScene): # for a in label_anims # ] self.play(*anims + [Write(brackets)]) - self.dither() + self.wait() self.remove(brackets, *alt_coords) self.add(array) self.play( @@ -408,7 +408,7 @@ class ShowVaryingLinearCombinations(VectorScene): ApplyMethod(ij_array.next_to, neq), Write(neq) ) - self.dither() + self.wait() def draw_lines(self, v1, v2, label_anims, scalar_anims): sum_anims = self.get_sum_animations(v1, v2) @@ -429,7 +429,7 @@ class ShowVaryingLinearCombinations(VectorScene): *aux_anims ) self.add(line, v2) - self.dither() + self.wait() @@ -486,7 +486,7 @@ class NameLinearCombinations(Scene): ShowCreation(VMobject(*arrows)), Write(scalars_word) ) - self.dither(2) + self.wait(2) class LinearCombinationsDrawLines(ShowVaryingLinearCombinations): @@ -587,7 +587,7 @@ class BothVectorsCouldBeZero(VectorScene): v2 = self.add_vector([3, -1], color = BLUE) self.play(Transform(v1, Dot(ORIGIN))) self.play(Transform(v2, Dot(ORIGIN))) - self.dither() + self.wait() class DefineSpan(Scene): @@ -630,18 +630,18 @@ class DefineSpan(Scene): self.play(Write(definition)) self.play(Write(equation)) - self.dither() + self.wait() self.play( FadeIn(vary_words), ShowCreation(VMobject(*arrows)) ) - self.dither() + self.wait() class VectorsVsPoints(Scene): def construct(self): self.play(Write("Vectors vs. Points")) - self.dither(2) + self.wait(2) class VectorsToDotsScene(VectorScene): @@ -673,14 +673,14 @@ class VectorsToDotsScene(VectorScene): self.add(*vectors) def v_to_dot(vector): return Dot(vector.get_end(), fill_color = vector.get_stroke_color()) - self.dither() + self.wait() vectors.remove(prototype_vector) self.play(*map(FadeOut, vectors)+[Animation(prototype_vector)]) self.remove(vector_group) self.add(prototype_vector) - self.dither() + self.wait() self.play(Transform(prototype_vector, v_to_dot(prototype_vector))) - self.dither() + self.wait() self.play(*map(FadeIn, vectors) + [Animation(prototype_vector)]) rate_functions = [ squish_rate_func(smooth, float(x)/(len(vectors)+2), 1) @@ -690,10 +690,10 @@ class VectorsToDotsScene(VectorScene): Transform(v, v_to_dot(v), rate_func = rf, run_time = 2) for v, rf in zip(vectors, rate_functions) ]) - self.dither() + self.wait() self.remove(prototype_vector) self.play_final_animation(vectors, rate_functions) - self.dither() + self.wait() def get_vectors(self): raise Exception("Not implemented") @@ -760,7 +760,7 @@ class VectorsInThePlane(VectorsToDotsScene): ] ) self.remove(*vectors) - self.dither() + self.wait() class HowToThinkVectorsVsPoint(Scene): @@ -791,16 +791,16 @@ class HowToThinkVectorsVsPoint(Scene): ) self.play(FadeIn(text1)) self.play(ShowCreation(single_vector)) - self.dither(3) + self.wait(3) self.play( Transform(text1, text2), Transform(single_vector, vector_group) ) self.remove(single_vector) self.add(vector_group) - self.dither() + self.wait() self.play(Transform(vector_group, dots)) - self.dither() + self.wait() class IntroduceThreeDSpan(Scene): @@ -809,7 +809,7 @@ class IntroduceThreeDSpan(Scene): class AskAboutThreeDSpan(Scene): def construct(self): self.play(Write("What does the span of two 3d vectors look like?")) - self.dither(2) + self.wait(2) class ThreeDVectorSpan(Scene): pass @@ -861,12 +861,12 @@ class LinearCombinationOfThreeVectorsText(Scene): self.play(Write(text)) self.play(Write(equation)) - self.dither() + self.wait() self.play( ShowCreation(arrows, submobject_mode = "one_at_a_time"), Write(span_comment) ) - self.dither() + self.wait() class ThirdVectorOnSpanOfFirstTwo(Scene): @@ -897,9 +897,9 @@ class SpanCasesWords(Scene): for words in words1, words2: words.scale_to_fit_width(2*SPACE_WIDTH - 1) self.play(Write(words1)) - self.dither() + self.wait() self.play(Transform(words1, words2)) - self.dither() + self.wait() @@ -935,9 +935,9 @@ class LinearDependentWords(Scene): words.scale_to_fit_width(2*SPACE_WIDTH - 1) self.play(Write(words1)) - self.dither() + self.wait() self.play(Transform(words1, words2)) - self.dither() + self.wait() class LinearDependentEquations(Scene): @@ -995,14 +995,14 @@ class LinearDependentEquations(Scene): ShowCreation(arrow), Write(low_words1) ) - self.dither() + self.wait() self.play( Transform(equation1, equation2), Transform(low_words1, low_words2), Transform(arrow, arrows) ) - self.dither(2) + self.wait(2) new_title = TextMobject("``Linearly independent'' ") new_title.highlight(GREEN) @@ -1026,13 +1026,13 @@ class LinearDependentEquations(Scene): Transform(arrow, arrow_copy), Transform(low_words1, new_low_words1) ) - self.dither() + self.wait() self.play( Transform(equation1, eq2_copy), Transform(arrow, arrows), Transform(low_words1, new_low_words2) ) - self.dither() + self.wait() @@ -1098,34 +1098,34 @@ class AlternateDefOfLinearlyDependent(Scene): for i, new_eq in enumerate(equations): if i == 0: self.play(FadeIn(scalar_specification)) - self.dither(2) + self.wait(2) self.play(FadeOut(scalar_specification)) elif i == 3: self.play( GrowFromCenter(brace), Write(brace_words) ) - self.dither(3) + self.wait(3) self.play(FadeOut(brace), FadeOut(brace_words)) self.play(Transform( equation, new_eq, path_arc = (np.pi/2 if i == 1 else 0) )) - self.dither(3) + self.wait(3) self.play(Write(added_words1)) - self.dither(2) + self.wait(2) self.play( Transform(title1, title2), Write(subtitle), Transform(added_words1, added_words2), ) - self.dither(3) + self.wait(3) everything = VMobject(*self.get_mobjects()) self.play(ApplyFunction( lambda m : m.scale(0.5).to_corner(UP+LEFT), everything )) - self.dither() + self.wait() def get_equations(self): @@ -1224,14 +1224,14 @@ class MathematiciansLikeToConfuse(TeacherStudentsScene): ApplyMethod(student.change_mode, mode) for student, mode in zip(self.get_students(), modes) ]) - self.dither(2) + self.wait(2) class CheckYourUnderstanding(TeacherStudentsScene): def construct(self): self.setup() self.teacher_says("Quiz time!") self.random_blink() - self.dither() + self.wait() self.random_blink() @@ -1256,7 +1256,7 @@ class TechnicalDefinitionOfBasis(Scene): self.add(title) self.play(Write(definition)) - self.dither() + self.wait() class NextVideo(Scene): def construct(self): @@ -1268,7 +1268,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() diff --git a/old_projects/eola/chapter3.py b/old_projects/eola/chapter3.py index 955a1583..afd1fae5 100644 --- a/old_projects/eola/chapter3.py +++ b/old_projects/eola/chapter3.py @@ -46,11 +46,11 @@ class OpeningQuote(Scene): comment.next_to(author, DOWN, buff = 1) self.play(FadeIn(words)) - self.dither(3) + self.wait(3) self.play(Write(author, run_time = 3)) - self.dither() + self.wait() self.play(Write(comment)) - self.dither() + self.wait() class Introduction(TeacherStudentsScene): def construct(self): @@ -107,7 +107,7 @@ class DescribeTransformation(Scene): function.highlight(YELLOW) self.play(Write(title)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(function), @@ -143,13 +143,13 @@ class DescribeTransformation(Scene): self.play(Write(f_of_x, run_time = 1)) self.play(Write(num_inputs, run_time = 2)) - self.dither() + self.wait() for mob in f_point, num_outputs: self.play(Transform( num_inputs, mob, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play( FadeOut(num_inputs), @@ -159,14 +159,14 @@ class DescribeTransformation(Scene): Write(input_vect), Write(vector_input_words) ) - self.dither() + self.wait() for mob in f_point, output_vect: self.play(Transform( input_vect, mob, submobject_mode = "lagged_start" )) self.play(Write(vector_output_words)) - self.dither() + self.wait() class WhyConfuseWithTerminology(TeacherStudentsScene): def construct(self): @@ -178,7 +178,7 @@ class WhyConfuseWithTerminology(TeacherStudentsScene): for student in other_students ]) self.random_blink() - self.dither() + self.wait() statement = TextMobject([ "The word", "``transformation''", @@ -193,7 +193,7 @@ class WhyConfuseWithTerminology(TeacherStudentsScene): for student in other_students ]) self.random_blink() - self.dither() + self.wait() class ThinkinfOfFunctionsAsGraphs(VectorScene): def construct(self): @@ -212,7 +212,7 @@ class ThinkinfOfFunctionsAsGraphs(VectorScene): Write(point_label), run_time = 1 ) - self.dither() + self.wait() def collapse_func(p): return np.dot(p, [RIGHT, RIGHT, OUT]) + (SPACE_HEIGHT+1)*DOWN @@ -228,7 +228,7 @@ class ThinkinfOfFunctionsAsGraphs(VectorScene): words = TextMobject(["Instead think about", "\\emph{movement}"]) words.split()[-1].highlight(YELLOW) self.play(Write(words)) - self.dither() + self.wait() class TransformJustOneVector(VectorScene): def construct(self): @@ -246,7 +246,7 @@ class TransformJustOneVector(VectorScene): v.label.highlight(v.get_color()) self.play(ShowCreation(v)) self.play(Write(v.label)) - self.dither() + self.wait() self.remove(v2) self.play( Transform( @@ -255,7 +255,7 @@ class TransformJustOneVector(VectorScene): ), ApplyMethod(v1.fade) ) - self.dither() + self.wait() class TransformManyVectors(LinearTransformationScene): CONFIG = { @@ -280,7 +280,7 @@ class TransformManyVectors(LinearTransformationScene): ]) self.play(ShowCreation(vectors, submobject_mode = "lagged_start")) - self.dither() + self.wait() if self.use_dots: self.play(Transform( vectors, self.vectors_to_dots(vectors), @@ -288,20 +288,20 @@ class TransformManyVectors(LinearTransformationScene): submobject_mode = "lagged_start" )) transformed_vectors = self.vectors_to_dots(transformed_vectors) - self.dither() + self.wait() self.play(Transform( vectors, transformed_vectors, run_time = 3, path_arc = -np.pi/2 )) - self.dither() + self.wait() if self.use_dots: self.play(Transform( vectors, self.dots_to_vectors(vectors), run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() def vectors_to_dots(self, vectors): return VMobject(*[ @@ -334,9 +334,9 @@ class TransformInfiniteGrid(LinearTransformationScene): self.play(ShowCreation( self.plane, run_time = 3, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.apply_transposed_matrix([[2, 1], [1, 2]]) - self.dither() + self.wait() class TransformInfiniteGridWithBackground(TransformInfiniteGrid): CONFIG = { @@ -362,13 +362,13 @@ class ApplyComplexFunction(LinearTransformationScene): def construct(self): self.setup() self.plane.prepare_for_nonlinear_transform(100) - self.dither() + self.wait() self.play(ApplyMethod( self.plane.apply_complex_function, self.function, run_time = 5, path_arc = np.pi/2 )) - self.dither() + self.wait() class ExponentialTransformation(ApplyComplexFunction): CONFIG = { @@ -400,7 +400,7 @@ class LookToWordLinear(Scene): faded_linear, transformation, transformation_brace, function ) - self.dither() + self.wait() self.play( Transform(faded_linear, linear), Transform(transformation, faded_transformation), @@ -408,7 +408,7 @@ class LookToWordLinear(Scene): Transform(function, new_sub_word), submobject_mode = "lagged_start" ) - self.dither() + self.wait() class IntroduceLinearTransformations(LinearTransformationScene): CONFIG = { @@ -416,9 +416,9 @@ class IntroduceLinearTransformations(LinearTransformationScene): } def construct(self): self.setup() - self.dither() + self.wait() self.apply_transposed_matrix([[2, 1], [1, 2]]) - self.dither() + self.wait() lines_rule = TextMobject("Lines remain lines") lines_rule.shift(2*UP).to_edge(LEFT) @@ -433,13 +433,13 @@ class IntroduceLinearTransformations(LinearTransformationScene): self.play( Write(lines_rule, run_time = 2), ) - self.dither() + self.wait() self.play( Write(origin_rule, run_time = 2), ShowCreation(arrow), GrowFromCenter(dot) ) - self.dither() + self.wait() class ToThePedants(Scene): def construct(self): @@ -455,7 +455,7 @@ class ToThePedants(Scene): words.split()[0].highlight(RED) words.to_edge(UP) self.add(words) - self.dither() + self.wait() class SimpleLinearTransformationScene(LinearTransformationScene): CONFIG = { @@ -464,9 +464,9 @@ class SimpleLinearTransformationScene(LinearTransformationScene): } def construct(self): self.setup() - self.dither() + self.wait() self.apply_transposed_matrix(self.transposed_matrix) - self.dither() + self.wait() class SimpleNonlinearTransformationScene(LinearTransformationScene): CONFIG = { @@ -475,14 +475,14 @@ class SimpleNonlinearTransformationScene(LinearTransformationScene): } def construct(self): self.setup() - self.dither() + self.wait() self.apply_nonlinear_transformation(self.func) words = TextMobject(self.words) words.to_corner(UP+RIGHT) words.highlight(RED) words.add_background_rectangle() self.play(Write(words)) - self.dither() + self.wait() def func(self, point): return curvy_squish(point) @@ -547,7 +547,7 @@ class GridLinesRemainParallel(SimpleLinearTransformationScene): text.add_background_rectangle() text.shift(-text.get_bottom()) self.play(Write(text)) - self.dither() + self.wait() class Rotation(SimpleLinearTransformationScene): CONFIG = { @@ -585,14 +585,14 @@ class YetAnotherLinearTransformation(SimpleLinearTransformationScene): formula.add_background_rectangle() self.play(Write(words)) - self.dither() + self.wait() self.play( ApplyMethod(self.plane.fade, 0.7), ApplyMethod(self.background_plane.fade, 0.7), Write(formula, run_time = 2), Animation(words) ) - self.dither() + self.wait() class FollowIHatJHat(LinearTransformationScene): CONFIG = { @@ -613,10 +613,10 @@ class FollowIHatJHat(LinearTransformationScene): label_scale_factor = 1 ) - self.dither() + self.wait() self.play(*map(FadeOut, [i_label, j_label])) self.apply_transposed_matrix([[-1, 1], [-2, -1]]) - self.dither() + self.wait() class TrackBasisVectorsExample(LinearTransformationScene): CONFIG = { @@ -640,9 +640,9 @@ class TrackBasisVectorsExample(LinearTransformationScene): self.setup() self.label_bases() self.introduce_vector() - self.dither() + self.wait() self.apply_transposed_matrix(self.transposed_matrix) - self.dither() + self.wait() self.show_linear_combination(clean_up = False) self.write_linear_map_rule() self.show_basis_vector_coords() @@ -683,7 +683,7 @@ class TrackBasisVectorsExample(LinearTransformationScene): )) self.remove(pre_def) self.add_foreground_mobject(v_def) - self.dither() + self.wait() self.show_linear_combination() self.remove(coords) @@ -698,7 +698,7 @@ class TrackBasisVectorsExample(LinearTransformationScene): j_hat_copy )) self.play(ApplyMethod(j_hat_copy.shift, i_hat_copy.get_end())) - self.dither(2) + self.wait(2) if clean_up: self.play(FadeOut(i_hat_copy), FadeOut(j_hat_copy)) @@ -738,7 +738,7 @@ class TrackBasisVectorsExample(LinearTransformationScene): rule.add_background_rectangle() self.play(Write(rule, run_time = 2)) - self.dither() + self.wait() self.linear_map_rule = rule @@ -774,13 +774,13 @@ class TrackBasisVectorsExample(LinearTransformationScene): result.to_edge(LEFT) self.play(Write(i_coords, run_time = 1)) - self.dither() + self.wait() self.play(Write(j_coords, run_time = 1)) - self.dither() + self.wait() self.play(Write(calculation)) - self.dither() + self.wait() self.play(Write(result)) - self.dither() + self.wait() class WatchManyVectorsMove(TransformManyVectors): def construct(self): @@ -802,14 +802,14 @@ class WatchManyVectorsMove(TransformManyVectors): for v in vectors.split(): self.add_vector(v, animate = False) self.apply_transposed_matrix([[1, -2], [3, 0]]) - self.dither() + self.wait() self.play( ApplyMethod(self.plane.fade), FadeOut(vectors), Animation(self.i_hat), Animation(self.j_hat), ) - self.dither() + self.wait() class NowWithoutWatching(Scene): def construct(self): @@ -819,7 +819,7 @@ class NowWithoutWatching(Scene): self.add(randy) self.play(Write(text, run_time = 1)) self.play(ApplyMethod(randy.blink)) - self.dither(2) + self.wait(2) class DeduceResultWithGeneralCoordinates(Scene): def construct(self): @@ -866,7 +866,7 @@ class DeduceResultWithGeneralCoordinates(Scene): self.add(i_group, j_group) for mob in vect_group.split(): self.play(Write(mob)) - self.dither() + self.wait() class MatrixVectorMultiplication(LinearTransformationScene): CONFIG = { @@ -880,9 +880,9 @@ class MatrixVectorMultiplication(LinearTransformationScene): self.reposition_matrix_and_vector(matrix, vector, formula) def build_to_matrix(self): - self.dither() + self.wait() self.apply_transposed_matrix([[3, -2], [2, 1]]) - self.dither() + self.wait() i_coords = vector_coordinate_label(self.i_hat) j_coords = vector_coordinate_label(self.j_hat) if self.abstract: @@ -917,7 +917,7 @@ class MatrixVectorMultiplication(LinearTransformationScene): self.play(ShowCreation(i_coords.rect), Write(i_coords)) self.play(ShowCreation(j_coords.rect), Write(j_coords)) - self.dither() + self.wait() self.remove(i_coords.rect, j_coords.rect) self.play( Transform( @@ -958,19 +958,19 @@ class MatrixVectorMultiplication(LinearTransformationScene): j_arrow = Arrow(j_message, j_circle) self.play(Write(title)) - self.dither() + self.wait() self.play(ShowCreation(i_circle)) self.play( Write(i_message, run_time = 1.5), ShowCreation(i_arrow), ) - self.dither() + self.wait() self.play(ShowCreation(j_circle)) self.play( Write(j_message, run_time = 1.5), ShowCreation(j_arrow) ) - self.dither() + self.wait() self.play(*map(FadeOut, [ i_message, i_circle, i_arrow, j_message, j_circle, j_arrow ])) @@ -990,7 +990,7 @@ class MatrixVectorMultiplication(LinearTransformationScene): Write(words), run_time = 1 ) - self.dither() + self.wait() v1, v2 = vector.get_mob_matrix().flatten() mob_matrix = matrix.copy().get_mob_matrix() @@ -1018,7 +1018,7 @@ class MatrixVectorMultiplication(LinearTransformationScene): submobject_mode = "all_at_once" ) ) - self.dither() + self.wait() self.show_result(formula) return vector, formula @@ -1047,7 +1047,7 @@ class MatrixVectorMultiplication(LinearTransformationScene): Write(equals, run_time = 1), Write(final_sum) ) - self.dither() + self.wait() def reposition_matrix_and_vector(self, matrix, vector, formula): @@ -1069,13 +1069,13 @@ class MatrixVectorMultiplication(LinearTransformationScene): ), Write(equals, run_time = 1) ) - self.dither() + self.wait() self.play( FadeIn(brace), FadeIn(brace_words), submobject_mode = "lagged_start" ) - self.dither() + self.wait() class MatrixVectorMultiplicationAbstract(MatrixVectorMultiplication): CONFIG = { @@ -1092,7 +1092,7 @@ class ColumnsToBasisVectors(LinearTransformationScene): vector = self.move_matrix_columns(self.t_matrix, vector_coords) self.scale_and_add(vector, vector_coords) - self.dither(3) + self.wait(3) def move_matrix_columns(self, transposed_matrix, vector_coords = None): matrix = np.array(transposed_matrix).transpose() @@ -1153,7 +1153,7 @@ class ColumnsToBasisVectors(LinearTransformationScene): np.linalg.inv(transform_matrix1) ) - self.dither() + self.wait() self.apply_transposed_matrix( transform_matrix1.transpose(), added_anims = [Transform(i_coords_start, i_coords_end)], @@ -1166,7 +1166,7 @@ class ColumnsToBasisVectors(LinearTransformationScene): path_arc = np.pi/2, ) self.add_foreground_mobject(j_coords_start) - self.dither() + self.wait() self.matrix = VGroup(matrix_background, matrix_mob) self.i_coords = i_coords_start @@ -1196,7 +1196,7 @@ class ColumnsToBasisVectors(LinearTransformationScene): j_copy.add(coord2) self.play(ApplyMethod(j_copy.shift, i_copy.get_end())) self.add_vector(j_copy.get_end()) - self.dither() + self.wait() class Describe90DegreeRotation(LinearTransformationScene): CONFIG = { @@ -1217,9 +1217,9 @@ class Describe90DegreeRotation(LinearTransformationScene): col2.highlight(Y_COLOR) self.add_foreground_mobject(matrix_background, matrix.get_brackets()) - self.dither() + self.wait() self.apply_transposed_matrix(self.transposed_matrix) - self.dither() + self.wait() self.play(Write(title)) self.add_foreground_mobject(title) @@ -1231,7 +1231,7 @@ class Describe90DegreeRotation(LinearTransformationScene): brackets = label.get_brackets() self.play(ShowCreation(background), Write(label)) - self.dither() + self.wait() self.play( ShowCreation(background, rate_func = lambda t : smooth(1-t)), ApplyMethod(coords.replace, col), @@ -1239,7 +1239,7 @@ class Describe90DegreeRotation(LinearTransformationScene): ) self.remove(label) self.add_foreground_mobject(coords) - self.dither() + self.wait() self.show_vector(matrix) def show_vector(self, matrix): @@ -1253,10 +1253,10 @@ class Describe90DegreeRotation(LinearTransformationScene): inv = np.linalg.inv(matrix) self.apply_transposed_matrix(inv.transpose(), run_time = 0.5) self.add_vector([1, 2]) - self.dither() + self.wait() self.apply_transposed_matrix(self.transposed_matrix) self.play(ShowCreation(v_background), Write(vector)) - self.dither() + self.wait() class DescribeShear(Describe90DegreeRotation): CONFIG = { @@ -1267,7 +1267,7 @@ class DescribeShear(Describe90DegreeRotation): class OtherWayAround(Scene): def construct(self): self.play(Write("What about the other way around?")) - self.dither(2) + self.wait(2) class DeduceTransformationFromMatrix(ColumnsToBasisVectors): def construct(self): @@ -1298,7 +1298,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class FinalSlide(Scene): def construct(self): @@ -1329,7 +1329,7 @@ class FinalSlide(Scene): text.scale_to_fit_height(2*SPACE_HEIGHT - 2) text.to_edge(UP) self.add(text) - self.dither() + self.wait() ### Old scenes @@ -1343,12 +1343,12 @@ class RotateIHat(LinearTransformationScene): i_label, j_label = self.get_basis_vector_labels() self.add_vector(i_hat) self.play(Write(i_label, run_time = 1)) - self.dither() + self.wait() self.play(FadeOut(i_label)) self.apply_transposed_matrix([[0, 1], [-1, 0]]) - self.dither() + self.wait() self.play(Write(j_label, run_time = 1)) - self.dither() + self.wait() class TransformationsAreFunctions(Scene): def construct(self): @@ -1394,7 +1394,7 @@ class TransformationsAreFunctions(Scene): ) for v, a in [(starting_vector, start_arrow), (ending_vector, ending_arrow)]: self.play(Write(v), ShowCreation(a), run_time = 1) - self.dither() + self.wait() class UsedToThinkinfOfFunctionsAsGraphs(VectorScene): def construct(self): @@ -1417,7 +1417,7 @@ class UsedToThinkinfOfFunctionsAsGraphs(VectorScene): Write(point_label), run_time = 1 ) - self.dither() + self.wait() def collapse_func(p): return np.dot(p, [RIGHT, RIGHT, OUT]) + (SPACE_HEIGHT+1)*DOWN @@ -1434,7 +1434,7 @@ class UsedToThinkinfOfFunctionsAsGraphs(VectorScene): ) self.clear() self.add(name) - self.dither() + self.wait() def show_inputs_and_output(self): numbers = range(-3, 4) @@ -1452,12 +1452,12 @@ class UsedToThinkinfOfFunctionsAsGraphs(VectorScene): everyone.center().to_edge(UP, buff = 1.5) self.play(Write(inputs, run_time = 1)) - self.dither() + self.wait() self.play( Transform(inputs.copy(), outputs), ShowCreation(arrows) ) - self.dither() + self.wait() class TryingToVisualizeFourDimensions(Scene): def construct(self): @@ -1506,20 +1506,20 @@ class TryingToVisualizeFourDimensions(Scene): Write(thought) ) self.play(Blink(randy)) - self.dither() + self.wait() self.remove(thought) bubble.make_green_screen() - self.dither() + self.wait() self.play(Blink(randy)) self.play(ApplyMethod(randy.change_mode, "confused")) - self.dither() + self.wait() self.play(Blink(randy)) - self.dither() + self.wait() class ForgetAboutGraphs(Scene): def construct(self): self.play(Write("You must unlearn graphs")) - self.dither() + self.wait() class ThinkAboutFunctionAsMovingVector(LinearTransformationScene): CONFIG = { @@ -1530,18 +1530,18 @@ class ThinkAboutFunctionAsMovingVector(LinearTransformationScene): self.setup() vector = self.add_vector([2, 1]) label = self.add_transformable_label(vector, "v") - self.dither() + self.wait() self.apply_transposed_matrix([[1, 1], [-3, 1]]) - self.dither() + self.wait() class PrepareForFormalDefinition(TeacherStudentsScene): def construct(self): self.setup() self.teacher_says("Get ready for a formal definition!") - self.dither(3) + self.wait(3) bubble = self.student_thinks("") bubble.make_green_screen() - self.dither(3) + self.wait(3) class AdditivityProperty(LinearTransformationScene): CONFIG = { @@ -1566,7 +1566,7 @@ class AdditivityProperty(LinearTransformationScene): title.add_background_rectangle() self.play(Write(title)) added_anims.append(Animation(title)) - self.dither() + self.wait() self.play(ApplyMethod(self.plane.fade), *added_anims) v, w = self.draw_all_vectors() @@ -1597,19 +1597,19 @@ class AdditivityProperty(LinearTransformationScene): self.transposed_matrix, added_anims = added_anims ) - self.dither() + self.wait() def show_final_sum(self, v, w): new_w = w.copy() self.play(ApplyMethod(new_w.shift, v.get_end())) - self.dither() + self.wait() if self.proclaim_sum: text = TextMobject("It's still their sum!") text.add_background_rectangle() text.move_to(new_w.get_end(), aligned_edge = -new_w.get_end()) text.shift_onto_screen() self.play(Write(text)) - self.dither() + self.wait() class NonlinearLacksAdditivity(AdditivityProperty): CONFIG = { @@ -1635,7 +1635,7 @@ class ShowGridCreation(Scene): coords = VMobject(*plane.get_coordinate_labels()) self.play(ShowCreation(plane, run_time = 3)) self.play(Write(coords, run_time = 3)) - self.dither() + self.wait() class MoveAroundAllVectors(LinearTransformationScene): CONFIG = { @@ -1653,11 +1653,11 @@ class MoveAroundAllVectors(LinearTransformationScene): vectors.submobject_gradient_highlight(PINK, YELLOW) dots = self.get_dots(vectors) - self.dither() + self.wait() self.play(ShowCreation(dots)) - self.dither() + self.wait() self.play(Transform(dots, vectors)) - self.dither() + self.wait() self.remove(dots) if self.focus_on_one_vector: vector = vectors.split()[43]#yeah, great coding Grant @@ -1668,16 +1668,16 @@ class MoveAroundAllVectors(LinearTransformationScene): for v in vectors.split() if v is not vector ]) - self.dither() + self.wait() self.add(vector.copy().highlight(DARK_GREY)) else: for vector in vectors.split(): self.add_vector(vector, animate = False) self.apply_transposed_matrix([[3, 0], [1, 2]]) - self.dither() + self.wait() dots = self.get_dots(vectors) self.play(Transform(vectors, dots)) - self.dither() + self.wait() def get_dots(self, vectors): return VMobject(*[ @@ -1711,11 +1711,11 @@ class ReasonForThinkingAboutArrows(LinearTransformationScene): for v in vectors.split() ]) - self.dither() + self.wait() self.play(Transform(vectors, dots)) - self.dither() + self.wait() self.play(Transform(vectors, vectors_copy)) - self.dither() + self.wait() def scale_and_add(self, vectors): vectors_copy = vectors.copy() @@ -1731,12 +1731,12 @@ class ReasonForThinkingAboutArrows(LinearTransformationScene): ) self.play(ApplyMethod(w.shift, v.get_end())) self.add_vector(sum_vect) - self.dither() + self.wait() self.play(Transform( vectors, vectors_copy, submobject_mode = "all_at_once" )) - self.dither() + self.wait() class LinearTransformationWithOneVector(LinearTransformationScene): CONFIG = { diff --git a/old_projects/eola/chapter4.py b/old_projects/eola/chapter4.py index b50bda92..b29fb1f0 100644 --- a/old_projects/eola/chapter4.py +++ b/old_projects/eola/chapter4.py @@ -39,9 +39,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(FadeIn(words)) - self.dither(2) + self.wait(2) self.play(Write(author, run_time = 3)) - self.dither() + self.wait() class MatrixToBlank(Scene): def construct(self): @@ -51,20 +51,20 @@ class MatrixToBlank(Scene): arrow.next_to(matrix, RIGHT) matrix.add(arrow) self.play(Write(matrix)) - self.dither() + self.wait() class ExampleTransformation(LinearTransformationScene): def construct(self): self.setup() self.apply_transposed_matrix([[3, 0], [1, 2]]) - self.dither(2) + self.wait(2) class RecapTime(TeacherStudentsScene): def construct(self): self.setup() self.teacher_says("Quick recap time!") self.random_blink() - self.dither() + self.wait() student = self.get_students()[0] everyone = self.get_mobjects() everyone.remove(student) @@ -74,13 +74,13 @@ class RecapTime(TeacherStudentsScene): ApplyMethod(student.change_mode, "confused") ) self.play(Blink(student)) - self.dither() + self.wait() self.play(ApplyFunction( lambda m : m.change_mode("pondering").look(LEFT), student )) self.play(Blink(student)) - self.dither() + self.wait() class DeterminedByTwoBasisVectors(LinearTransformationScene): CONFIG = { @@ -105,10 +105,10 @@ class DeterminedByTwoBasisVectors(LinearTransformationScene): matrix1[:,1] = [0, 1] matrix2 = np.dot(matrix, np.linalg.inv(matrix1)) - self.dither() + self.wait() self.apply_transposed_matrix(matrix1.transpose()) self.apply_transposed_matrix(matrix2.transpose()) - self.dither() + self.wait() class FollowLinearCombination(LinearTransformationScene): def construct(self): @@ -186,7 +186,7 @@ class FollowLinearCombination(LinearTransformationScene): ApplyMethod(mob.shift, scaled_i.get_end()) for mob in scaled_j, scaled_j_label ]) - self.dither() + self.wait() self.play(*map(FadeOut, [ scaled_i, scaled_j, scaled_i_label, scaled_j_label, ])) @@ -201,7 +201,7 @@ class FollowLinearCombination(LinearTransformationScene): background = BackgroundRectangle(mob) self.play(ShowCreation(background), Write(mob)) - self.dither() + self.wait() x, y = vect_array.get_entries().split() pre_formula = VMobject( x, i_label, TexMobject("+"), @@ -221,7 +221,7 @@ class FollowLinearCombination(LinearTransformationScene): Transform(pre_formula.copy(), post_formula, run_time = 2), ApplyMethod(vect.set_stroke, width = 7) ]) - self.dither() + self.wait() class MatrixVectorMultiplicationCopy(MatrixVectorMultiplicationAbstract): pass ## Here just for stage_animations.py purposes @@ -243,7 +243,7 @@ class TwoSuccessiveTransformations(LinearTransformationScene): self.setup() self.apply_transposed_matrix([[2, 1],[1, 2]]) self.apply_transposed_matrix([[-1, -0.5],[0, -0.5]]) - self.dither() + self.wait() class RotationThenShear(LinearTransformationScene): CONFIG = { @@ -270,7 +270,7 @@ class RotationThenShear(LinearTransformationScene): self.play(Write(shear_words, run_time = 1)) self.add_foreground_mobject(shear_words) self.apply_transposed_matrix([[1, 0], [1, 1]]) - self.dither() + self.wait() class IntroduceIdeaOfComposition(RotationThenShear): def construct(self): @@ -301,7 +301,7 @@ class IntroduceIdeaOfComposition(RotationThenShear): Animation(self.i_hat), Animation(self.j_hat), ) - self.dither() + self.wait() def track_basis_vectors(self): last_words = self.get_mobjects_from_last_animation()[1] @@ -338,21 +338,21 @@ class IntroduceIdeaOfComposition(RotationThenShear): matrix_background = BackgroundRectangle(matrix) self.play(Write(words)) - self.dither() + self.wait() self.play(ShowCreation(i_background), Write(i_coords), run_time = 2) - self.dither() + self.wait() self.play( Transform(i_background.copy(), matrix_background), Transform(i_coords.copy().get_brackets(), matrix.get_brackets()), ApplyMethod(i_coords.copy().get_entries().move_to, col1) ) - self.dither() + self.wait() self.play(ShowCreation(j_background), Write(j_coords), run_time = 2) - self.dither() + self.wait() self.play( ApplyMethod(j_coords.copy().get_entries().move_to, col2) ) - self.dither() + self.wait() matrix = VMobject(matrix_background, matrix) return matrix @@ -365,7 +365,7 @@ class IntroduceIdeaOfComposition(RotationThenShear): new_matrix = matrix.copy() new_matrix.center().to_edge(UP) self.play(Transform(matrix, new_matrix)) - self.dither() + self.wait() self.remove(matrix) self.setup() @@ -383,7 +383,7 @@ class IntroduceIdeaOfComposition(RotationThenShear): Animation(matrix), run_time = 3 ) - self.dither() + self.wait() class PumpVectorThroughRotationThenShear(RotationThenShear): def construct(self): @@ -391,7 +391,7 @@ class PumpVectorThroughRotationThenShear(RotationThenShear): self.add_vector([2, 3]) self.apply_transposed_matrix([[0, 1], [-1, 0]], run_time = 2) self.apply_transposed_matrix([[1, 0], [1, 1]], run_time = 2) - self.dither() + self.wait() class ExplainWhyItsMatrixMultiplication(Scene): def construct(self): @@ -441,7 +441,7 @@ class ExplainWhyItsMatrixMultiplication(Scene): ] for group in groups: self.play(*map(Write, group)) - self.dither() + self.wait() self.play(*map(FadeOut, [l_paren, r_paren, vect, vect_copy])) comp_matrix.add(equals) matrices = VMobject(shear_matrix, rot_matrix, comp_matrix) @@ -449,7 +449,7 @@ class ExplainWhyItsMatrixMultiplication(Scene): matrices.arrange_submobjects, buff = 0.1, aligned_edge = UP )) - self.dither() + self.wait() arrow = Arrow(rot_matrix.get_right(), shear_matrix.get_left()) arrow.shift((rot_matrix.get_top()[1]+0.2)*UP) @@ -461,9 +461,9 @@ class ExplainWhyItsMatrixMultiplication(Scene): self.play(ShowCreation(arrow)) self.play(Write(words)) - self.dither() + self.wait() self.play(Write(functions)) - self.dither() + self.wait() class MoreComplicatedExampleVisually(LinearTransformationScene): CONFIG = { @@ -481,31 +481,31 @@ class MoreComplicatedExampleVisually(LinearTransformationScene): self.play(Write(m1_mob)) self.add_foreground_mobject(m1_mob) - self.dither() + self.wait() self.apply_transposed_matrix(t_matrix1) - self.dither() + self.wait() self.play(Write(m1_mob.label)) self.add_foreground_mobject(m1_mob.label) - self.dither() + self.wait() self.apply_transposed_matrix(t_m1_inv, run_time = 0) - self.dither() + self.wait() self.play(Write(m2_mob)) self.add_foreground_mobject(m2_mob) - self.dither() + self.wait() self.apply_transposed_matrix(t_matrix2) - self.dither() + self.wait() self.play(Write(m2_mob.label)) self.add_foreground_mobject(m2_mob.label) - self.dither() + self.wait() self.apply_transposed_matrix(t_m2_inv, run_time = 0) - self.dither() + self.wait() for matrix in t_matrix1, t_matrix2: self.apply_transposed_matrix(matrix, run_time = 1) self.play(Write(comp_matrix)) self.add_foreground_mobject(comp_matrix) - self.dither() + self.wait() self.play(*map(FadeOut, [ self.background_plane, self.plane, @@ -515,7 +515,7 @@ class MoreComplicatedExampleVisually(LinearTransformationScene): Animation(m) for m in self.foreground_mobjects ]) self.remove(self.i_hat, self.j_hat) - self.dither() + self.wait() def get_matrices(self): m1_mob = Matrix(np.array(self.t_matrix1).transpose()) @@ -619,14 +619,14 @@ class MoreComplicatedExampleNumerically(MoreComplicatedExampleVisually): comp_col = VMobject(*comp_matrix.split()[1].get_mob_matrix()[:,i]) self.play(Write(question, run_time = 1 )) - self.dither() + self.wait() self.play( Transform(question, first), ShowCreation(first_arrow), ShowCreation(col.circle), ApplyMethod(col.highlight, col.target_color) ) - self.dither() + self.wait() self.play( Transform(m2_copy, m2_target, run_time = 2), ApplyMethod(col.copy().move_to, col_vect, run_time = 2), @@ -634,18 +634,18 @@ class MoreComplicatedExampleNumerically(MoreComplicatedExampleVisually): Transform(first_arrow, second_arrow), Transform(question, second), ) - self.dither() + self.wait() self.play(*map(FadeOut, [question, first_arrow])) self.play(Write(intermediate)) - self.dither() + self.wait() self.play(Write(product)) - self.dither() + self.wait() product_entries = product.get_entries() self.play( ApplyMethod(comp_col.highlight, BLACK), ApplyMethod(product_entries.move_to, comp_col) ) - self.dither() + self.wait() start_state.append(product_entries) self.play(*[ @@ -655,7 +655,7 @@ class MoreComplicatedExampleNumerically(MoreComplicatedExampleVisually): ] + [ Animation(product_entries) ]) - self.dither() + self.wait() class GeneralMultiplication(MoreComplicatedExampleNumerically): def get_result(self): @@ -697,7 +697,7 @@ class GeneralMultiplication(MoreComplicatedExampleNumerically): m2_entries, m2_entries_target, submobject_mode = "lagged_start" )) - self.dither() + self.wait() new_comp = Matrix(self.get_result()) new_comp.next_to(comp.split()[1].submobjects[-1], RIGHT) @@ -712,7 +712,7 @@ class GeneralMultiplication(MoreComplicatedExampleNumerically): ) ] ) - self.dither() + self.wait() self.play(FadeOut(words)) return m1, m2, comp @@ -726,9 +726,9 @@ class MoreComplicatedExampleWithJustIHat(MoreComplicatedExampleVisually): self.setup() self.add_vector(self.v_coords, self.v_color) self.apply_transposed_matrix(self.t_matrix1) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix2) - self.dither() + self.wait() class MoreComplicatedExampleWithJustJHat(MoreComplicatedExampleWithJustIHat): CONFIG = { @@ -777,13 +777,13 @@ class AskAboutCommutativity(Scene): run_time = 2 ) self.play(Write(q_marks)) - self.dither() + self.wait() self.play(Transform( VMobject(eq, q_marks), VMobject(neq), submobject_mode = "lagged_start" )) - self.dither() + self.wait() class ShowShear(LinearTransformationScene): CONFIG = { @@ -799,9 +799,9 @@ class ShowShear(LinearTransformationScene): title.add_background_rectangle() self.add_foreground_mobject(title) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() class ShowRotation(ShowShear): CONFIG = { @@ -836,11 +836,11 @@ class FirstShearThenRotation(LinearTransformationScene): self.apply_transposed_matrix(self.t_matrix1) self.apply_transposed_matrix(self.t_matrix2) self.i_hat.rotate(-0.01)##Laziness - self.dither() + self.wait() self.write_vector_coordinates(self.i_hat, color = X_COLOR) - self.dither() + self.wait() self.write_vector_coordinates(self.j_hat, color = Y_COLOR) - self.dither() + self.wait() class RotationThenShear(FirstShearThenRotation): CONFIG = { @@ -869,7 +869,7 @@ class NoticeTheLackOfComputations(TeacherStudentsScene): for i, pi in enumerate(students) ]) self.random_blink() - self.dither() + self.wait() class AskAssociativityQuestion(Scene): def construct(self): @@ -899,12 +899,12 @@ class AskAssociativityQuestion(Scene): self.add(morty, title) - self.dither() + self.wait() self.play(Blink(morty)) self.play(Write(start)) - self.dither() + self.wait() self.play(Transform(start, lhs)) - self.dither() + self.wait() self.play( Transform(lhs, rhs, path_arc = -np.pi), Write(eq) @@ -936,7 +936,7 @@ class AskAssociativityQuestion(Scene): )) self.remove(*self.get_mobjects_from_last_animation()) self.add(matrix) - self.dither() + self.wait() self.move_matrix_parentheses(morty, matrices) def move_matrix_parentheses(self, morty, matrices): @@ -964,9 +964,9 @@ class AskAssociativityQuestion(Scene): self.play(morty.change_mode, "angry") for state in state2, state3: self.play(Transform(state1, state)) - self.dither() + self.wait() self.play(morty.change_mode, "confused") - self.dither() + self.wait() class ThreeSuccessiveTransformations(LinearTransformationScene): CONFIG = { @@ -1013,7 +1013,7 @@ class ThreeSuccessiveTransformations(LinearTransformationScene): ) self.apply_transposed_matrix(t_matrix, run_time = 1) last = sym - self.dither() + self.wait() class ThreeSuccessiveTransformationsAltParens(ThreeSuccessiveTransformations): CONFIG = { @@ -1048,7 +1048,7 @@ class ExplanationTrumpsProof(Scene): explanation.scale_in_place, 1.5, proof.scale_in_place, 0.7 ) - self.dither() + self.wait() class GoPlay(TeacherStudentsScene): def construct(self): @@ -1070,7 +1070,7 @@ class GoPlay(TeacherStudentsScene): self.play(student.change_mode, "pondering") for x in range(3): self.random_blink() - self.dither(2) + self.wait(2) class NextVideo(Scene): def construct(self): @@ -1085,7 +1085,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() diff --git a/old_projects/eola/chapter5.py b/old_projects/eola/chapter5.py index 4b8d1a4b..7e3afa8a 100644 --- a/old_projects/eola/chapter5.py +++ b/old_projects/eola/chapter5.py @@ -96,9 +96,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(FadeIn(words)) - self.dither(2) + self.wait(2) self.play(Write(author, run_time = 3)) - self.dither() + self.wait() class MovingForward(TeacherStudentsScene): def construct(self): @@ -118,14 +118,14 @@ class MovingForward(TeacherStudentsScene): ShowCreation(bubble), student.change_mode, "pondering" ) - self.dither(2) + self.wait(2) class StretchingTransformation(LinearTransformationScene): def construct(self): self.setup() self.add_title("Generally stretches space") self.apply_transposed_matrix([[3, 1], [-1, 2]]) - self.dither() + self.wait() class SquishingTransformation(LinearTransformationScene): CONFIG = { @@ -139,7 +139,7 @@ class SquishingTransformation(LinearTransformationScene): self.setup() self.add_title("Generally squishes space") self.apply_transposed_matrix([[1./2, -0.5], [1, 1./3]]) - self.dither() + self.wait() class AskAboutStretching(LinearTransformationScene): def construct(self): @@ -155,7 +155,7 @@ class AskAboutStretching(LinearTransformationScene): [[2, 1], [-1, 3]], added_anims = [Write(words)] ) - self.dither() + self.wait() class AskAboutStretchingSpecifically(LinearTransformationScene): def construct(self): @@ -174,17 +174,17 @@ class AskAboutStretchingSpecifically(LinearTransformationScene): self.add_transformable_mobject(blob) self.add_moving_mobject(label, target_label) - self.dither() + self.wait() self.apply_transposed_matrix([[2, -1], [1, 1]]) arrow = Arrow(scaled, label.target.split()[0]) self.play(ShowCreation(arrow)) - self.dither() + self.wait() class BeautyNowUsesLater(TeacherStudentsScene): def construct(self): self.setup() self.teacher_says("Beauty now, uses later") - self.dither() + self.wait() class DiagonalExample(LinearTransformationScene): CONFIG = { @@ -202,10 +202,10 @@ class DiagonalExample(LinearTransformationScene): if self.show_square: self.add_unit_square(animate = True) self.add_foreground_mobject(matrix_background, matrix) - self.dither() + self.wait() self.apply_transposed_matrix([self.transposed_matrix[0], [0, 1]]) self.apply_transposed_matrix([[1, 0], self.transposed_matrix[1]]) - self.dither() + self.wait() if self.show_square: @@ -218,7 +218,7 @@ class DiagonalExample(LinearTransformationScene): for mob in bottom_brace, width, right_brace, height: mob.add_background_rectangle() self.play(Write(mob, run_time = 0.5)) - self.dither() + self.wait() width_target, height_target = width.copy(), height.copy() det = np.linalg.det(self.transposed_matrix) @@ -238,7 +238,7 @@ class DiagonalExample(LinearTransformationScene): Transform(height.copy(), height_target), *map(Write, [words, times, eq_det]) ) - self.dither() + self.wait() class DiagonalExampleWithSquare(DiagonalExample): CONFIG = { @@ -279,9 +279,9 @@ class ThisSquareTellsEverything(LinearTransformationScene): self.play(Write(words, run_time = 2)) self.play(ShowCreation(arrow)) self.add_foreground_mobject(words, arrow) - self.dither() + self.wait() self.apply_transposed_matrix([[1.5, -0.5], [1, 1.5]]) - self.dither() + self.wait() class WhatHappensToOneSquareHappensToAll(LinearTransformationScene): def construct(self): @@ -307,7 +307,7 @@ class WhatHappensToOneSquareHappensToAll(LinearTransformationScene): )) self.add_transformable_mobject(squares) self.apply_transposed_matrix([[1, -1], [0.5, 1]]) - self.dither() + self.wait() class BreakBlobIntoGridSquares(LinearTransformationScene): CONFIG = { @@ -340,9 +340,9 @@ class BreakBlobIntoGridSquares(LinearTransformationScene): run_time = 2, )) self.add_transformable_mobject(squares) - self.dither() + self.wait() self.apply_transposed_matrix([[1, -1], [0.5, 1]]) - self.dither() + self.wait() class BreakBlobIntoGridSquaresGranular(BreakBlobIntoGridSquares): CONFIG = { @@ -390,9 +390,9 @@ class NameDeterminant(LinearTransformationScene): area_label_target.arrange_submobjects(RIGHT, buff = 0.1) self.add_moving_mobject(area_label, area_label_target) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() det_mob_copy = area_label.split()[0].copy() new_det_mob = det_mob_copy.copy().scale_to_fit_height( det_text.split()[0].get_height() @@ -402,7 +402,7 @@ class NameDeterminant(LinearTransformationScene): det_mob_copy.add_background_rectangle(opacity = 0) self.play(Write(det_text)) self.play(Transform(det_mob_copy, new_det_mob)) - self.dither() + self.wait() def get_matrix(self): @@ -462,7 +462,7 @@ class NextFewVideos(Scene): FadeIn(icons, submobject_mode = "lagged_start"), run_time = 3 ) - self.dither() + self.wait() class UnderstandingBeforeApplication(TeacherStudentsScene): def construct(self): @@ -472,7 +472,7 @@ class UnderstandingBeforeApplication(TeacherStudentsScene): understanding for now """) self.random_blink() - self.dither() + self.wait() class WhatIveSaidSoFar(TeacherStudentsScene): def construct(self): @@ -481,7 +481,7 @@ class WhatIveSaidSoFar(TeacherStudentsScene): What I've said so far is not quite right... """) - self.dither() + self.wait() class NegativeDeterminant(Scene): def construct(self): @@ -500,13 +500,13 @@ class NegativeDeterminant(Scene): self.add(matrix) self.play(Write(det_text)) - self.dither() + self.wait() self.play( Write(words, run_time = 2), ShowCreation(arrow) ) self.play(det_num.highlight, YELLOW) - self.dither() + self.wait() class FlipSpaceOver(Scene): def construct(self): @@ -529,7 +529,7 @@ class FlipSpaceOver(Scene): plane1, submobject_mode = "lagged_start", run_time = 1 )) - self.dither() + self.wait() self.play(Rotate( plane1, axis = axis, rate_func = lambda t : smooth(t/2), @@ -543,7 +543,7 @@ class FlipSpaceOver(Scene): run_time = 1.5, path_arc = np.pi/2, )) - self.dither() + self.wait() class RandyThinking(Scene): def construct(self): @@ -555,9 +555,9 @@ class RandyThinking(Scene): randy.change_mode, "pondering", ShowCreation(bubble) ) - self.dither() + self.wait() self.play(Blink(randy)) - self.dither(2) + self.wait(2) self.play(Blink(randy)) class NegativeDeterminantTransformation(LinearTransformationScene): @@ -567,9 +567,9 @@ class NegativeDeterminantTransformation(LinearTransformationScene): def construct(self): self.setup() self.add_title("Feels like flipping space") - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() class ThinkAboutFlippingPaper(Scene): def construct(self): @@ -618,7 +618,7 @@ class IHatJHatOrientation(NegativeDeterminantTransformation): self.play(ShowCreation(arc)) self.play(Write(words1)) - self.dither() + self.wait() self.remove(words1, arc) self.apply_transposed_matrix(self.t_matrix) arc.submobjects = [] @@ -629,12 +629,12 @@ class IHatJHatOrientation(NegativeDeterminantTransformation): ShowCreation(arc), Write(words2, run_time = 2), ) - self.dither() + self.wait() title = TextMobject("Orientation has been reversed") title.to_edge(UP) title.add_background_rectangle() self.play(Write(title, run_time = 1)) - self.dither() + self.wait() class WriteNegativeDeterminant(NegativeDeterminantTransformation): def construct(self): @@ -659,11 +659,11 @@ class WriteNegativeDeterminant(NegativeDeterminantTransformation): Write(det_text), ) self.add_foreground_mobject(matrix_background, matrix, det_text) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) self.play(three.copy().move_to, self.square) - self.dither() + self.wait() class AltWriteNegativeDeterminant(WriteNegativeDeterminant): CONFIG = { @@ -683,7 +683,7 @@ class WhyNegativeScaling(TeacherStudentsScene): for student in other_students ]) self.random_blink() - self.dither() + self.wait() self.random_blink() class SlowlyRotateIHat(LinearTransformationScene): @@ -739,7 +739,7 @@ class WhatAboutThreeDimensions(TeacherStudentsScene): transformations? """) self.random_blink() - self.dither() + self.wait() self.random_blink() class Transforming3DCube(Scene): @@ -755,7 +755,7 @@ class NameParallelepiped(Scene): pp_part1.submobject_gradient_highlight(X_COLOR, Y_COLOR) pp_part2.submobject_gradient_highlight(Y_COLOR, Z_COLOR) self.play(Write(word)) - self.dither(2) + self.wait(2) class DeterminantIsVolumeOfParallelepiped(Scene): def construct(self): @@ -778,9 +778,9 @@ class DeterminantIsVolumeOfParallelepiped(Scene): words.next_to(eq, RIGHT) self.play(Write(matrix)) - self.dither() + self.wait() self.play(Write(det_text), Write(words), Write(eq)) - self.dither() + self.wait() class Degenerate3DTransformation(Scene): def construct(self): @@ -801,14 +801,14 @@ class WriteZeroDeterminant(Scene): words.next_to(brace, DOWN) self.play(Write(matrix)) - self.dither() + self.wait() self.play(Write(det_text)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(words, run_time = 2) ) - self.dither() + self.wait() class AskAboutNegaive3DDeterminant(TeacherStudentsScene): def construct(self): @@ -818,7 +818,7 @@ class AskAboutNegaive3DDeterminant(TeacherStudentsScene): """) self.random_blink() self.play(self.teacher.change_mode, "pondering") - self.dither() + self.wait() self.random_blink() class OrientationReversing3DTransformation(Scene): @@ -855,14 +855,14 @@ class RightHandRule(Scene): ShowCreation(hand.outline, run_time = 2, rate_func = None), FadeIn(hand.inlines) ) - self.dither() + self.wait() for vect, label, color in zip(vects, labels, self.colors): vect.highlight(color) label.highlight(color) vect.set_stroke(width = 8) self.play(ShowCreation(vect)) self.play(Write(label)) - self.dither() + self.wait() class LeftHandRule(RightHandRule): CONFIG = { @@ -876,7 +876,7 @@ class AskHowToCompute(TeacherStudentsScene): self.student_says("How do you \\\\ compute this?") self.play(student.change_mode, "confused") self.random_blink() - self.dither() + self.wait() self.random_blink() class TwoDDeterminantFormula(Scene): @@ -910,18 +910,18 @@ class TwoDDeterminantFormula(Scene): self.add(matrix) self.play(Write(det_text, run_time = 1)) self.play(Write(eq), Write(formula)) - self.dither() + self.wait() self.play(*[ Transform(m, m.zero) for m in mb, mc, b, c ]) - self.dither() + self.wait() for pair in (mb, b), (mc, c): self.play(*[ Transform(m, m.original) for m in pair ]) - self.dither() + self.wait() class TwoDDeterminantFormulaIntuition(LinearTransformationScene): def construct(self): @@ -929,7 +929,7 @@ class TwoDDeterminantFormulaIntuition(LinearTransformationScene): self.add_unit_square() a, b, c, d = 3, 2, 3.5, 2 - self.dither() + self.wait() self.apply_transposed_matrix([[a, 0], [0, 1]]) i_brace = Brace(self.i_hat, DOWN) width = TexMobject("a").scale(1.5) @@ -937,7 +937,7 @@ class TwoDDeterminantFormulaIntuition(LinearTransformationScene): width.highlight(X_COLOR) width.add_background_rectangle() self.play(GrowFromCenter(i_brace), Write(width)) - self.dither() + self.wait() self.apply_transposed_matrix([[1, 0], [0, d]]) side_brace = Brace(self.square, RIGHT) @@ -946,7 +946,7 @@ class TwoDDeterminantFormulaIntuition(LinearTransformationScene): height.highlight(Y_COLOR) height.add_background_rectangle() self.play(GrowFromCenter(side_brace), Write(height)) - self.dither() + self.wait() self.apply_transposed_matrix( [[1, 0], [float(b)/d, 1]], @@ -955,7 +955,7 @@ class TwoDDeterminantFormulaIntuition(LinearTransformationScene): for m in side_brace, height ] ) - self.dither() + self.wait() self.play(*map(FadeOut, [i_brace, side_brace, width, height])) matrix1 = np.dot( [[a, b], [c, d]], @@ -966,9 +966,9 @@ class TwoDDeterminantFormulaIntuition(LinearTransformationScene): np.linalg.inv([[a, b], [c, d]]) ) self.apply_transposed_matrix(matrix1.transpose(), path_arc = 0) - self.dither() + self.wait() self.apply_transposed_matrix(matrix2.transpose(), path_arc = 0) - self.dither() + self.wait() class FullFormulaExplanation(LinearTransformationScene): def construct(self): @@ -1063,7 +1063,7 @@ class FullFormulaExplanation(LinearTransformationScene): ShowCreation(background_rect), Write(everyone) ) - self.dither() + self.wait() class ThreeDDetFormula(Scene): def construct(self): @@ -1095,14 +1095,14 @@ class ThreeDDetFormula(Scene): everyone.center().to_edge(UP) for part in parts: self.play(Write(part)) - self.dither(2) + self.wait(2) class QuizTime(TeacherStudentsScene): def construct(self): self.setup() self.teacher_says("Quiz time!") self.random_blink() - self.dither() + self.wait() self.random_blink() class ProductProperty(Scene): @@ -1137,12 +1137,12 @@ class ProductProperty(Scene): self.play(Write(m1)) self.play(Write(m2)) - self.dither() + self.wait() self.play(Write(det), Write(rp)) self.play(Write(rhs)) - self.dither(2) + self.wait(2) self.play(Write(title)) - self.dither(2) + self.wait(2) class NextVideo(Scene): def construct(self): @@ -1157,7 +1157,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() diff --git a/old_projects/eola/chapter6.py b/old_projects/eola/chapter6.py index 86d1193e..5a442e69 100644 --- a/old_projects/eola/chapter6.py +++ b/old_projects/eola/chapter6.py @@ -36,9 +36,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(FadeIn(words)) - self.dither(2) + self.wait(2) self.play(Write(author, run_time = 3)) - self.dither() + self.wait() class ListTerms(Scene): def construct(self): @@ -62,8 +62,8 @@ class ListTerms(Scene): if i%2 == 0: self.play(Blink(randy)) else: - self.dither() - self.dither() + self.wait() + self.wait() class NoComputations(TeacherStudentsScene): def construct(self): @@ -85,7 +85,7 @@ class NoComputations(TeacherStudentsScene): ) ]) self.random_blink() - self.dither() + self.wait() new_words = self.teacher.bubble.position_mobject_inside( TextMobject([ "Search", @@ -116,7 +116,7 @@ class UsefulnessOfMatrices(Scene): title.highlight(YELLOW) title.to_edge(UP) self.add(title) - self.dither(3) #Play some 3d linear transform over this + self.wait(3) #Play some 3d linear transform over this equations = TexMobject(""" 6x - 3y + 2z &= 7 \\\\ @@ -137,14 +137,14 @@ class UsefulnessOfMatrices(Scene): eq_words = eq_brace.get_text("Equations") self.play(Write(equations)) - self.dither() + self.wait() self.play(Transform(syms.copy(), new_syms, path_arc = np.pi/2)) for brace, words in (sym_brace, unknowns), (eq_brace, eq_words): self.play( GrowFromCenter(brace), Write(words) ) - self.dither() + self.wait() class CircuitDiagram(Scene): def construct(self): @@ -166,9 +166,9 @@ class CircuitDiagram(Scene): unknowns.highlight(BLUE) self.play(ShowCreation(circuit)) - self.dither() + self.wait() self.play(Write(unknowns)) - self.dither() + self.wait() class StockLine(VMobject): CONFIG = { @@ -203,7 +203,7 @@ class StockPrices(Scene): run_time = 3, submobject_mode = "lagged_start" )) - self.dither() + self.wait() class MachineLearningNetwork(Scene): def construct(self): @@ -230,7 +230,7 @@ class MachineLearningNetwork(Scene): lines.submobject_gradient_highlight(BLUE_E, BLUE_A) for mob in VMobject(*layers), lines: self.play(Write(mob), run_time = 2) - self.dither() + self.wait() class ComplicatedSystem(Scene): def construct(self): @@ -248,7 +248,7 @@ class ComplicatedSystem(Scene): self.play(Write(system, run_time = 1)) self.play(randy.change_mode, "sassy") self.play(Blink(randy)) - self.dither() + self.wait() class SystemOfEquations(Scene): def construct(self): @@ -313,14 +313,14 @@ class SystemOfEquations(Scene): ApplyMethod(m.scale_in_place, 1.2, rate_func = there_and_back) for m in scalars.split() ]) - self.dither() + self.wait() self.remove(scalars) self.play(scaled_vars.restore) self.play(*[ ApplyMethod(p.scale_in_place, 1.5, rate_func = there_and_back) for p in plusses ]) - self.dither() + self.wait() self.show_nonlinearity_examples() self.play(other_equations.restore) @@ -351,7 +351,7 @@ class SystemOfEquations(Scene): circle_slash.replace(mob) circle_slash.scale_in_place(1.4) self.play(ShowCreation(circle_slash), run_time = 0.5) - self.dither(0.5) + self.wait(0.5) self.play(FadeOut(circle_slash), run_time = 0.5) self.play( @@ -364,7 +364,7 @@ class SystemOfEquations(Scene): self.play(Transform(squared, mob)) draw_circle_slash(mob) self.play(*map(FadeOut, [words, arrow, squared])) - self.dither() + self.wait() def describe_organization(self, equations): @@ -413,20 +413,20 @@ class SystemOfEquations(Scene): FadeIn(mob.square), FadeIn(mob.words) ) - self.dither() + self.wait() self.play(*map(FadeOut, [mob.square, mob.words])) self.play( ShowCreation(zero_circles), Write(zero_circles.words, run_time = 1) ) - self.dither() + self.wait() self.play(*map(FadeOut, [zero_circles, zero_circles.words])) - self.dither() + self.wait() title = TextMobject("``Linear system of equations''") title.scale(1.5) title.to_edge(UP) self.play(Write(title)) - self.dither() + self.wait() self.play(FadeOut(title)) @@ -484,7 +484,7 @@ class SystemOfEquations(Scene): Write(mob) for mob in all_brackets + [equals] ]) - self.dither() + self.wait() self.label_matrix_product(matrix, x_array, v_array) def label_matrix_product(self, matrix, x_array, v_array): @@ -511,9 +511,9 @@ class SystemOfEquations(Scene): GrowFromCenter(mob.brace), FadeIn(mob.words) ) - self.dither() + self.wait() self.play(*map(FadeOut, [mob.brace, mob.words])) - self.dither() + self.wait() for mob in parts: self.play( FadeIn(mob.brace), @@ -533,7 +533,7 @@ class SystemOfEquations(Scene): compact_equation.copy(), compact_equation.target )) - self.dither() + self.wait() class LinearSystemTransformationScene(LinearTransformationScene): def setup(self): @@ -565,7 +565,7 @@ class MentionThatItsATransformation(LinearSystemTransformationScene): self.play(GrowFromCenter(brace), Write(words, run_time = 1)) self.add_foreground_mobject(words, brace) self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() class LookForX(MentionThatItsATransformation): CONFIG = { @@ -591,10 +591,10 @@ class LookForX(MentionThatItsATransformation): ShowCreation(x), Write(x_label) ) - self.dither() + self.wait() self.add(VMobject(x, x_label).copy().fade()) self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() class ThinkAboutWhatsHappening(Scene): def construct(self): @@ -611,7 +611,7 @@ class ThinkAboutWhatsHappening(Scene): self.play(ShowCreation(bubble)) self.play(Write(bubble.content, run_time = 2)) self.play(Blink(randy)) - self.dither() + self.wait() everything = VMobject(*self.get_mobjects()) self.play( ApplyFunction( @@ -656,10 +656,10 @@ class SystemOfTwoEquationsTwoUnknowns(Scene): self.add(system) self.play(Write(matrix_system)) - self.dither() + self.wait() for mob in matrix, v, x: self.play(Write(mob.brace)) - self.dither() + self.wait() class ShowBijectivity(LinearTransformationScene): CONFIG = { @@ -702,16 +702,16 @@ class ShowBijectivity(LinearTransformationScene): anims = map(Animation, self.foreground_mobjects) self.play(ShowCreation(vectors, **kwargs), *anims) self.play(Transform(vectors, dots, **kwargs), *anims) - self.dither() + self.wait() self.add_transformable_mobject(vectors) self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() self.play(Transform(*titles)) - self.dither() + self.wait() self.apply_transposed_matrix( np.linalg.inv(self.t_matrix.T).T ) - self.dither() + self.wait() class LabeledExample(LinearSystemTransformationScene): CONFIG = { @@ -731,9 +731,9 @@ class LabeledExample(LinearSystemTransformationScene): self.add_unit_square() def construct(self): - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() class SquishExmapleWithWords(LabeledExample): CONFIG = { @@ -772,7 +772,7 @@ class StartWithNonzeroDetCase(TeacherStudentsScene): random.choice(self.get_students()).change_mode, "happy" ) - self.dither() + self.wait() class DeclareNewTransformation(TeacherStudentsScene): def construct(self): @@ -797,7 +797,7 @@ class PlayInReverse(FullRankExmapleDet): self.apply_inverse_transpose(self.t_matrix) self.play(v.highlight, PINK) self.label_vector(v, "x", color = PINK) - self.dither() + self.wait() class DescribeInverse(LinearTransformationScene): CONFIG = { @@ -840,10 +840,10 @@ class DescribeInverse(LinearTransformationScene): self.add_foreground_mobject(title) self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() self.play(Transform(title, new_title)) self.apply_inverse_transpose(self.t_matrix) - self.dither() + self.wait() class ClockwiseCounterclockwise(DescribeInverse): CONFIG = { @@ -899,12 +899,12 @@ class MultiplyToIdentity(LinearTransformationScene): Transform(text, A_inv.text), ) self.apply_inverse_transpose(self.t_matrix) - self.dither() + self.wait() self.play( Transform(brace, product.brace), Transform(text, product.text) ) - self.dither() + self.wait() self.play( Write(identity.background), Write(identity.get_brackets()), @@ -912,11 +912,11 @@ class MultiplyToIdentity(LinearTransformationScene): Transform(brace, identity.brace), Transform(text, identity.text) ) - self.dither() + self.wait() self.play(Write(col1)) - self.dither() + self.wait() self.play(Write(col2)) - self.dither() + self.wait() class ThereAreComputationMethods(TeacherStudentsScene): def construct(self): @@ -925,7 +925,7 @@ class ThereAreComputationMethods(TeacherStudentsScene): to compute $A^{-1}$ """) self.random_blink() - self.dither() + self.wait() class TwoDInverseFormula(Scene): def construct(self): @@ -970,12 +970,12 @@ class SymbolicInversion(Scene): self.add(start) self.play(Write(words), FadeIn(inv), run_time = 1) - self.dither() + self.wait() self.play( FadeOut(words), *[Transform(m, m.interim) for m in interim_mobs] ) - self.dither() + self.wait() product = VMobject(A, inv) product.brace = Brace(product) @@ -988,17 +988,17 @@ class SymbolicInversion(Scene): Write(product.words, run_time = 1), product.highlight, BLUE ) - self.dither() + self.wait() self.play(*[ ApplyMethod(m.highlight, BLACK) for m in product, product.brace, product.words ]) - self.dither() + self.wait() self.play(ApplyFunction( lambda m : m.center().to_edge(UP), VMobject(x, eq, inv2, v) )) - self.dither() + self.wait() class PlayInReverseWithSolution(PlayInReverse): CONFIG = { @@ -1038,14 +1038,14 @@ class OneUniqueSolution(Scene): words.split()[1].highlight(GREEN) self.add(system) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(words.split()[0]) ) - self.dither() + self.wait() self.play(Write(words.split()[1], run_time = 1)) - self.dither() + self.wait() class ThreeDTransformXToV(Scene): pass @@ -1061,10 +1061,10 @@ class DetNEZeroRule(Scene): A_inv.shift(DOWN) arrow = Arrow(text, A_inv) self.play(Write(text)) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.play(Write(A_inv, run_time = 1)) - self.dither() + self.wait() class ThreeDInverseRule(Scene): @@ -1076,7 +1076,7 @@ class ThreeDInverseRule(Scene): matrix.next_to(form, RIGHT) self.add(form) self.play(Write(matrix)) - self.dither() + self.wait() class ThreeDApplyReverseToV(Scene): pass @@ -1085,7 +1085,7 @@ class InversesDontAlwaysExist(TeacherStudentsScene): def construct(self): self.teacher_says("$A^{-1}$ doesn't always exist") self.random_blink() - self.dither() + self.wait() self.random_blink() class InvertNonInvertable(LinearTransformationScene): @@ -1108,7 +1108,7 @@ class InvertNonInvertable(LinearTransformationScene): grid = VMobject(self.plane, self.i_hat, self.j_hat) grid.save_state() self.apply_transposed_matrix(self.t_matrix, path_arc = 0) - self.dither() + self.wait() self.play(Write(no_func, run_time = 1)) self.add_foreground_mobject(no_func) self.play( @@ -1116,7 +1116,7 @@ class InvertNonInvertable(LinearTransformationScene): *map(Animation, self.foreground_mobjects), run_time = 3 ) - self.dither() + self.wait() class OneInputMultipleOutputs(InvertNonInvertable): def construct(self): @@ -1136,7 +1136,7 @@ class OneInputMultipleOutputs(InvertNonInvertable): single_input.next_to(output_vector.get_end(), UP) single_input.highlight(YELLOW) self.play(Write(single_input)) - self.dither() + self.wait() self.remove(single_input, output_vector) self.play( grid.restore, @@ -1154,7 +1154,7 @@ class OneInputMultipleOutputs(InvertNonInvertable): multiple_outputs.next_to(ORIGIN, DOWN).to_edge(RIGHT) multiple_outputs.add_background_rectangle() self.play(Write(multiple_outputs, run_time = 2)) - self.dither() + self.wait() class SolutionsCanStillExist(TeacherStudentsScene): def construct(self): @@ -1180,7 +1180,7 @@ class ShowVInAndOutOfColumnSpace(LinearSystemTransformationScene): self.apply_transposed_matrix(self.t_matrix, path_arc = 0) - self.dither() + self.wait() for v in v_in, v_out: self.add_vector(v, animate = True) words = TextMobject(v.words) @@ -1188,7 +1188,7 @@ class ShowVInAndOutOfColumnSpace(LinearSystemTransformationScene): words.next_to(v.get_end(), DOWN+RIGHT) words.add_background_rectangle() self.play(Write(words), run_time = 2) - self.dither() + self.wait() class NotAllSquishesAreCreatedEqual(TeacherStudentsScene): def construct(self): @@ -1206,7 +1206,7 @@ class PrepareForRank(Scene): ) rank.highlight(TEAL) self.play(Write(words)) - self.dither() + self.wait() class DefineRank(Scene): def construct(self): @@ -1227,7 +1227,7 @@ class DefineRank(Scene): ShowCreation(arrow), *map(Write, dims) ) - self.dither() + self.wait() class DefineColumnSpace(Scene): def construct(self): @@ -1247,12 +1247,12 @@ class DefineColumnSpace(Scene): everyone.to_edge(UP) self.play(Write(left_words)) - self.dither() + self.wait() self.play( ShowCreation(arrow), Write(right_words) ) - self.dither() + self.wait() class ColumnsRepresentBasisVectors(Scene): def construct(self): @@ -1268,7 +1268,7 @@ class ColumnsRepresentBasisVectors(Scene): j_hat_words.next_to(ORIGIN, RIGHT).to_edge(UP) self.add(matrix) - self.dither() + self.wait() for i, words in enumerate([i_hat_words, j_hat_words]): arrow = Arrow( @@ -1284,7 +1284,7 @@ class ColumnsRepresentBasisVectors(Scene): for m in matrix.get_mob_matrix()[:,i] ] ) - self.dither() + self.wait() class ThreeDOntoPlane(Scene): pass @@ -1323,7 +1323,7 @@ class TowDColumnsDontSpan(LinearTransformationScene): GrowFromCenter(brace), Write(words, run_time = 2) ) - self.dither() + self.wait() self.play(ApplyFunction( lambda m : m.scale(-1).shift(self.i_hat.get_end()), self.j_hat @@ -1373,7 +1373,7 @@ class ThreeDColumnsDontSpan(Scene): GrowFromCenter(brace), Write(words, run_time = 2) ) - self.dither() + self.wait() class NameColumnSpace(Scene): def construct(self): @@ -1417,7 +1417,7 @@ class NameColumnSpace(Scene): text.next_to(matrix, DOWN, buff = 1, aligned_edge = LEFT) self.add(matrix) - self.dither() + self.wait() self.play(*[ Transform( VMobject(*matrix.copy().get_mob_matrix()[:,i]), @@ -1433,7 +1433,7 @@ class NameColumnSpace(Scene): ShowCreation(arrow), Write(column_space) ) - self.dither() + self.wait() self.play(FadeOut(matrix)) self.clear() self.add(text) @@ -1452,7 +1452,7 @@ class NameColumnSpace(Scene): words.to_corner(UP+LEFT) self.play(Write(words)) - self.dither(2) + self.wait(2) self.play(FadeOut(words)) brace = Brace(column_space, UP) @@ -1465,7 +1465,7 @@ class NameColumnSpace(Scene): GrowFromCenter(brace), Write(rank_words) ) - self.dither() + self.wait() self.cycle_through_span_possibilities(span_text) def cycle_through_span_possibilities(self, span_text): @@ -1492,13 +1492,13 @@ class NameColumnSpace(Scene): span_text = span_text.copy().restore() ### self.add(two_d_span) - self.dither() + self.wait() self.replace_number_matrix(mob_matrix, [[1, 1], [1, 1]]) - self.dither() + self.wait() self.replace_number_matrix(mob_matrix, [[0, 0], [0, 0]]) - self.dither() + self.wait() self.play(Transform(two_d_span, span_text)) - self.dither() + self.wait() self.remove(two_d_span) self.add(span_text) mob_matrix = np.array([ @@ -1506,13 +1506,13 @@ class NameColumnSpace(Scene): for i in 2, 4, 6 ]) self.replace_number_matrix(mob_matrix, [[1, 1, 0], [0, 1, 1], [1, 0, 1]]) - self.dither() + self.wait() self.replace_number_matrix(mob_matrix, [[1, 1, 0], [0, 1, 1], [-1, -2, -1]]) - self.dither() + self.wait() self.replace_number_matrix(mob_matrix, [[1, 1, 0], [2, 2, 0], [3, 3, 0]]) - self.dither() + self.wait() self.replace_number_matrix(mob_matrix, np.zeros((3, 3)).astype('int')) - self.dither() + self.wait() def replace_number_matrix(self, matrix, new_numbers): @@ -1536,7 +1536,7 @@ class IHatShear(LinearTransformationScene): } def construct(self): self.apply_transposed_matrix([[1, 1], [0, 1]]) - self.dither() + self.wait() class DiagonalDegenerate(LinearTransformationScene): def construct(self): @@ -1550,7 +1550,7 @@ class ZeroMatirx(LinearTransformationScene): origin, run_time = 3 )) - self.dither() + self.wait() class RankNumber(Scene): CONFIG = { @@ -1601,9 +1601,9 @@ class NameFullRank(Scene): GrowFromCenter(brace), Write(top_words) ) - self.dither() + self.wait() self.play(Write(low_words)) - self.dither() + self.wait() class OriginIsAlwaysInColumnSpace(LinearTransformationScene): def construct(self): @@ -1621,11 +1621,11 @@ class OriginIsAlwaysInColumnSpace(LinearTransformationScene): self.play(ShowCreation(arrow)) self.play(ShowCreation(dot, run_time = 0.5)) self.add_foreground_mobject(vector, words, arrow, dot) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() self.apply_transposed_matrix([[1./3, -1./2], [-1./3, 1./2]]) - self.dither() + self.wait() class FullRankCase(LinearTransformationScene): CONFIG = { @@ -1662,7 +1662,7 @@ class FullRankCase(LinearTransformationScene): self.add_foreground_mobject(title, arrow, dot) words_on = True self.apply_inverse_transpose(t_matrix) - self.dither() + self.wait() class NameNullSpace(LinearTransformationScene): CONFIG = { @@ -1683,7 +1683,7 @@ class NameNullSpace(LinearTransformationScene): mob.add_background_rectangle() self.play(ShowCreation(vectors, run_time = 3)) - self.dither() + self.wait() vectors.save_state() self.plane.save_state() self.apply_transposed_matrix( @@ -1691,7 +1691,7 @@ class NameNullSpace(LinearTransformationScene): added_anims = [Transform(vectors, dot)], path_arc = 0 ) - self.dither() + self.wait() self.play( vectors.restore, self.plane.restore, @@ -1703,10 +1703,10 @@ class NameNullSpace(LinearTransformationScene): run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() for label in null_space_label, kernel_label: self.play(Write(label)) - self.dither() + self.wait() self.apply_transposed_matrix( self.t_matrix, added_anims = [ @@ -1716,7 +1716,7 @@ class NameNullSpace(LinearTransformationScene): ], path_arc = 0 ) - self.dither() + self.wait() def get_vectors(self, offset = 0): vect = np.array(UP+RIGHT) @@ -1749,12 +1749,12 @@ class NullSpaceSolveForVEqualsZero(NameNullSpace): equation.add_background_rectangle() self.play(Write(equation)) - self.dither() + self.wait() self.play( ShowCreation(zero_vector_rect), Transform(v, zero_vector) ) - self.dither() + self.wait() self.add_foreground_mobject(zero_vector_rect, equation) NameNullSpace.construct(self) @@ -1786,9 +1786,9 @@ class OffsetNullSpace(NameNullSpace): ]) self.play(FadeIn(vectors)) - self.dither() + self.wait() self.add_vector(x, animate = True) - self.dither() + self.wait() x_copy = VMobject(x.copy()) self.play(Transform(x_copy, x_copies)) self.play( @@ -1799,19 +1799,19 @@ class OffsetNullSpace(NameNullSpace): ] ) self.remove(x_copy) - self.dither() + self.wait() self.play(Transform(vectors, dots)) - self.dither() + self.wait() self.apply_transposed_matrix( self.t_matrix, added_anims = [Transform(vectors, dot)] ) - self.dither() + self.wait() self.play( ShowCreation(circle), Write(words) ) - self.dither() + self.wait() class ShowAdditivityProperty(LinearTransformationScene): CONFIG = { @@ -1859,10 +1859,10 @@ class ShowAdditivityProperty(LinearTransformationScene): self.t_matrix, added_anims = [Write(transformer)] ) - self.dither() + self.wait() self.play(w.copy().shift, v.get_end()) self.play(Write(final_sum)) - self.dither() + self.wait() class AddJustOneNullSpaceVector(NameNullSpace): def construct(self): @@ -1909,13 +1909,13 @@ class AddJustOneNullSpaceVector(NameNullSpace): self.add_vector(x, animate = True) self.play(Write(x.label)) - self.dither() + self.wait() self.play( FadeOut(vectors), Animation(null_vector) ) self.play(Write(null_vector.label)) - self.dither() + self.wait() x_copy = x.copy() self.play(x_copy.shift, null_vector.get_end()) self.add_vector(sum_vect, animate = True) @@ -1923,7 +1923,7 @@ class AddJustOneNullSpaceVector(NameNullSpace): FadeOut(x_copy), Write(sum_vect.label) ) - self.dither() + self.wait() self.play( ShowCreation(form_rect), sum_vect.label.replace, initial_sum @@ -1938,9 +1938,9 @@ class AddJustOneNullSpaceVector(NameNullSpace): ] ) self.play(Write(final_sum)) - self.dither() + self.wait() self.play(Write(brace)) - self.dither() + self.wait() words = TextMobject( "$\\vec{\\textbf{x}}$", "and the", @@ -1953,7 +1953,7 @@ class AddJustOneNullSpaceVector(NameNullSpace): words.next_to(brace, DOWN) words.to_edge(RIGHT) self.play(Write(words)) - self.dither() + self.wait() class NullSpaceOffsetRule(Scene): def construct(self): @@ -1983,10 +1983,10 @@ class NullSpaceOffsetRule(Scene): self.add(equation) self.play(Write(A_text, run_time = 2)) self.play(ShowCreation(A_arrow)) - self.dither() + self.wait() self.play(Write(v_text, run_time = 2)) self.play(ShowCreation(v_arrow)) - self.dither() + self.wait() class MuchLeftToLearn(TeacherStudentsScene): def construct(self): @@ -1995,7 +1995,7 @@ class MuchLeftToLearn(TeacherStudentsScene): "level overview" ) self.random_blink() - self.dither() + self.wait() self.teacher_says( "There is still \\\\", "much to learn" @@ -2006,7 +2006,7 @@ class MuchLeftToLearn(TeacherStudentsScene): ]) self.play(pi.change_mode, target_mode) self.random_blink() - self.dither() + self.wait() class NotToLearnItAllNow(TeacherStudentsScene): def construct(self): @@ -2015,7 +2015,7 @@ class NotToLearnItAllNow(TeacherStudentsScene): learn it all now """) self.random_blink() - self.dither() + self.wait() self.random_blink() class NextVideo(Scene): @@ -2031,7 +2031,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class WhatAboutNonsquareMatrices(TeacherStudentsScene): def construct(self): diff --git a/old_projects/eola/chapter7.py b/old_projects/eola/chapter7.py index 4793a369..3cd2e1c1 100644 --- a/old_projects/eola/chapter7.py +++ b/old_projects/eola/chapter7.py @@ -69,7 +69,7 @@ class OpeningQuote(Scene): run_time = rt, lag_factor = 5 if rt > 3 else 2, )) - self.dither(2) + self.wait(2) class TraditionalOrdering(RandolphScene): def construct(self): @@ -96,7 +96,7 @@ class TraditionalOrdering(RandolphScene): ), ) self.play(topics[1].highlight, PINK) - self.dither() + self.wait() class ThisSeriesOrdering(RandolphScene): def construct(self): @@ -145,7 +145,7 @@ class ThisSeriesOrdering(RandolphScene): ) self.play(self.randy.look, UP+LEFT) self.play(chapters[6].highlight, PINK) - self.dither(6) + self.wait(6) class OneMustViewThroughTransformations(TeacherStudentsScene): def construct(self): @@ -222,14 +222,14 @@ class ShowNumericalDotProduct(Scene): FadeIn(inter_array_dot), FadeIn(title) ) - self.dither() + self.wait() if self.write_dot_product_words: self.play( inter_array_dot.highlight, YELLOW, ShowCreation(arrow), Write(dot_product_words, run_time = 2) ) - self.dither() + self.wait() self.play(Transform( VGroup(*it.starmap(Group, pairs)).copy(), products, @@ -238,13 +238,13 @@ class ShowNumericalDotProduct(Scene): )) self.remove(*self.get_mobjects_from_last_animation()) self.add(products) - self.dither() + self.wait() self.play( Write(symbols), Transform(products, products.target, path_arc = np.pi/2) ) - self.dither() + self.wait() class TwoDDotProductExample(ShowNumericalDotProduct): CONFIG = { @@ -318,7 +318,7 @@ class GeometricInterpretation(VectorScene): line = Line(LEFT, RIGHT).scale(SPACE_WIDTH) line.rotate(self.stable_vect.get_angle()) self.play(ShowCreation(line), Animation(self.stable_vect)) - self.dither() + self.wait() def project(self): dot_product = np.dot(self.v.get_end(), self.w.get_end()) @@ -340,7 +340,7 @@ class GeometricInterpretation(VectorScene): self.play(ShowCreation(projection_line)) self.add(self.proj_vect.copy().fade()) self.play(Transform(self.proj_vect, projected)) - self.dither() + self.wait() def show_lengths(self): stable_char = "v" if self.project_onto_v else "w" @@ -383,7 +383,7 @@ class GeometricInterpretation(VectorScene): GrowFromCenter(proj_brace), Write(proj_words.start, run_time = 2) ) - self.dither() + self.wait() self.play( Transform(proj_words.start, proj_words), FadeOut(proj_brace) @@ -393,12 +393,12 @@ class GeometricInterpretation(VectorScene): Write(stable_words.start, run_time = 2), Animation(self.stable_vect) ) - self.dither() + self.wait() self.play( Transform(stable_words.start, stable_words), Write(product) ) - self.dither() + self.wait() product.add(stable_words.start, proj_words.start) self.product = product @@ -425,7 +425,7 @@ class GeometricInterpretation(VectorScene): VMobject(*self.product[1:]).next_to, neg, Write(words) ) - self.dither() + self.wait() class GeometricInterpretationNegative(GeometricInterpretation): CONFIG = { @@ -491,7 +491,7 @@ class ShowQualitativeDotProductValues(VectorScene): self.play(FadeOut(proj_line)) self.play(Write(word, run_time = 1)) - self.dither() + self.wait() self.play( Rotate(w, -np.pi/3), shadow.scale, 0 @@ -500,7 +500,7 @@ class ShowQualitativeDotProductValues(VectorScene): Transform(comp, equals), Transform(word, words[1]) ) - self.dither() + self.wait() self.play( Rotate(w, -np.pi/3), Transform(shadow, shadow_opposite) @@ -509,7 +509,7 @@ class ShowQualitativeDotProductValues(VectorScene): Transform(comp, less_than), Transform(word, words[2]) ) - self.dither() + self.wait() class AskAboutSymmetry(TeacherStudentsScene): def construct(self): @@ -560,7 +560,7 @@ class SymmetricVAndW(VectorScene): for vect in v, w: self.play(ShowCreation(vect)) self.play(Write(vect.label, run_time = 1)) - self.dither() + self.wait() angle = (v.get_angle()-w.get_angle())/2 self.play( Rotate(w, angle), @@ -568,12 +568,12 @@ class SymmetricVAndW(VectorScene): rate_func = there_and_back, run_time = 2 ) - self.dither() + self.wait() self.play( ShowCreation(line_of_symmetry), Write(line_of_symmetry_words, run_time = 1) ) - self.dither(0.5) + self.wait(0.5) self.remove(line_of_symmetry_words) self.play(*map(Uncreate, line_of_symmetry_words)) for vect in w, v: @@ -582,7 +582,7 @@ class SymmetricVAndW(VectorScene): self.play(Transform(vect_copy, vect.proj)) self.remove(vect_copy) self.add(vect.proj) - self.dither() + self.wait() self.play(*map(FadeOut,[ v.proj, v.proj_line, w.proj, w.proj_line ])) @@ -631,7 +631,7 @@ class SymmetricVAndW(VectorScene): ).update(1)##Hacky self.play(Write(words)) - self.dither() + self.wait() two_v_parts = equation[1:3] equation.remove(*two_v_parts) @@ -643,13 +643,13 @@ class SymmetricVAndW(VectorScene): ) self.remove(self.get_mobjects_from_last_animation()[0]) self.add(projector.proj) - self.dither() + self.wait() if equation not in self.get_mobjects(): self.play( Write(equation), Transform(new_v.label.copy(), VMobject(*two_v_parts)) ) - self.dither() + self.wait() v_parts = [v] if full_v: v_parts += [v.proj, v.proj_line] @@ -658,7 +658,7 @@ class SymmetricVAndW(VectorScene): rate_func = there_and_back, run_time = 2 ) - self.dither() + self.wait() self.play(*map(FadeOut, [ projector.proj, projector.proj_line ])) @@ -666,7 +666,7 @@ class SymmetricVAndW(VectorScene): class LurkingQuestion(TeacherStudentsScene): def construct(self): # self.teacher_says("That's the standard intro") - # self.dither() + # self.wait() # self.student_says( # """ # Wait, why are the @@ -723,7 +723,7 @@ class Introduce2Dto1DLinearTransformations(TwoDToOneDScene): *[Animation(v) for v in self.i_hat, self.j_hat] ) self.play(*map(Write, [numbers, number_line_words])) - self.dither() + self.wait() class Symbolic2To1DTransform(Scene): def construct(self): @@ -773,9 +773,9 @@ class Symbolic2To1DTransform(Scene): GrowFromCenter(output_brace), Write(output_words) ) - self.dither() + self.wait() self.play(Write(special_words)) - self.dither() + self.wait() class RecommendChapter3(Scene): def construct(self): @@ -790,7 +790,7 @@ class RecommendChapter3(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class OkayToIgnoreFormalProperties(Scene): def construct(self): @@ -833,7 +833,7 @@ class OkayToIgnoreFormalProperties(Scene): randy.look, LEFT, morty.look, RIGHT, ) - self.dither() + self.wait() class FormalVsVisual(Scene): def construct(self): @@ -879,7 +879,7 @@ class FormalVsVisual(Scene): self.play(*map(ShowCreation, [line, v_line])) for mob in formal, visual, additivity, scaling, visual_statement: self.play(Write(mob, run_time = 2)) - self.dither() + self.wait() class AdditivityProperty(TwoDToOneDScene): CONFIG = { @@ -907,7 +907,7 @@ class AdditivityProperty(TwoDToOneDScene): symbols.target = symbols.copy().next_to(sum_vect, UP) VGroup(L, r_paren).highlight(BLACK) self.play(Transform(symbols, symbols.target)) - self.dither() + self.wait() def play_sum(self, v, w): sum_vect = Vector(v.get_end()+w.get_end(), color = SUM_COLOR) @@ -971,7 +971,7 @@ class ScalingProperty(TwoDToOneDScene): self.apply_transposed_matrix(self.t_matrix) if not self.scale_before: scaled_vect = self.show_scaling(v) - self.dither() + self.wait() self.write_symbols(scaled_vect) def show_scaling(self, v): @@ -995,7 +995,7 @@ class ScalingProperty(TwoDToOneDScene): tex_mob.highlight_by_tex("c", GREEN) self.play(Write(tex_mob)) - self.dither() + self.wait() class ScalingPropertyPart2(ScalingProperty): CONFIG = { @@ -1045,7 +1045,7 @@ class NonLinearFailsDotTest(TwoDTo1DTransformWithDots): added_anims = [Transform(dots, new_dots)] ) self.play(Write(words)) - self.dither() + self.wait() class AlwaysfollowIHatJHat(TeacherStudentsScene): def construct(self): @@ -1100,9 +1100,9 @@ class ShowMatrix(TwoDToOneDScene): Write(vect.words, run_time = 1), ApplyMethod(vect.shift, 0.5*UP, rate_func = there_and_back) ) - self.dither() + self.wait() self.play(vect.words[1].copy().move_to, entries[i]) - self.dither() + self.wait() class FollowVectorViaCoordinates(TwoDToOneDScene): CONFIG = { @@ -1136,7 +1136,7 @@ class FollowVectorViaCoordinates(TwoDToOneDScene): ) self.add_foreground_mobject(v_label, array) self.add_vector(v, animate = False) - self.dither() + self.wait() to_fade = basis_labels for i, anim_tuple in enumerate(scaling_anim_tuples): self.play(*anim_tuple) @@ -1147,7 +1147,7 @@ class FollowVectorViaCoordinates(TwoDToOneDScene): ApplyMethod(m.shift, self.v_coords[0]*RIGHT) for m in movers ]) - self.dither() + self.wait() self.play( *map(FadeOut, to_fade) + [ vect.restore @@ -1182,22 +1182,22 @@ class FollowVectorViaCoordinates(TwoDToOneDScene): label.next_to(vect, direction) self.play(*map(Write, new_labels)) - self.dither() + self.wait() scaling_anim_tuples = self.get_scaling_anim_tuples( new_labels, array, [UP, DOWN] ) for i, anim_tuple in enumerate(scaling_anim_tuples): self.play(*anim_tuple) movers = VMobject(*self.get_mobjects_from_last_animation()) - self.dither() + self.wait() self.play(movers.shift, self.i_hat.get_end()[0]*RIGHT) - self.dither() + self.wait() if self.concrete: final_label = TexMobject(str(int(v.get_end()[0]))) final_label.move_to(new_labels[-1]) final_label.highlight(new_labels[-1].get_color()) self.play(Transform(new_labels[-1], final_label)) - self.dither() + self.wait() def get_scaling_anim_tuples(self, labels, array, directions): @@ -1258,7 +1258,7 @@ class TwoDOneDMatrixMultiplication(Scene): Write(m.label), run_time = 1 ) - self.dither() + self.wait() self.show_product(matrix, vector) def show_product(self, matrix, vector): @@ -1283,7 +1283,7 @@ class TwoDOneDMatrixMultiplication(Scene): pair, path_arc = -np.pi/2 )) - self.dither() + self.wait() def color_matrix_and_vector(self, matrix, vector): for m in matrix, vector: @@ -1322,24 +1322,24 @@ class AssociationBetweenMatricesAndVectors(Scene): self.play(*map(Write, [matrices_words, vectors_words])) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.play(FadeIn(vectors)) vectors.save_state() - self.dither() + self.wait() self.play(Transform( vectors, matrices, path_arc = np.pi/2, submobject_mode = "lagged_start", run_time = 2, )) - self.dither() + self.wait() self.play( vectors.restore, path_arc = -np.pi/2, submobject_mode = "lagged_start", run_time = 2 ) - self.dither() + self.wait() class WhatAboutTheGeometricView(TeacherStudentsScene): def construct(self): @@ -1410,10 +1410,10 @@ class SomeKindOfConnection(Scene): Animation(plane), run_time = 1, ) - self.dither() + self.wait() self.play(ShowCreation(vect)) self.play(Transform(matrix.copy(), v_coords)) - self.dither() + self.wait() class AnExampleWillClarify(TeacherStudentsScene): def construct(self): @@ -1427,7 +1427,7 @@ class ImagineYouDontKnowThis(Scene): words.highlight(RED) words.scale(1.5) self.play(Write(words)) - self.dither() + self.wait() class ProjectOntoUnitVectorNumberline(VectorScene): CONFIG = { @@ -1462,12 +1462,12 @@ class ProjectOntoUnitVectorNumberline(VectorScene): Write(numbers), run_time = 3 ) - self.dither() + self.wait() self.play(ShowCreation(u_hat)) self.play(FadeIn(u_brace)) self.play(FadeOut(u_brace)) self.play(Write(u_hat.label)) - self.dither() + self.wait() else: self.add(number_line, numbers, u_hat) @@ -1484,7 +1484,7 @@ class ProjectOntoUnitVectorNumberline(VectorScene): Transform(mob, mob.target) for mob in self.get_mobjects() ]) - self.dither() + self.wait() self.number_line, self.numbers, self.u_hat = number_line, numbers, u_hat @@ -1494,13 +1494,13 @@ class ProjectOntoUnitVectorNumberline(VectorScene): proj_dots = self.get_proj_dots(dots) proj_lines = self.get_proj_lines(dots, proj_dots) - self.dither() + self.wait() self.play(FadeIn(vectors, submobject_mode = "lagged_start")) - self.dither() + self.wait() self.play(Transform(vectors, dots)) - self.dither() + self.wait() self.play(ShowCreation(proj_lines)) - self.dither() + self.wait() self.play( self.number_line.set_stroke, None, 2, Transform(vectors, proj_dots), @@ -1509,7 +1509,7 @@ class ProjectOntoUnitVectorNumberline(VectorScene): submobject_mode = "lagged_start", run_time = 2 ) - self.dither() + self.wait() def get_vectors(self, num_vectors = 10, randomize = True): @@ -1570,9 +1570,9 @@ class ProjectionFunctionSymbol(Scene): self.add(VGroup(*equation[:3])) self.play(Write(VGroup(*equation[3:]))) - self.dither() + self.wait() self.play(Write(words), ShowCreation(arrow)) - self.dither() + self.wait() class ProjectLineOfDots(ProjectOntoUnitVectorNumberline): CONFIG = { @@ -1607,19 +1607,19 @@ class ProjectSingleVectorOnUHat(ProjectOntoUnitVectorNumberline): ShowCreation(v), Write(v.label), ) - self.dither() + self.wait() self.play( ShowCreation(v.proj_line), Transform(v.copy(), v.proj) ) - self.dither() + self.wait() self.play( FadeOut(v), FadeOut(v.proj_line), FadeOut(v.label), Write(dot_product) ) - self.dither() + self.wait() class AskAboutProjectionMatrix(Scene): def construct(self): @@ -1640,13 +1640,13 @@ class AskAboutProjectionMatrix(Scene): Write(words), Write(matrix) ) - self.dither() + self.wait() for b_words in basis_words: self.play( Write(b_words), ShowCreation(b_words.arrow) ) - self.dither() + self.wait() class ProjectBasisVectors(ProjectOntoUnitVectorNumberline): CONFIG = { @@ -1712,7 +1712,7 @@ class ProjectBasisVectors(ProjectOntoUnitVectorNumberline): for vect, proj_vect, proj_line, proj_dot in quads: self.play(Transform(vect.copy(), proj_vect)) to_remove += self.get_mobjects_from_last_animation() - self.dither() + self.wait() self.play(*map(FadeOut, to_remove)) # self.show_u_coords(u_label) @@ -1737,7 +1737,7 @@ class ProjectBasisVectors(ProjectOntoUnitVectorNumberline): # eq.next_to(u_label, RIGHT) # coords.next_to(eq, RIGHT) # self.play(*map(FadeIn, [eq, coords])) - # self.dither() + # self.wait() # self.u_coords = coords def show_symmetry(self, vect, coord, coord_landing_spot): @@ -1772,17 +1772,17 @@ class ProjectBasisVectors(ProjectOntoUnitVectorNumberline): self.play(Transform(v.copy(), v.proj)) self.remove(*self.get_mobjects_from_last_animation()) self.add(v.proj) - self.dither() + self.wait() for v in vect, self.u_hat: self.play( ShowCreation(v.tick), Write(v.q_mark) ) - self.dither() + self.wait() for v in self.u_hat, vect: coord_copy = coord.copy().move_to(v.q_mark) self.play(Transform(v.q_mark, coord_copy)) - self.dither() + self.wait() final_coord = coord_copy.copy() self.play(final_coord.move_to, coord_landing_spot) @@ -1816,13 +1816,13 @@ class ShowSingleProjection(ProjectBasisVectors): self.play(ShowCreation(vector)) self.play(Write(coords)) - self.dither() + self.wait() self.play(ShowCreation(proj_line)) self.play( Transform(vector.copy(), proj), Animation(self.u_hat) ) - self.dither() + self.wait() class GeneralTwoDOneDMatrixMultiplication(TwoDOneDMatrixMultiplication): CONFIG = { @@ -1891,7 +1891,7 @@ class UHatIsTransformInDisguise(Scene): words.scale(2) self.play(Write(words)) - self.dither() + self.wait() class AskAboutNonUnitVectors(TeacherStudentsScene): def construct(self): @@ -1931,7 +1931,7 @@ class ScaleUpUHat(ProjectOntoUnitVectorNumberline) : Transform(self.u_hat, new_u), Transform(self.u_hat.coords, new_u.coords) ) - self.dither() + self.wait() def show_matrix(self): matrix = Matrix([list(self.u_hat.coords.get_entries().copy())]) @@ -1954,7 +1954,7 @@ class ScaleUpUHat(ProjectOntoUnitVectorNumberline) : GrowFromCenter(brace), Write(words, run_time = 2) ) - self.dither() + self.wait() self.matrix_words = words def transform_basis_vectors(self): @@ -1981,12 +1981,12 @@ class ScaleUpUHat(ProjectOntoUnitVectorNumberline) : self.play(ShowCreation(b.proj_line)) self.play(Transform(mover, b.proj)) self.play(Write(b.proj.label)) - self.dither() + self.wait() self.play( Transform(mover, b.scaled_proj), Transform(b.proj.label, b.scaled_proj.label) ) - self.dither() + self.wait() self.play(*map(FadeOut, [ mob for mob in self.get_mobjects() @@ -2017,12 +2017,12 @@ class ScaleUpUHat(ProjectOntoUnitVectorNumberline) : Transform(mover, proj), project.highlight, YELLOW ) - self.dither() + self.wait() self.play( mover.scale, self.scalar, then_scale.highlight, YELLOW ) - self.dither() + self.wait() class NoticeWhatHappenedHere(TeacherStudentsScene): def construct(self): @@ -2113,11 +2113,11 @@ class TwoDOneDTransformationSeparateSpace(Scene): Animation(start_words), run_time = 1, ) - self.dither() + self.wait() self.play(Transform(start_words.copy(), end_words)) self.play(ShowCreation(vect)) self.play(Transform(matrix.copy(), v_coords)) - self.dither() + self.wait() class IsntThisBeautiful(TeacherStudentsScene): def construct(self): @@ -2145,7 +2145,7 @@ class RememberGraphDuality(Scene): """) words.to_edge(UP) self.play(Write(words, lag_factor = 4)) - self.dither() + self.wait() class LooseDualityDescription(Scene): def construct(self): @@ -2159,7 +2159,7 @@ class LooseDualityDescription(Scene): self.add(duality) self.play(Write(arrow)) self.play(Write(words)) - self.dither() + self.wait() class DualOfAVector(ScaleUpUHat): pass #Exact copy @@ -2200,7 +2200,7 @@ class TranslateToTheWorldOfTransformations(TwoDOneDMatrixMultiplication): word.highlight(BLUE) self.play(Write(dot_product)) - self.dither() + self.wait() self.play( dot.set_fill, BLACK, 0, Transform(v1, matrix), @@ -2209,9 +2209,9 @@ class TranslateToTheWorldOfTransformations(TwoDOneDMatrixMultiplication): GrowFromCenter(brace), Write(word) ) - self.dither() + self.wait() self.show_product(v1, v2) - self.dither() + self.wait() class NumericalAssociationSilliness(GeneralTwoDOneDMatrixMultiplication): pass #copy @@ -2282,7 +2282,7 @@ class WhatTheVectorWantsToBe(Scene): self.add(plane, v_line, number_line, numbers) self.play(ShowCreation(vect)) self.play(Write(v_coords)) - self.dither() + self.wait() self.play( Transform(v_coords.copy(), matrix), Write(words) @@ -2297,7 +2297,7 @@ class WhatTheVectorWantsToBe(Scene): v_coords ]) ) - self.dither() + self.wait() class NextVideo(Scene): def construct(self): @@ -2314,7 +2314,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() diff --git a/old_projects/eola/chapter8.py b/old_projects/eola/chapter8.py index 45ddcea4..4d90daec 100644 --- a/old_projects/eola/chapter8.py +++ b/old_projects/eola/chapter8.py @@ -47,9 +47,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(FadeIn(words)) - self.dither(1) + self.wait(1) self.play(Write(author, run_time = 3)) - self.dither() + self.wait() class LastVideo(Scene): def construct(self): @@ -63,7 +63,7 @@ class LastVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class DoTheSameForCross(TeacherStudentsScene): def construct(self): @@ -98,7 +98,7 @@ class ListSteps(Scene): self.play(ShowCreation(h_line)) for step in steps: self.play(Write(step)) - self.dither() + self.wait() for step in steps: target = step.copy() target.scale_in_place(1.1) @@ -120,7 +120,7 @@ class ListSteps(Scene): randy.look, LEFT ) self.play(randy.change_mode, "erm") - self.dither(2) + self.wait(2) self.play(randy.change_mode, "pondering") self.play(Blink(randy)) @@ -159,18 +159,18 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene): ShowCreation(self.square), *map(Animation, [self.v, self.w]) ) - self.dither() + self.wait() self.play(FadeOut(self.square)) v_copy = self.v.copy() w_copy = self.w.copy() self.play(v_copy.shift, self.w.get_end()) self.play(w_copy.shift, self.v.get_end()) - self.dither() + self.wait() self.play( FadeIn(self.square), *map(Animation, [self.v, self.w, v_copy, w_copy]) ) - self.dither() + self.wait() self.play(*map(FadeOut, [v_copy, w_copy])) def write_area_words(self): @@ -206,16 +206,16 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene): for vect in self.v, self.w ] ) - self.dither() + self.wait() self.play(ApplyFunction( lambda m : m.scale_in_place(1.2).highlight(RED), times, rate_func = there_and_back )) - self.dither() + self.wait() self.play(Write(words), Write(equals)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.play(FadeOut(arrow)) self.area_words = words @@ -264,7 +264,7 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene): arc = self.get_arc(self.v, self.w, radius = 1.5) arc.highlight(GREEN) self.play(ShowCreation(arc)) - self.dither() + self.wait() self.play(Write(positive), ShowCreation(positive.arrow)) self.remove(arc) self.play( @@ -281,7 +281,7 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene): Write(minus_sign), MoveToTarget(self.area_words) ) - self.dither() + self.wait() self.play(*map(FadeOut, [negative, negative.arrow, arc])) def swap_v_and_w(self): @@ -295,7 +295,7 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene): FadeOut(self.area_words), Transform(self.cross.copy(), new_cross, path_arc = np.pi/2) ) - self.dither() + self.wait() curr_matrix = np.array([self.v.get_end()[:2], self.w.get_end()[:2]]) new_matrix = np.array(list(reversed(curr_matrix))) @@ -310,7 +310,7 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene): rate_func = there_and_back, run_time = 3 ) - self.dither() + self.wait() def get_arc(self, v, w, radius = 2): @@ -344,7 +344,7 @@ class CrossBasisVectors(LinearTransformationScene): i_label.target.scale(1.5) j_label.target.scale(1.2) - self.dither() + self.wait() times = TexMobject("\\times") cross = VGroup(i_label.target, times, j_label.target) @@ -362,11 +362,11 @@ class CrossBasisVectors(LinearTransformationScene): Write(times), ) self.play(Write(eq)) - self.dither() + self.wait() arc = self.get_arc(self.i_hat, self.j_hat, radius = 1) # arc.highlight(GREEN) self.play(ShowCreation(arc)) - self.dither() + self.wait() def get_arc(self, v, w, radius = 2): @@ -403,15 +403,15 @@ class VisualExample(SimpleDefine2dCrossProduct): minus.move_to(self.area_words, aligned_edge = LEFT) self.play(ShowCreation(val)) - self.dither() + self.wait() self.play(ShowCreation(arc)) - self.dither() + self.wait() self.play(FadeOut(self.area_words)) self.play( Transform(arc, minus), val.next_to, minus, RIGHT ) - self.dither() + self.wait() def show_coords(self): for vect, edge in (self.v, DOWN), (self.w, UP): @@ -511,7 +511,7 @@ class ContrastDotAndCross(Scene): ], run_time = 2 ) - self.dither() + self.wait() def add_cross_product(self): colors = [X_COLOR, Y_COLOR, Z_COLOR] @@ -586,7 +586,7 @@ class ContrastDotAndCross(Scene): *movements, run_time = 2 ) - self.dither() + self.wait() self.cross_result = result self.only_3d_text = brace_text @@ -627,7 +627,7 @@ class ContrastDotAndCross(Scene): for entry in entries ] ) - self.dither() + self.wait() self.two_d_result = VGroup(*result[1:]) def emphasize_output_type(self): @@ -640,12 +640,12 @@ class ContrastDotAndCross(Scene): GrowFromCenter(two_d_brace), Write(number) ) - self.dither() + self.wait() self.play( GrowFromCenter(three_d_brace), Write(vector) ) - self.dither() + self.wait() class PrereqDeterminant(Scene): def construct(self): @@ -660,7 +660,7 @@ class PrereqDeterminant(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class Define2dCrossProduct(LinearTransformationScene): CONFIG = { @@ -734,7 +734,7 @@ class Define2dCrossProduct(LinearTransformationScene): Transform(w.label.copy(), w.label.target), Write(times), ) - self.dither() + self.wait() self.play( ShowCreation(matrix_background), Write(matrix.get_brackets()), @@ -743,17 +743,17 @@ class Define2dCrossProduct(LinearTransformationScene): self.play(Transform(v.coords.copy(), v.coords.target)) self.play(Transform(w.coords.copy(), w.coords.target)) matrix.add_to_back(matrix_background) - self.dither() + self.wait() self.play( Write(equals), Write(det_text), Animation(matrix), ) - self.dither() + self.wait() self.play(FadeIn(disclaimer)) - self.dither() + self.wait() self.play(FadeOut(disclaimer)) - self.dither() + self.wait() cross_product.add_to_back(cross_background) cross_product.add(equals) @@ -782,7 +782,7 @@ class Define2dCrossProduct(LinearTransformationScene): ShowCreation(j_hat), Write(basis_labels) ) - self.dither() + self.wait() side_brace = Brace(matrix, RIGHT) transform_words = side_brace.get_text("Linear transformation") @@ -812,13 +812,13 @@ class Define2dCrossProduct(LinearTransformationScene): ShowCreation(i_words.arrow), col1.highlight, X_COLOR ) - self.dither() + self.wait() self.play( Transform(i_words, j_words), Transform(i_words.arrow, j_words.arrow), col2.highlight, Y_COLOR ) - self.dither() + self.wait() self.play(*map(FadeOut, [i_words, i_words.arrow, basis_labels])) self.add_vector(i_hat, animate = False) @@ -826,7 +826,7 @@ class Define2dCrossProduct(LinearTransformationScene): self.play(*map(FadeOut, [side_brace, transform_words])) self.add_foreground_mobject(matrix) self.apply_transposed_matrix([self.v_coords, self.w_coords]) - self.dither() + self.wait() self.play( FadeOut(self.plane), *map(Animation, [ @@ -845,7 +845,7 @@ class Define2dCrossProduct(LinearTransformationScene): FadeIn(self.w.coord_array), matrix.highlight_columns, V_COLOR, W_COLOR ) - self.dither() + self.wait() self.i_hat, self.j_hat = i_hat, j_hat self.matrix = matrix @@ -870,11 +870,11 @@ class Define2dCrossProduct(LinearTransformationScene): ) self.add_unit_square(animate = True, opacity = 0.2) self.square.save_state() - self.dither() + self.wait() self.apply_transposed_matrix( [self.v_coords, self.w_coords] ) - self.dither() + self.wait() self.play( FadeOut(self.plane), Animation(self.matrix), @@ -895,7 +895,7 @@ class Define2dCrossProduct(LinearTransformationScene): Write(area_words), ShowCreation(area_arrow) ) - self.dither() + self.wait() pm = VGroup(*map(TexMobject, ["+", "-"])) pm.gradient_highlight(GREEN, RED) @@ -906,7 +906,7 @@ class Define2dCrossProduct(LinearTransformationScene): Transform(self.square.get_point_mobject(), pm), path_arc = -np.pi/2 ) - self.dither() + self.wait() self.play(*map(FadeOut, [ area_arrow, self.v.coord_array, self.w.coord_array ])) @@ -935,7 +935,7 @@ class Define2dCrossProduct(LinearTransformationScene): movers.save_state() self.remove(self.square) self.play(Transform(movers, movers.target)) - self.dither() + self.wait() v_tex, w_tex = ["\\vec{\\textbf{%s}}"%s for s in "v", "w"] positive_words, negative_words = words_list = [ @@ -955,7 +955,7 @@ class Define2dCrossProduct(LinearTransformationScene): Write(positive_words), ShowCreation(arc) ) - self.dither() + self.wait() self.remove(arc) self.play(movers.restore) arc = self.get_arc(self.v, self.w) @@ -964,7 +964,7 @@ class Define2dCrossProduct(LinearTransformationScene): Transform(positive_words, negative_words), ShowCreation(arc) ) - self.dither() + self.wait() anticommute = TexMobject( v_tex, "\\times", w_tex, "=-", w_tex, "\\times", v_tex @@ -992,7 +992,7 @@ class Define2dCrossProduct(LinearTransformationScene): rate_func = there_and_back, run_time = 2, ) - self.dither() + self.wait() def get_arc(self, v, w, radius = 2): v_angle, w_angle = v.get_angle(), w.get_angle() @@ -1056,7 +1056,7 @@ class TwoDCrossProductExample(Define2dCrossProduct): Write(vect.coords), Write(vect.label) ) - self.dither() + self.wait() self.play( Transform(v.coords.background_rectangle, matrix_background), Transform(w.coords.background_rectangle, matrix_background), @@ -1104,7 +1104,7 @@ class TwoDCrossProductExample(Define2dCrossProduct): ), run_time = 3 ) - self.dither() + self.wait() self.play(Write(equals_result)) self.add_foreground_mobject(equation_start, equation_end) @@ -1116,7 +1116,7 @@ class TwoDCrossProductExample(Define2dCrossProduct): arc.highlight(RED) self.play(Write(det_sym)) self.play(ShowCreation(arc)) - self.dither() + self.wait() def show_transformation(self, v, w): @@ -1195,7 +1195,7 @@ class BiggerWhenPerpendicular(LinearTransformationScene): *map(Animation, [v, w]) ) self.play(GrowFromCenter(bigger)) - self.dither() + self.wait() self.play( Transform(start_square, end_square), Transform(v, v.target), @@ -1205,7 +1205,7 @@ class BiggerWhenPerpendicular(LinearTransformationScene): Transform(start_words, end_words), Transform(bigger, smaller) ) - self.dither() + self.wait() class ScalingRule(LinearTransformationScene): CONFIG = { @@ -1261,20 +1261,20 @@ class ScalingRule(LinearTransformationScene): ShowCreation(square), *map(Animation, [v, w]) ) - self.dither() + self.wait() self.play( Transform(v, new_v), Transform(v_tex_mob, three_v), ) - self.dither() + self.wait() self.play( Transform(square, new_squares), *map(Animation, [v, w]), path_arc = -np.pi/6 ) - self.dither() + self.wait() self.play(Write(rhs)) - self.dither() + self.wait() class TechnicallyNotTheDotProduct(TeacherStudentsScene): def construct(self): @@ -1302,9 +1302,9 @@ class WriteAreaOfParallelogram(Scene): words.remove(result) self.play(Write(words)) - self.dither() + self.wait() self.play(Write(result, run_time = 1)) - self.dither() + self.wait() class WriteCrossProductProperties(Scene): def construct(self): @@ -1343,11 +1343,11 @@ class WriteCrossProductProperties(Scene): GrowFromCenter(brace), Write(vector, run_time = 1) ) - self.dither() + self.wait() self.play(Write(length_words, run_time = 1)) - self.dither() + self.wait() self.play(Write(perpendicular)) - self.dither() + self.wait() def get_cross_product_right_hand_rule_labels(): v_tex, w_tex = get_vect_tex(*"vw") @@ -1387,7 +1387,7 @@ class LabelingExampleVectors(Scene): def fade_in_out(self, mob): self.play(FadeIn(mob)) - self.dither() + self.wait() self.play(FadeOut(mob)) class ThreeDTwoPossiblePerpendicularVectors(Scene): @@ -1455,7 +1455,7 @@ class ShowCrossProductFormula(Scene): Write(equals), Write(result.get_brackets()) ) - self.dither() + self.wait() movement_sets[2], movement_sets[3] = movement_sets[3], movement_sets[2] for e1, e1_target, e2, e2_target, syms in movement_sets: e1.save_state() @@ -1472,7 +1472,7 @@ class ShowCrossProductFormula(Scene): e2.restore, path_arc = -np.pi/2 ) - self.dither() + self.wait() class ThisGetsWeird(TeacherStudentsScene): def construct(self): @@ -1523,7 +1523,7 @@ class DeterminantTrick(Scene): equation.arrange_submobjects() self.add(*equation[:-2]) - self.dither() + self.wait() self.play(Write(matrix.get_brackets())) for col, vect in (col2, v), (col3, w): col.save_state() @@ -1534,16 +1534,16 @@ class DeterminantTrick(Scene): ) for entry in col1: self.play(Write(entry)) - self.dither() + self.wait() self.play(*map(Write, [equals, det_text])) - self.dither() + self.wait() disclaimer = TextMobject("$^*$ See ``Note on conventions'' in description") disclaimer.scale(0.7) disclaimer.highlight(RED) disclaimer.next_to(equation, DOWN) self.play(FadeIn(disclaimer)) - self.dither() + self.wait() self.play(FadeOut(disclaimer)) circle = Circle() @@ -1560,7 +1560,7 @@ class DeterminantTrick(Scene): ShowCreation(circle) ) self.play(randy.look, RIGHT) - self.dither() + self.wait() self.play(FadeOut(circle)) self.play( @@ -1603,7 +1603,7 @@ class DeterminantTrick(Scene): [mob.scale_in_place, 1.2] for mob in quint ])) - self.dither() + self.wait() self.play(*[ Transform(mob.copy(), mob.t) for mob in quint @@ -1614,9 +1614,9 @@ class DeterminantTrick(Scene): ], run_time = 2 ) - self.dither() + self.wait() paren_sets.append(VGroup(lp, rp)) - self.dither() + self.wait() self.play(randy.change_mode, "pondering") for parens in paren_sets: brace = Brace(parens) @@ -1626,7 +1626,7 @@ class DeterminantTrick(Scene): GrowFromCenter(brace), Write(text, run_time = 2) ) - self.dither() + self.wait() class ThereIsAReason(TeacherStudentsScene): def construct(self): @@ -1666,7 +1666,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class CrossAndDualWords(Scene): def construct(self): @@ -1708,12 +1708,12 @@ class CrossAndDualWords(Scene): self.add(vector_word) self.play(Write(cross)) - self.dither() + self.wait() self.play(FadeIn(transform_word)) self.play(Write(transform)) - self.dither() + self.wait() self.play(Transform(det_text, dot_with_cross)) - self.dither() + self.wait() diff --git a/old_projects/eola/chapter8p2.py b/old_projects/eola/chapter8p2.py index 643c0e7f..77a3489d 100644 --- a/old_projects/eola/chapter8p2.py +++ b/old_projects/eola/chapter8p2.py @@ -44,9 +44,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(FadeIn(words)) - self.dither(4) + self.wait(4) self.play(Write(author, run_time = 3)) - self.dither() + self.wait() class CrossProductSymbols(Scene): def construct(self): @@ -63,7 +63,7 @@ class CrossProductSymbols(Scene): vector_text.highlight(RED) self.add(equation) self.play(*map(Write, [brace, vector_text])) - self.dither() + self.wait() class DeterminantTrickCopy(DeterminantTrick): pass @@ -151,7 +151,7 @@ class BruteForceVerification(Scene): mob.scale_to_fit_width(max_width) last_point = mob self.play(FadeIn(mob)) - self.dither() + self.wait() class ButWeCanDoBetter(TeacherStudentsScene): def construct(self): @@ -195,7 +195,7 @@ class Prerequisites(Scene): Write(chapter7), ShowCreation(right_rect) ) - self.dither() + self.wait() class DualityReview(TeacherStudentsScene): def construct(self): @@ -247,7 +247,7 @@ class DotProductToTransformSymbol(Scene): GrowFromCenter(right_brace), Write(right_words, run_time = 1) ) - self.dither() + self.wait() self.play( Write(equals), Write(dot), @@ -258,7 +258,7 @@ class DotProductToTransformSymbol(Scene): GrowFromCenter(left_brace), Write(left_words, run_time = 1) ) - self.dither() + self.wait() class MathematicalWild(Scene): def construct(self): @@ -291,16 +291,16 @@ class MathematicalWild(Scene): self.play(FadeIn(bubble)) self.play(randy.change_mode, "sassy") self.play(Blink(randy)) - self.dither() + self.wait() self.play(randy.look, UP+LEFT) self.play( ShowCreation(vector), randy.change_mode, "raise_right_hand" ) - self.dither() + self.wait() self.play(Write(dual_words)) self.play(Blink(randy)) - self.dither() + self.wait() class ThreeStepPlan(Scene): def construct(self): @@ -340,7 +340,7 @@ class ThreeStepPlan(Scene): self.play(ShowCreation(h_line)) for step in steps: self.play(Write(step, run_time = 2)) - self.dither() + self.wait() linear_transformation = TextMobject("Linear", "transformation") linear_transformation.next_to(h_line, DOWN, MED_SMALL_BUFF) @@ -360,11 +360,11 @@ class ThreeStepPlan(Scene): ), *map(FadeOut, steps) ) - self.dither() + self.wait() self.play(Write(left_right_arrow)) self.play(Write(det)) self.play(ShowCreation(rect)) - self.dither(0) + self.wait(0) def get_det(self): matrix = Matrix(np.array([ @@ -460,7 +460,7 @@ class DefineDualTransform(Scene): run_time = 2, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) self.play(*[ Transform(mob.copy(), mob.target) for mob in tex_mobs @@ -478,7 +478,7 @@ class DefineDualTransform(Scene): v_entries = self.get_mobjects_from_last_animation()[3:6] w_entries = self.get_mobjects_from_last_animation()[6:9] self.play(Write(det_text)) - self.dither(2) + self.wait(2) self.det_text = det_text self.definitions = definitions @@ -494,13 +494,13 @@ class DefineDualTransform(Scene): brace = Brace(self.det_text, DOWN) number_text = brace.get_text("Number") self.play(Transform(self.title, self.title.not_real)) - self.dither() + self.wait() self.play(FadeOut(self.definitions)) self.play( GrowFromCenter(brace), Write(number_text) ) - self.dither() + self.wait() x, y, z = variables = map(TexMobject, "xyz") for var, entry in zip(variables, self.u_entries): @@ -550,9 +550,9 @@ class DefineDualTransform(Scene): Write(VGroup(vect_brace, vect_brace.tex)) for vect_brace in v_brace, w_brace ]) - self.dither() + self.wait() self.play(Write(func_tex)) - self.dither() + self.wait() self.func_tex = func_tex self.variables_text = VGroup(brace, number_text) @@ -589,7 +589,7 @@ class DefineDualTransform(Scene): ) self.remove(everything) self.add(*everything) - self.dither() + self.wait() func, func_input = self.func_tex func_input.target = func_input.copy() @@ -610,18 +610,18 @@ class DefineDualTransform(Scene): MoveToTarget(func_input), FadeOut(self.variables_text), ) - self.dither() + self.wait() self.play( Write(matrix_words), ShowCreation(matrix_arrow) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [matrix_words, matrix_arrow])) self.play( Transform(func, dual_vector), Write(dual_dot[1]) ) - self.dither() + self.wait() p_coords = VGroup(*map(TexMobject, [ "p_%d"%d for d in range(1, 4) @@ -646,9 +646,9 @@ class DefineDualTransform(Scene): )) self.remove(func) self.add(p_array) - self.dither() + self.wait() self.play(FadeOut(title)) - self.dither() + self.wait() self.p_array = p_array self.input_array = func_input @@ -691,7 +691,7 @@ class DefineDualTransform(Scene): mobs = self.get_mobjects_from_last_animation() new_ps.add(mobs[0]) to_fade.add(*mobs[1:]) - self.dither() + self.wait() x, y, z = self.u_entries v1, v2, v3 = self.v_entries @@ -727,7 +727,7 @@ class DefineDualTransform(Scene): ApplyMethod(mob.highlight, YELLOW) for mob in quint ]) - self.dither(0.5) + self.wait(0.5) self.play(*[ MoveToTarget(mob) for mob in quint @@ -735,7 +735,7 @@ class DefineDualTransform(Scene): Write(mob.sym) for mob in quint ]) - self.dither() + self.wait() self.play( ApplyFunction( lambda m : m.arrange_submobjects( @@ -750,7 +750,7 @@ class DefineDualTransform(Scene): for p in new_ps ]) equals = self.get_mobjects_from_last_animation() - self.dither(2) + self.wait(2) everything = everything.copy() self.play( @@ -779,7 +779,7 @@ class DefineDualTransform(Scene): MoveToTarget(everything), Write(question) ) - self.dither() + self.wait() class WhyAreWeDoingThis(TeacherStudentsScene): def construct(self): @@ -847,12 +847,12 @@ class DotProductWords(Scene): self.add(dot_product) self.play(Write(equals)) self.play(Write(words[0])) - self.dither() + self.wait() self.play( Write(times), Write(words[1]) ) - self.dither() + self.wait() class ThreeDProjectToPerpendicular(Scene): pass # @@ -879,12 +879,12 @@ class GeometricVolumeWords(Scene): words.to_edge(DOWN, buff = SMALL_BUFF) for word in words: self.play(Write(word)) - self.dither() + self.wait() class WriteXYZ(Scene): def construct(self): self.play(Write(Matrix(list("xyz")))) - self.dither() + self.wait() class ThreeDDotProductWithCross(Scene): pass @@ -901,7 +901,7 @@ class CrossVectorEmphasisWords(Scene): word.highlight_by_tex(w_tex, W_COLOR) word.highlight_by_tex("parallelogram", BLUE) self.play(Write(word)) - self.dither() + self.wait() self.play(FadeOut(word)) class NextVideo(Scene): @@ -916,7 +916,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class ChangeOfBasisPreview(LinearTransformationScene): CONFIG = { @@ -982,13 +982,13 @@ class ChangeOfBasisPreview(LinearTransformationScene): self.play(self.j_hat.shift, self.i_hat.get_end()) sum_vect = Vector(self.j_hat.get_end(), color = self.sum_color) self.play(ShowCreation(sum_vect)) - self.dither(2) + self.wait(2) self.play( FadeOut(sum_vect), self.i_hat.restore, self.j_hat.restore, ) - self.dither() + self.wait() diff --git a/old_projects/eola/chapter9.py b/old_projects/eola/chapter9.py index 77a7741d..c75e21e9 100644 --- a/old_projects/eola/chapter9.py +++ b/old_projects/eola/chapter9.py @@ -73,9 +73,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(FadeIn(words)) - self.dither(2) + self.wait(2) self.play(Write(author, run_time = 3)) - self.dither(2) + self.wait(2) class LinearCombinationScene(LinearTransformationScene): CONFIG = { @@ -134,7 +134,7 @@ class LinearCombinationScene(LinearTransformationScene): self.play(*map(MoveToTarget, [ coord, basis, basis.label ])) - self.dither() + self.wait() self.play(*[ ApplyMethod(m.shift, basis_vectors[0].get_end()) for m in self.get_mobjects_from_last_animation() @@ -145,7 +145,7 @@ class LinearCombinationScene(LinearTransformationScene): color = sum_vect_color ) self.play(ShowCreation(sum_vect)) - self.dither(2) + self.wait(2) if revert_to_original: self.play(*it.chain( [basis.restore for basis in basis_vectors], @@ -182,8 +182,8 @@ class RemindOfCoordinates(LinearCombinationScene): coord.next_to, line.get_center(), direction, ShowCreation(line), ) - self.dither() - self.dither() + self.wait() + self.wait() self.play(*map(FadeOut, [x_coord, y_coord, x_line, y_line])) @@ -212,16 +212,16 @@ class RemindOfCoordinates(LinearCombinationScene): Write(words) ) self.play(*map(FadeIn, [self.i_hat, self.j_hat])) - self.dither() + self.wait() self.play(Transform(self.i_hat, scaled_i)) self.play(Transform(self.j_hat, scaled_j)) - self.dither() + self.wait() self.play( FadeOut(words), FadeIn(everything), *[mob.restore for mob in to_save] ) - self.dither() + self.wait() def scale_basis_vectors(self, x_coord, y_coord): self.play(*map(Write, [self.i_hat.label, self.j_hat.label])) @@ -257,7 +257,7 @@ class RemindOfCoordinates(LinearCombinationScene): words.add_to_back(BackgroundRectangle(words)) self.play(Write(title)) - self.dither() + self.wait() self.play( Write(ass1), ApplyFunction( @@ -266,7 +266,7 @@ class RemindOfCoordinates(LinearCombinationScene): rate_func = wiggle ) ) - self.dither() + self.wait() self.play( Write(ass2), ApplyFunction( @@ -275,9 +275,9 @@ class RemindOfCoordinates(LinearCombinationScene): rate_func = wiggle ) ) - self.dither() + self.wait() self.play(Write(ass3)) - self.dither(2) + self.wait(2) keepers = VGroup(*[ self.i_hat, self.j_hat, self.i_hat.label, self.j_hat.label @@ -287,7 +287,7 @@ class RemindOfCoordinates(LinearCombinationScene): Animation(keepers.copy()), Animation(group) ) - self.dither() + self.wait() class NameCoordinateSystem(Scene): def construct(self): @@ -317,12 +317,12 @@ class NameCoordinateSystem(Scene): self.play(Write(coords)) self.play(Write(arrow), ShowCreation(vector)) - self.dither() + self.wait() self.play(Write(coordinate_system)) - self.dither(2) + self.wait(2) self.play(Write(basis_group)) self.play(Write(basis_words)) - self.dither() + self.wait() class WhatAboutOtherBasis(TeacherStudentsScene): def construct(self): @@ -404,7 +404,7 @@ class IntroduceJennifer(JenniferScene): jenny.look, UP+RIGHT, FadeOut(name) ) - self.dither() + self.wait() def add_basis_vectors(self): words = TextMobject("Alternate basis vectors") @@ -415,7 +415,7 @@ class IntroduceJennifer(JenniferScene): ShowCreation(vect), Write(vect.label) ) - self.dither() + self.wait() self.play(FadeOut(words)) def show_v_from_both_perspectives(self): @@ -441,7 +441,7 @@ class IntroduceJennifer(JenniferScene): entry.add_background_rectangle() self.play(ShowCreation(v)) - self.dither() + self.wait() self.play(*it.chain( map(FadeIn, [ self.plane, self.i_hat, self.j_hat, @@ -523,7 +523,7 @@ class IntroduceJennifer(JenniferScene): self.play(*map(MoveToTarget, [ coord, basis, basis.label ])) - self.dither() + self.wait() self.play(*[ ApplyMethod(m.shift, basis_vectors[0].get_end()) for m in self.get_mobjects_from_last_animation() @@ -534,7 +534,7 @@ class IntroduceJennifer(JenniferScene): color = sum_vect_color ) self.play(ShowCreation(sum_vect)) - self.dither(2) + self.wait(2) b1, b2 = basis_vectors @@ -570,7 +570,7 @@ class IntroduceJennifer(JenniferScene): ]) ) self.play(Blink(self.you)) - self.dither() + self.wait() self.play(*it.chain( map(FadeOut, [ @@ -607,7 +607,7 @@ class IntroduceJennifer(JenniferScene): b1_coords.mover.highlight, X_COLOR ) self.play(Blink(you)) - self.dither() + self.wait() self.play(Transform(b1_coords, b2_coords)) self.play( b2_coords.mover.next_to, self.b2.get_end(), LEFT, @@ -675,7 +675,7 @@ class SpeakingDifferentLanguages(JenniferScene): Write(pi.coords) ) self.play(Blink(pi)) - self.dither() + self.wait() class ShowGrid(LinearTransformationScene): CONFIG = { @@ -683,14 +683,14 @@ class ShowGrid(LinearTransformationScene): } def construct(self): self.remove(self.i_hat, self.j_hat) - self.dither() + self.wait() self.plane.prepare_for_nonlinear_transform() self.plane.save_state() self.play(Homotopy(plane_wave_homotopy, self.plane)) self.play(self.plane.restore) for vect in self.i_hat, self.j_hat: self.play(ShowCreation(vect)) - self.dither() + self.wait() class GridIsAConstruct(TeacherStudentsScene): def construct(self): @@ -714,7 +714,7 @@ class SpaceHasNoGrid(LinearTransformationScene): FadeOut(self.plane), *map(Animation, [self.i_hat, self.j_hat]) ) - self.dither() + self.wait() class JennysGrid(JenniferScene): def construct(self): @@ -738,7 +738,7 @@ class JennysGrid(JenniferScene): ShowCreation(vect), Write(vect.label) ) - self.dither() + self.wait() self.play( ShowCreation( self.jenny_plane, @@ -785,18 +785,18 @@ class ShowOriginOfGrid(JenniferScene): ShowCreation(arrow) ) self.play(ShowCreation(origin_dot)) - self.dither() + self.wait() self.play( Transform(self.jenny_plane, self.plane), *map(Animation, [origin_word, origin_dot, arrow]) ) - self.dither() + self.wait() self.play(Write(coords)) - self.dither() + self.wait() self.play(FadeIn(vector)) - self.dither() + self.wait() self.play(Transform(vector, Mobject.scale(vector.copy(), 0))) - self.dither() + self.wait() self.play( self.jenny_plane.restore, *map(Animation, [origin_word, origin_dot, arrow, coords]) @@ -806,7 +806,7 @@ class ShowOriginOfGrid(JenniferScene): ShowCreation(vect), Write(vect.label) ) - self.dither() + self.wait() class AskAboutTranslation(TeacherStudentsScene): def construct(self): @@ -861,7 +861,7 @@ class TranslateFromJenny(JenniferScene): revert_to_original = False, show_sum_vect = True, ) - self.dither() + self.wait() everything = self.get_mobjects() for submob in self.jenny_plane.submobject_family(): everything.remove(submob) @@ -874,7 +874,7 @@ class TranslateFromJenny(JenniferScene): ShowCreation(self.you.bubble), Write(self.you.coords) ) - self.dither() + self.wait() def establish_coordinates(self): b1, b2 = self.basis_vectors_copy[:2] @@ -919,7 +919,7 @@ class TranslateFromJenny(JenniferScene): ] for mover_set in mover_sets: self.play(*map(MoveToTarget, mover_set)) - self.dither() + self.wait() self.play( MoveToTarget(equals2), Transform(self.b1_coords_mob.copy(), result.target), @@ -928,7 +928,7 @@ class TranslateFromJenny(JenniferScene): self.remove(*self.get_mobjects_from_last_animation()) result = result.target self.add(equals2, result) - self.dither() + self.wait() result_copy = result.copy() self.you.bubble.add_content(result_copy) @@ -937,7 +937,7 @@ class TranslateFromJenny(JenniferScene): Transform(result.copy(), result_copy) ) self.play(Blink(self.you)) - self.dither() + self.wait() matrix = Matrix(np.array([self.b1_coords, self.b2_coords]).T) matrix.highlight_columns(X_COLOR, Y_COLOR) @@ -954,7 +954,7 @@ class TranslateFromJenny(JenniferScene): MoveToTarget(self.jenny.coords), FadeIn(matrix) ) - self.dither() + self.wait() class WatchChapter3(TeacherStudentsScene): def construct(self): @@ -1021,7 +1021,7 @@ class TalkThroughChangeOfBasisMatrix(JenniferScene): Write(basis_coords_pair) ) self.play(Blink(self.you)) - self.dither() + self.wait() self.add_foreground_mobject( self.jenny, self.you, self.you.bubble, @@ -1069,7 +1069,7 @@ class TalkThroughChangeOfBasisMatrix(JenniferScene): self.add_foreground_mobject(b2_coords) basis_coords_pair.target = basis_coords_pair.copy() self.jenny.bubble.add_content(basis_coords_pair.target) - self.dither() + self.wait() self.play( FadeOut(b1_coords), FadeOut(b2_coords), @@ -1168,13 +1168,13 @@ class FeelsBackwards(Scene): ShowCreation(top_arrow), Write(jenny_grid) ) - self.dither() + self.wait() self.play(Write(jenny_language)) self.play( ShowCreation(bottom_arrow), Write(our_language) ) - self.dither() + self.wait() ##Swap things inverse_word = TextMobject("Inverse") @@ -1193,7 +1193,7 @@ class FeelsBackwards(Scene): bottom_arrow.scale_in_place, 0.8, bottom_arrow.shift, 0.8*RIGHT ) - self.dither() + self.wait() class AskAboutOtherWayAround(TeacherStudentsScene): def construct(self): @@ -1237,16 +1237,16 @@ class RecallInverse(JenniferScene): Write(inverse_exponent) ) self.add_foreground_mobject(*self.get_mobjects_from_last_animation()) - self.dither() + self.wait() self.apply_inverse_transpose(numerical_t_matrix) - self.dither() + self.wait() self.play( Write(equals), Transform(matrix.copy(), inv_matrix) ) self.remove(*self.get_mobjects_from_last_animation()) self.add_foreground_mobject(equals, inv_matrix) - self.dither() + self.wait() for mob in self.plane, self.i_hat, self.j_hat: self.add(mob.copy().fade(0.7)) self.apply_transposed_matrix(numerical_t_matrix) @@ -1261,7 +1261,7 @@ class RecallInverse(JenniferScene): ) for mob in inv_matrix.get_mob_matrix()[:,0] ]) - self.dither() + self.wait() inv_matrix.highlight_columns(X_COLOR, Y_COLOR) self.play(*[ ApplyMethod( @@ -1270,7 +1270,7 @@ class RecallInverse(JenniferScene): ) for mob in inv_matrix.get_mob_matrix()[:,1] ]) - self.dither() + self.wait() class WorkOutInverseComputation(Scene): def construct(self): @@ -1317,13 +1317,13 @@ class WorkOutInverseComputation(Scene): GrowFromCenter(our_vector_brace), Write(our_text) ) - self.dither() + self.wait() self.play( FadeIn(matrix), GrowFromCenter(matrix_brace), Write(matrix_text) ) - self.dither() + self.wait() self.play( Write(equals), Write(her_vector) @@ -1332,7 +1332,7 @@ class WorkOutInverseComputation(Scene): GrowFromCenter(her_vector_brace), Write(her_text) ) - self.dither() + self.wait() class SoThatsTranslation(TeacherStudentsScene): def construct(self): @@ -1413,14 +1413,14 @@ class SummarizeTranslationProcess(Scene): Write(our_words), ShowCreation(our_arrow) ) - self.dither(2) + self.wait(2) self.play( VGroup(her_vector, equals).next_to, A_inv, LEFT, her_arrow.rotate_in_place, -np.pi/6, her_arrow.shift, MED_SMALL_BUFF*LEFT, Transform(A, A_inv, path_arc = np.pi) ) - self.dither() + self.wait() class VectorsAreNotTheOnlyOnes(TeacherStudentsScene): def construct(self): @@ -1454,7 +1454,7 @@ class Prerequisites(Scene): Write(words), ShowCreation(rect) ) - self.dither() + self.wait() class RotationExample(LinearTransformationScene): CONFIG = { @@ -1475,16 +1475,16 @@ class RotationExample(LinearTransformationScene): self.play(Write(words)) self.add_foreground_mobject(words) - self.dither() + self.wait() self.apply_transposed_matrix(self.t_matrix) - self.dither() + self.wait() self.play( self.i_hat.rotate, np.pi/12, self.j_hat.rotate, -np.pi/12, rate_func = wiggle, run_time = 2 ) - self.dither() + self.wait() i_coords, j_coords = coord_arrays = map(Matrix, self.t_matrix) for coords, vect in zip(coord_arrays, [self.i_hat, self.j_hat]): @@ -1495,7 +1495,7 @@ class RotationExample(LinearTransformationScene): direction = UP if vect is self.j_hat else RIGHT coords.next_to(vect.get_end(), direction, buff = MED_SMALL_BUFF) self.play(Write(coords)) - self.dither() + self.wait() self.play( Transform(i_coords.rect, matrix.rect), @@ -1513,7 +1513,7 @@ class RotationExample(LinearTransformationScene): VGroup(*matrix.get_mob_matrix()[:, 1]) ), ) - self.dither() + self.wait() self.add_words(matrix) def add_words(self, matrix): @@ -1541,9 +1541,9 @@ class RotationExample(LinearTransformationScene): ) self.play(Write(follow_basis)) - self.dither() + self.wait() self.play(Write(record)) - self.dither() + self.wait() class JennyWatchesRotation(JenniferScene): def construct(self): @@ -1574,7 +1574,7 @@ class JennyWatchesRotation(JenniferScene): )) self.play(jenny.change_mode, "pondering") self.play(Blink(jenny)) - self.dither() + self.wait() class AksAboutTranslatingColumns(TeacherStudentsScene): def construct(self): @@ -1678,26 +1678,26 @@ class HowToTranslateAMatrix(Scene): Transform(brace, array.brace), Transform(bottom_words, array.brace.text) ) - self.dither() + self.wait() def echo_introduce(array): self.play( Transform(top_brace, array.top_brace), Transform(top_words, array.top_brace.text) ) - self.dither() + self.wait() self.play(Write(her_vector)) self.play( GrowFromCenter(brace), Write(bottom_words) ) - self.dither() + self.wait() introduce(cob_matrix) self.play( GrowFromCenter(top_brace), Write(top_words) ) - self.dither() + self.wait() introduce(transform) echo_introduce(transform) introduce(inv_cob), @@ -1712,12 +1712,12 @@ class HowToTranslateAMatrix(Scene): FadeOut(bottom_words), FadeOut(brace), ) - self.dither() + self.wait() self.play( Transform(top_brace, final_top_brace), Transform(top_brace.text, final_top_brace.text), ) - self.dither() + self.wait() equals = TexMobject("=") equals.replace(v) @@ -1726,7 +1726,7 @@ class HowToTranslateAMatrix(Scene): Transform(her_vector, equals), Write(result) ) - self.dither(2) + self.wait(2) everything = VGroup(*self.get_mobjects()) self.play( @@ -1734,7 +1734,7 @@ class HowToTranslateAMatrix(Scene): result.to_corner, UP+LEFT ) self.add(result) - self.dither() + self.wait() def add_title(self): @@ -1744,7 +1744,7 @@ class HowToTranslateAMatrix(Scene): h_line.next_to(title, DOWN) self.add(title) self.play(ShowCreation(h_line)) - self.dither() + self.wait() class JennyWatchesRotationWithMatrixAndVector(JenniferScene): def construct(self): @@ -1787,7 +1787,7 @@ class JennyWatchesRotationWithMatrixAndVector(JenniferScene): Write(result) ) self.play(Blink(self.jenny)) - self.dither() + self.wait() class MathematicalEmpathy(TeacherStudentsScene): def construct(self): @@ -1820,7 +1820,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() diff --git a/old_projects/eola/footnote.py b/old_projects/eola/footnote.py index e1197e46..58675c9e 100644 --- a/old_projects/eola/footnote.py +++ b/old_projects/eola/footnote.py @@ -41,7 +41,7 @@ class OpeningQuote(Scene): three_d.highlight(BLUE) self.play(FadeIn(words)) self.play(Write(three_d)) - self.dither(2) + self.wait(2) class QuickFootnote(TeacherStudentsScene): def construct(self): @@ -57,11 +57,11 @@ class PeakOutsideFlatland(TeacherStudentsScene): def construct(self): self.setup() self.teacher_says("Peak outside flatland") - self.dither() + self.wait() student = self.get_students()[0] self.student_thinks(student_index = 0) student.bubble.make_green_screen() - self.dither() + self.wait() class SymbolicThreeDTransform(Scene): CONFIG = { @@ -92,12 +92,12 @@ class SymbolicThreeDTransform(Scene): self.play(Write(func)) self.play(Write(in_vect), Write(in_words)) - self.dither() + self.wait() self.add(in_vect.copy()) self.play(Transform(in_vect, point, submobject_mode = "lagged_start")) self.play(Transform(in_vect, out_vect, submobject_mode = "lagged_start")) self.add(out_words) - self.dither() + self.wait() class ThreeDLinearTransformExample(Scene): pass @@ -108,10 +108,10 @@ class SingleVectorToOutput(Scene): class InputWordOutputWord(Scene): def construct(self): self.add(TextMobject("Input").scale(2)) - self.dither() + self.wait() self.clear() self.add(TextMobject("Output").scale(2)) - self.dither() + self.wait() class TransformOnlyBasisVectors(Scene): pass @@ -123,7 +123,7 @@ class IHatJHatKHatWritten(Scene): sym.scale(3) sym.highlight(color) self.play(Write(sym)) - self.dither() + self.wait() self.clear() class PutTogether3x3Matrix(Scene): @@ -170,13 +170,13 @@ class PutTogether3x3Matrix(Scene): for mob in everything.split(): self.play(Write(mob, run_time = 1)) - self.dither() + self.wait() self.play( FadeOut(everything), Transform(VMobject(*start_entries), VMobject(*target_entries)), Transform(start_brackets, target_bracketes) ) - self.dither() + self.wait() class RotateSpaceAboutYAxis(Scene): pass @@ -243,7 +243,7 @@ class ShowVCoordinateMeaning(Scene): lin_comb.shift(0.35*UP) self.play(*map(Write, [v, eq, coords])) - self.dither() + self.wait() self.play( Transform( coords.get_entries().copy(), @@ -254,7 +254,7 @@ class ShowVCoordinateMeaning(Scene): Write(VMobject(*[eq2, i, j, k] + list(plusses))), run_time = 3 ) - self.dither() + self.wait() class ScaleAndAddAfterTransformation(Scene): pass @@ -335,9 +335,9 @@ class ShowMatrixVectorMultiplication(Scene): ), Write(sym) ) - self.dither() + self.wait() self.play(Write(result_brace, run_time = 1)) - self.dither() + self.wait() class ShowMatrixMultiplication(Scene): def construct(self): @@ -365,7 +365,7 @@ class ShowMatrixMultiplication(Scene): self.add(right, left) self.play(Write(right_brace)) self.play(Write(left_brace)) - self.dither() + self.wait() class ApplyTwoSuccessiveTransforms(Scene): pass @@ -378,7 +378,7 @@ class ComputerGraphicsAndRobotics(Scene): ) mob.arrange_submobjects(DOWN, buff = 1) self.play(Write(mob, run_time = 1)) - self.dither() + self.wait() class ThreeDRotation(Scene): pass @@ -415,7 +415,7 @@ class QuestionsToPonder(Scene): questions.to_edge(LEFT) for question in questions.split(): self.play(Write(question, run_time = 1)) - self.dither() + self.wait() class NextVideo(Scene): def construct(self): @@ -430,7 +430,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() diff --git a/old_projects/eola/footnote2.py b/old_projects/eola/footnote2.py index 84adffef..10580f08 100644 --- a/old_projects/eola/footnote2.py +++ b/old_projects/eola/footnote2.py @@ -38,9 +38,9 @@ class OpeningQuote(Scene): author.next_to(words, DOWN, buff = 0.5) self.play(FadeIn(words)) - self.dither(2) + self.wait(2) self.play(Write(author, run_time = 3)) - self.dither() + self.wait() class AnotherFootnote(TeacherStudentsScene): def construct(self): @@ -69,7 +69,7 @@ class ColumnsRepresentBasisVectors(Scene): self.add(matrix) self.play(Write(question, run_time = 2)) - self.dither() + self.wait() self.play(FadeOut(question)) for i, words in enumerate([i_hat_words, j_hat_words]): arrow = Arrow( @@ -85,7 +85,7 @@ class ColumnsRepresentBasisVectors(Scene): for m in matrix.get_mob_matrix()[:,i] ] ) - self.dither(2) + self.wait(2) self.put_in_thought_bubble() def put_in_thought_bubble(self): @@ -105,9 +105,9 @@ class ColumnsRepresentBasisVectors(Scene): randy.change_mode, "pondering" ) self.play(Blink(randy)) - self.dither() + self.wait() self.play(randy.change_mode, "surprised") - self.dither() + self.wait() class Symbolic2To3DTransform(Scene): def construct(self): @@ -151,21 +151,21 @@ class Symbolic2To3DTransform(Scene): GrowFromCenter(output_brace), Write(output_words) ) - self.dither() + self.wait() class PlaneStartState(LinearTransformationScene): def construct(self): self.add_title("Input space") labels = self.get_basis_vector_labels() self.play(*map(Write, labels)) - self.dither() + self.wait() class OutputIn3dWords(Scene): def construct(self): words = TextMobject("Output in 3d") words.scale(1.5) self.play(Write(words)) - self.dither() + self.wait() class OutputIn3d(Scene): pass @@ -199,14 +199,14 @@ class DescribeColumnsInSpecificTransformation(Scene): ) self.play(Write(matrix.get_brackets())) - self.dither() + self.wait() for col in i_col, j_col: self.play( Write(col), ShowCreation(col.arrow), Write(col.words, run_time = 1) ) - self.dither() + self.wait() class CountRowsAndColumns(Scene): def construct(self): @@ -234,13 +234,13 @@ class CountRowsAndColumns(Scene): GrowFromCenter(cols_brace), Write(cols_words, run_time = 2) ) - self.dither() + self.wait() self.play( rows_words[0].copy().move_to, title[0], cols_words[0].copy().move_to, title[2], Write(VMobject(title[1], title[3])) ) - self.dither() + self.wait() class WriteColumnSpaceDefinition(Scene): def construct(self): @@ -270,7 +270,7 @@ class WriteColumnSpaceDefinition(Scene): GrowFromCenter(brace), Write(words, run_time = 2) ) - self.dither() + self.wait() class MatrixInTheWild(Scene): def construct(self): @@ -297,10 +297,10 @@ class MatrixInTheWild(Scene): randy.change_mode, "pondering" ) # self.play(matrix.highlight_columns, X_COLOR, Y_COLOR) - self.dither() + self.wait() for x in range(3): self.play(Blink(randy)) - self.dither(2) + self.wait(2) new_matrix = Matrix([[3, 1, 4], [1, 5, 9]]) new_matrix.move_to(matrix, aligned_edge = UP+LEFT) self.play( @@ -312,9 +312,9 @@ class MatrixInTheWild(Scene): self.add(matrix) self.play(randy.look, DOWN+RIGHT, run_time = 0.5) self.play(randy.change_mode, "confused") - self.dither() + self.wait() self.play(Blink(randy)) - self.dither() + self.wait() top_brace = Brace(matrix, UP) top_words = top_brace.get_text("3 basis vectors") @@ -337,7 +337,7 @@ class MatrixInTheWild(Scene): Write(side_words, run_time = 2) ) self.play(Blink(randy)) - self.dither() + self.wait() class ThreeDToTwoDInput(Scene): pass @@ -347,7 +347,7 @@ class ThreeDToTwoDInputWords(Scene): words = TextMobject("3d input") words.scale(2) self.play(Write(words)) - self.dither() + self.wait() class ThreeDToTwoDOutput(LinearTransformationScene): CONFIG = { @@ -385,7 +385,7 @@ class ThreeDToTwoDOutput(LinearTransformationScene): for v, tex in pairs: self.label_vector(v, tex) self.play(Write(subwords)) - self.dither() + self.wait() class ThreeDToTwoDSideBySide(Scene): pass @@ -434,7 +434,7 @@ class Symbolic2To1DTransform(Scene): GrowFromCenter(output_brace), Write(output_words) ) - self.dither() + self.wait() class TwoDTo1DTransform(LinearTransformationScene): CONFIG = { @@ -456,19 +456,19 @@ class TwoDTo1DTransform(LinearTransformationScene): self.play(Write(plane_words)) - self.dither() + self.wait() self.remove(plane_words) mobjects = self.get_mobjects() self.play( *map(FadeOut, mobjects) + [ShowCreation(line)] ) self.play(Write(line_words)) - self.dither() + self.wait() self.remove(line_words) self.play(*map(FadeIn, mobjects)) self.apply_transposed_matrix(self.t_matrix) self.play(Write(VMobject(*line.get_number_mobjects()))) - self.dither() + self.wait() self.show_matrix() def show_matrix(self): @@ -491,9 +491,9 @@ class TwoDTo1DTransform(LinearTransformationScene): for i, vect in enumerate([self.i_hat, self.j_hat]): self.play(vect.rotate, np.pi/12, rate_func = wiggle) self.play(Write(vect.words)) - self.dither() + self.wait() self.play(vect.words[1].copy().move_to, entries[i]) - self.dither() + self.wait() class TwoDTo1DTransformWithDots(TwoDTo1DTransform): def construct(self): @@ -526,7 +526,7 @@ class TwoDTo1DTransformWithDots(TwoDTo1DTransform): added_anims = [Transform(dots, new_dots)] ) self.play(Write(words)) - self.dither() + self.wait() class NextVideo(Scene): def construct(self): @@ -541,7 +541,7 @@ class NextVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither() + self.wait() class DotProductPreview(VectorScene): CONFIG = { @@ -586,7 +586,7 @@ class DotProductPreview(VectorScene): Animation(self.v), rate_func = there_and_back ) - self.dither() + self.wait() def project_w(self): dot_product = np.dot(self.v.get_end(), self.w.get_end()) @@ -606,7 +606,7 @@ class DotProductPreview(VectorScene): self.play(ShowCreation(projection_line)) self.add(self.w.copy().fade()) self.play(Transform(self.w, projected_w)) - self.dither() + self.wait() def show_scaling(self): dot_product = np.dot(self.v.get_end(), self.w.get_end()) @@ -632,16 +632,16 @@ class DotProductPreview(VectorScene): new_w = self.w.copy().scale(self.v.get_length()) self.play(Write(start_brace)) - self.dither() + self.wait() self.play( Transform(start_brace, interim_brace), Transform(self.w, new_w) ) - self.dither() + self.wait() self.play( Transform(start_brace, final_brace) ) - self.dither() + self.wait() diff --git a/old_projects/eulers_characteristic_formula.py b/old_projects/eulers_characteristic_formula.py index c8faa10e..54cb4c13 100644 --- a/old_projects/eulers_characteristic_formula.py +++ b/old_projects/eulers_characteristic_formula.py @@ -47,16 +47,16 @@ class PreferOtherProofDialogue(Scene): student_bubble.write("I prefer the \\\\ other proof.") self.add(student, teacher, teacher_bubble, teacher_bubble.text) - self.dither(2) + self.wait(2) self.play(Transform( Dot(student_bubble.tip).highlight("black"), Mobject(student_bubble, student_bubble.text) )) - self.dither(2) + self.wait(2) self.remove(teacher_bubble.text) teacher_bubble.write("Does that make this \\\\ any less elegant?") self.add(teacher_bubble.text) - self.dither(2) + self.wait(2) class IllustrateDuality(GraphScene): def construct(self): @@ -93,7 +93,7 @@ class IllustrateDuality(GraphScene): self.dual_vertices ) ]) - self.dither() + self.wait() class IntroduceGraph(GraphScene): def construct(self): @@ -121,9 +121,9 @@ class IntroduceGraph(GraphScene): self.draw_edges() self.clear() self.add(*self.vertices + self.edges) - self.dither() + self.wait() self.add(graph) - self.dither() + self.wait() kwargs = { "rate_func" : there_and_back, "run_time" : 5.0 @@ -138,7 +138,7 @@ class IntroduceGraph(GraphScene): ]) self.remove(not_okay) self.add(planar, planar_explanation) - self.dither(2) + self.wait(2) self.remove(planar_explanation) self.add(not_okay) self.remove(*edges_to_remove) @@ -147,10 +147,10 @@ class IntroduceGraph(GraphScene): rate_func = lambda t : 1 - t, run_time = 1.0 )) - self.dither(2) + self.wait(2) self.remove(not_okay) self.add(connected, *edges_to_remove) - self.dither() + self.wait() class OldIntroduceGraphs(GraphScene): @@ -158,7 +158,7 @@ class OldIntroduceGraphs(GraphScene): GraphScene.construct(self) self.draw_vertices() self.draw_edges() - self.dither() + self.wait() self.clear() self.add(*self.edges) self.replace_vertices_with(Face().scale(0.4)) @@ -174,7 +174,7 @@ class OldIntroduceGraphs(GraphScene): self.edges ) ]) - self.dither() + self.wait() class PlanarGraphDefinition(Scene): def construct(self): @@ -194,7 +194,7 @@ class PlanarGraphDefinition(Scene): ] self.add(quote, planar, end_quote) - self.dither() + self.wait() self.play( FadeOut(quote), FadeOut(end_quote), @@ -202,17 +202,17 @@ class PlanarGraphDefinition(Scene): FadeIn(graphs[0]), run_time = 1.5 ) - self.dither() + self.wait() self.remove(graphs[0]) self.add(graphs[1]) planar.highlight("red") self.add(Not) - self.dither(2) + self.wait(2) planar.highlight("white") self.remove(Not) self.remove(graphs[1]) self.add(graphs[2]) - self.dither(2) + self.wait(2) class TerminologyFromPolyhedra(GraphScene): @@ -248,26 +248,26 @@ class TerminologyFromPolyhedra(GraphScene): Transform(l1, l2) for l1, l2 in zip(cube.split(), self.edges) ]) - self.dither() + self.wait() self.add(dots_to_vertices) self.play(*[ ShowCreation(dot, run_time = 1.0) for dot in self.vertices ]) - self.dither(2) + self.wait(2) self.remove(dots_to_vertices, *self.vertices) self.add(lines_to_edges) self.play(ApplyMethod( Mobject(*self.edges).highlight, "yellow" )) - self.dither(2) + self.wait(2) self.clear() self.add(*self.edges) self.add(regions_to_faces) self.generate_regions() for region in self.regions: self.highlight_region(region) - self.dither(3.0) + self.wait(3.0) class ThreePiecesOfTerminology(GraphScene): @@ -290,13 +290,13 @@ class ThreePiecesOfTerminology(GraphScene): self.add(accent(cycles)) self.trace_cycle(run_time = 1.0) - self.dither() + self.wait() tone_down(cycles) self.remove(self.traced_cycle) self.add(accent(spanning_trees)) self.play(ShowCreation(self.spanning_tree), run_time = 1.0) - self.dither() + self.wait() tone_down(spanning_trees) self.remove(self.spanning_tree) @@ -308,13 +308,13 @@ class ThreePiecesOfTerminology(GraphScene): ShowCreation(mob, run_time = 1.0) for mob in self.dual_vertices + self.dual_edges ]) - self.dither() + self.wait() self.clear() self.play(ApplyMethod( Mobject(*terms).center )) - self.dither() + self.wait() class WalkingRandolph(GraphScene): args_list = [ @@ -379,13 +379,13 @@ class PathExamples(GraphScene): self.remove(not_a_path) self.add(valid_path) self.play(ShowCreation(path_lines, **kwargs)) - self.dither(2) + self.wait(2) self.remove(path_lines) self.remove(valid_path) self.add(not_a_path) self.play(ShowCreation(non_path_lines, **kwargs)) - self.dither(2) + self.wait(2) self.remove(non_path_lines) class IntroduceCycle(WalkingRandolph): @@ -405,7 +405,7 @@ class IntroduceCycle(WalkingRandolph): ] for region in regions: self.highlight_region(region) - self.dither() + self.wait() @@ -418,10 +418,10 @@ class IntroduceRandolph(GraphScene): randy, deepcopy(randy).scale(RANDOLPH_SCALE_FACTOR).move_to(self.points[0]), )) - self.dither() + self.wait() name.shift((0, 1, 0)) self.add(name) - self.dither() + self.wait() class DefineSpanningTree(GraphScene): def construct(self): @@ -451,7 +451,7 @@ class DefineSpanningTree(GraphScene): self.add(randy) self.accent_vertices(run_time = 2.0) self.add(dollar_signs) - self.dither(2) + self.wait(2) self.remove(dollar_signs) run_time_per_branch = 0.5 self.play( @@ -470,7 +470,7 @@ class DefineSpanningTree(GraphScene): green_dot_at_index(pair[1]), run_time = run_time_per_branch )) - self.dither(2) + self.wait(2) unneeded_edges = filter(out_of_spanning_set, self.graph.edges) for edge, limit in zip(unneeded_edges, range(5)): @@ -478,7 +478,7 @@ class DefineSpanningTree(GraphScene): line.highlight("red") self.play(ShowCreation(line, run_time = 1.0)) self.add(unneeded.center().shift(line.get_center() + 0.2*UP)) - self.dither() + self.wait() self.remove(line, unneeded) class NamingTree(GraphScene): @@ -499,12 +499,12 @@ class NamingTree(GraphScene): ) self.clear() self.add(tree, *branches) - self.dither() + self.wait() self.play(*[ Transform(b1, b2, run_time = 2) for b1, b2 in zip(branches, treeified_branches) ]) - self.dither() + self.wait() self.play(*[ FadeIn(mob) for mob in self.edges + self.vertices @@ -515,7 +515,7 @@ class NamingTree(GraphScene): self.accent_vertices(run_time = 2) self.remove(tree) self.add(spanning_tree) - self.dither(2) + self.wait(2) class DualGraph(GraphScene): def construct(self): @@ -526,7 +526,7 @@ class DualGraph(GraphScene): ShowCreation(mob) for mob in self.dual_edges + self.dual_vertices ]) - self.dither() + self.wait() class FacebookLogo(Scene): def construct(self): @@ -554,19 +554,19 @@ class FacebookGraph(GraphScene): for point in self.points ] self.add(*accounts) - self.dither() + self.wait() self.annotate_edges(friends) - self.dither() + self.wait() self.play(*[ CounterclockwiseTransform(account, vertex) for account, vertex in zip(accounts, self.vertices) ]) - self.dither() + self.wait() self.play(*[ Transform(ann, edge) for ann, edge in zip(self.edge_annotations, self.edges) ]) - self.dither() + self.wait() class FacebookGraphAsAbstractSet(Scene): def construct(self): @@ -605,12 +605,12 @@ class FacebookGraphAsAbstractSet(Scene): ).highlight("white") self.add(accounts, friendships, lines) - self.dither() + self.wait() for mob in names_mob, friends_mob: self.play(ShowCreation( mob, run_time = 1.0 )) - self.dither() + self.wait() class ExamplesOfGraphs(GraphScene): @@ -661,9 +661,9 @@ class ExamplesOfGraphs(GraphScene): self.handle_english_words(obj_mob, not_mob) else: self.add(obj_mob) - self.dither() + self.wait() self.add(not_mob) - self.dither() + self.wait() def handle_english_words(self, words1, words2): words = map(TextMobject, ["graph", "grape", "gape", "gripe"]) @@ -691,10 +691,10 @@ class ExamplesOfGraphs(GraphScene): comp_lines = Mobject(*lines) self.add(words1) self.play(ShowCreation(comp_words, run_time = 1.0)) - self.dither() + self.wait() self.add(words2) self.play(ShowCreation(comp_lines, run_time = 1.0)) - self.dither() + self.wait() self.remove(comp_words, comp_lines) @@ -712,11 +712,11 @@ class ExamplesOfGraphs(GraphScene): ShowCreation(mob, run_time = 1.0) for mob in self.edges + self.vertices ]) - self.dither() + self.wait() for region in self.regions: self.highlight_region(region) self.add(words1) - self.dither() + self.wait() self.reset_background() self.add(words2) @@ -746,12 +746,12 @@ class ExamplesOfGraphs(GraphScene): edge = deepcopy(self.edges[self.graph.edges.index(tup)]) edge.highlight("red") self.play(ShowCreation(edge), run_time = 1.0) - self.dither() + self.wait() self.remove(edge) else: self.remove(connected) self.add(not_connected) - self.dither(2) + self.wait(2) self.reset_background() @@ -784,26 +784,26 @@ class DrawDualGraph(GraphScene): self.dual_edges ) - self.dither() + self.wait() self.reset_background() self.highlight_region(outer_region, outer_region_mob.get_color()) self.play(*[ Transform(reg_mob, dot) for reg_mob, dot in zip(region_mobs, self.dual_vertices) ]) - self.dither() + self.wait() self.reset_background() self.play(ApplyFunction( lambda p : (SPACE_WIDTH + SPACE_HEIGHT)*p/np.linalg.norm(p), outer_region_mob )) - self.dither() + self.wait() for edges in internal_edges, external_edges: self.play(*[ ShowCreation(edge, run_time = 2.0) for edge in edges ]) - self.dither() + self.wait() class EdgesAreTheSame(GraphScene): def construct(self): @@ -811,19 +811,19 @@ class EdgesAreTheSame(GraphScene): self.generate_dual_graph() self.remove(*self.vertices) self.add(*self.dual_edges) - self.dither() + self.wait() self.play(*[ Transform(*pair, run_time = 2.0) for pair in zip(self.dual_edges, self.edges) ]) - self.dither() + self.wait() self.add( TextMobject(""" (Or at least I would argue they should \\\\ be thought of as the same thing.) """, size = "\\small").to_edge(UP) ) - self.dither() + self.wait() class ListOfCorrespondances(Scene): def construct(self): @@ -859,7 +859,7 @@ class ListOfCorrespondances(Scene): if last: last.highlight("white") last = line - self.dither(1) + self.wait(1) class CyclesCorrespondWithConnectedComponents(GraphScene): @@ -886,11 +886,11 @@ class CyclesCorrespondWithConnectedComponents(GraphScene): run_time = 1.0 ) lines_to_remove.append(line) - self.dither() + self.wait() self.remove(randy, *lines_to_remove) for region in np.array(self.regions)[enclosed_regions]: self.highlight_region(region) - self.dither(2) + self.wait(2) self.reset_background() lines = Mobject(*[ Line(self.dual_points[last], self.dual_points[next]) @@ -906,7 +906,7 @@ class CyclesCorrespondWithConnectedComponents(GraphScene): ] + [ ApplyMethod(self.edges[0].highlight, "green") ]) - self.dither() + self.wait() class IntroduceMortimer(GraphScene): @@ -929,9 +929,9 @@ class IntroduceMortimer(GraphScene): self.clear() self.add(randy) - self.dither() + self.wait() self.add(morty, name) - self.dither() + self.wait() self.remove(name) small_randy = deepcopy(randy).scale(RANDOLPH_SCALE_FACTOR) small_morty = deepcopy(morty).scale(RANDOLPH_SCALE_FACTOR) @@ -944,14 +944,14 @@ class IntroduceMortimer(GraphScene): Transform(randy, small_randy), Transform(morty, small_morty), ], **kwargs) - self.dither() + self.wait() self.highlight_region(self.regions[morty_path[0]]) for last, next in zip(morty_path, morty_path[1:]): self.play(WalkPiCreature(morty, self.dual_points[next]),**kwargs) self.highlight_region(self.regions[next]) - self.dither() + self.wait() for last, next in zip(randy_path, randy_path[1:]): line = Line(self.points[last], self.points[next]) line.highlight("yellow") @@ -960,7 +960,7 @@ class IntroduceMortimer(GraphScene): ShowCreation(line), **kwargs ) - self.dither() + self.wait() self.play(*[ ApplyMethod( line.rotate_in_place, @@ -969,7 +969,7 @@ class IntroduceMortimer(GraphScene): for line in morty_crossed_lines ], **kwargs) - self.dither() + self.wait() class RandolphMortimerSpanningTreeGame(GraphScene): args_list = [(SampleGraph(),)] @@ -989,13 +989,13 @@ class RandolphMortimerSpanningTreeGame(GraphScene): self.add(randy, morty) self.play(ShowCreation(self.spanning_tree)) - self.dither() + self.wait() self.play(WalkPiCreature( morty, self.dual_points[attempted_dual_point_index], rate_func = lambda t : 0.3 * there_and_back(t), run_time = 2.0, )) - self.dither() + self.wait() for index in range(len(self.regions)): # if index > 0: # edge = self.edges[dual_edges[index-1]] @@ -1008,8 +1008,8 @@ class RandolphMortimerSpanningTreeGame(GraphScene): # for tip in edge.start, edge.end # ], run_time = time_per_dual_edge) self.highlight_region(self.regions[region_ordering[index]]) - self.dither(time_per_dual_edge) - self.dither() + self.wait(time_per_dual_edge) + self.wait() cycle_index = region_ordering[-1] @@ -1019,7 +1019,7 @@ class RandolphMortimerSpanningTreeGame(GraphScene): Line(self.points[last], self.points[next]).highlight("green") for last, next in zip(cycle, list(cycle)[1:] + [cycle[0]]) ]))) - self.dither() + self.wait() class MortimerCannotTraverseCycle(GraphScene): args_list = [(SampleGraph(),)] @@ -1069,7 +1069,7 @@ class MortimerCannotTraverseCycle(GraphScene): Transform(line, deepcopy(edge).highlight(line.get_color())) for line, edge in zip(all_lines, matching_edges) ]) - self.dither() + self.wait() class TwoPropertiesOfSpanningTree(Scene): def construct(self): @@ -1085,7 +1085,7 @@ class TwoPropertiesOfSpanningTree(Scene): """).shift(tree.get_center() + 2*UP) self.add(spanning, tree) - self.dither() + self.wait() for word, explanation, vect in [ (spanning, spanning_explanation, 0.5*UP), (tree, tree_explanation, 0.5*DOWN) @@ -1096,7 +1096,7 @@ class TwoPropertiesOfSpanningTree(Scene): tail = word.get_center() - vect, )) self.play(ApplyMethod(word.highlight, "yellow")) - self.dither() + self.wait() class DualSpanningTree(GraphScene): @@ -1120,7 +1120,7 @@ class DualSpanningTree(GraphScene): *np.array(self.edges)[dual_edges] ).highlight("red"))) self.add(words) - self.dither() + self.wait() class TreeCountFormula(Scene): def construct(self): @@ -1143,7 +1143,7 @@ class TreeCountFormula(Scene): dot = Dot(branch.points[-1]) self.add(dot) all_dots.append(dot) - self.dither() + self.wait() self.remove(*all_dots) self.play( FadeOut(text), @@ -1164,8 +1164,8 @@ class FinalSum(Scene): ], size = "\\large").split() for line in lines[:2] + [Mobject(*lines[2:])]: self.add(line) - self.dither() - self.dither() + self.wait() + self.wait() symbols = V, minus, E, plus, F, equals, two = TexMobject( "V - E + F = 2".split(" ") @@ -1179,7 +1179,7 @@ class FinalSum(Scene): anims.append(CounterclockwiseTransform(copy, mob)) self.clear() self.play(*anims, run_time = 2.0) - self.dither() + self.wait() diff --git a/old_projects/fractal_charm.py b/old_projects/fractal_charm.py index 6391993c..7b759332 100644 --- a/old_projects/fractal_charm.py +++ b/old_projects/fractal_charm.py @@ -46,8 +46,8 @@ class FractalCreation(Scene): fractal, new_fractal, **self.transform_kwargs )) - self.dither() - self.dither() + self.wait() + self.wait() self.fractal = fractal class PentagonalFractalCreation(FractalCreation): @@ -79,7 +79,7 @@ class PiCreatureFractalCreation(FractalCreation): fractal.target.shift(-smallest_pi.get_corner(UP+LEFT)) fractal.target.scale(zoom_factor) self.play(MoveToTarget(fractal, run_time = 10)) - self.dither() + self.wait() class QuadraticKochFractalCreation(FractalCreation): CONFIG = { diff --git a/old_projects/fractal_dimension.py b/old_projects/fractal_dimension.py index 01e76cd6..1ec5520c 100644 --- a/old_projects/fractal_dimension.py +++ b/old_projects/fractal_dimension.py @@ -65,7 +65,7 @@ class KochTest(Scene): koch.scale, 3, koch.get_left(), koch.set_stroke, None, 4 ) - self.dither() + self.wait() class SierpinskiTest(Scene): def construct(self): @@ -78,9 +78,9 @@ class SierpinskiTest(Scene): run_time = 5, submobject_mode = "lagged_start", )) - self.dither() + self.wait() # self.play(sierp.scale, 2, sierp.get_top()) - # self.dither(3) + # self.wait(3) @@ -145,7 +145,7 @@ class ZoomInOnFractal(PiCreatureScene): self.pi_creature.change_mode, "thinking", run_time = 2 ) - self.dither() + self.wait() grower_target = grower.copy() grower = grower[self.index_to_replace] @@ -161,7 +161,7 @@ class WhatAreFractals(TeacherStudentsScene): width = 6 ) self.change_student_modes("thinking", "pondering", None) - self.dither() + self.wait() name = TextMobject("Benoit Mandelbrot") name.to_corner(UP+LEFT) @@ -177,12 +177,12 @@ class WhatAreFractals(TeacherStudentsScene): for pi in self.get_pi_creatures() ] ) - self.dither(2) + self.wait(2) question = TextMobject("Aren't they", "self-similar", "shapes?") question.highlight_by_tex("self-similar", YELLOW) self.student_says(question) self.play(self.get_teacher().change_mode, "happy") - self.dither(2) + self.wait(2) class IntroduceVonKochCurve(Scene): CONFIG = { @@ -197,7 +197,7 @@ class IntroduceVonKochCurve(Scene): self.play(ShowCreation(snowflake, run_time = 3)) self.play(Write(name, run_time = 2)) curve = self.isolate_one_curve(snowflake) - self.dither() + self.wait() self.zoom_in_on(curve) self.zoom_in_on(curve) @@ -228,7 +228,7 @@ class IntroduceVonKochCurve(Scene): ApplyMethod(curve.shift, curve.get_center()/2) for curve in snowflake ]) - self.dither() + self.wait() self.play( snowflake.scale, 2.1, snowflake.next_to, UP, DOWN @@ -255,7 +255,7 @@ class IntroduceVonKochCurve(Scene): sub_portion.highlight, YELLOW, rate_func = there_and_back ) - self.dither() + self.wait() class IntroduceSierpinskiTriangle(PiCreatureScene): CONFIG = { @@ -270,7 +270,7 @@ class IntroduceSierpinskiTriangle(PiCreatureScene): run_time = 2, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play( self.pi_creature.change_mode, "pondering", *[ @@ -278,13 +278,13 @@ class IntroduceSierpinskiTriangle(PiCreatureScene): for submob in sierp ] ) - self.dither() + self.wait() for submob in sierp: self.play(sierp.shift, -submob.get_center()) - self.dither() + self.wait() self.play(sierp.restore) self.change_mode("happy") - self.dither() + self.wait() class SelfSimilarFractalsAsSubset(Scene): CONFIG = { @@ -322,7 +322,7 @@ class SelfSimilarFractalsAsSubset(Scene): run_time = 3 ) self.play(ShowCreation(small_rect)) - self.dither() + self.wait() def add_general_fractals(self): big_rectangle = Rectangle( @@ -360,7 +360,7 @@ class SelfSimilarFractalsAsSubset(Scene): ) self.play(FadeIn(randy)) self.play(MoveToTarget(randy, run_time = 2)) - self.dither(2) + self.wait(2) class ConstrastSmoothAndFractal(Scene): CONFIG = { @@ -418,7 +418,7 @@ class ConstrastSmoothAndFractal(Scene): britains.set_fill, BLUE, 1, britains.set_stroke, None, 0, ) - self.dither() + self.wait() self.play( ApplyMethod( smooth_britain.scale, @@ -436,7 +436,7 @@ class ConstrastSmoothAndFractal(Scene): Animation(fractal), run_time = 10, ) - self.dither(2) + self.wait(2) class InfiniteKochZoom(Scene): CONFIG = { @@ -508,18 +508,18 @@ class ShowIdealizations(Scene): ) self.play(FadeIn(britain)) - self.dither() + self.wait() self.play(Transform(britain.copy(), smooth_britain)) - self.dither() + self.wait() self.play(Transform(britain.copy(), koch_snowflake)) - self.dither() - self.dither(2) + self.wait() + self.wait(2) class SayFractalDimension(TeacherStudentsScene): def construct(self): self.teacher_says("Fractal dimension") self.change_student_modes("confused", "hesitant", "pondering") - self.dither(3) + self.wait(3) class ExamplesOfDimension(Scene): def construct(self): @@ -544,8 +544,8 @@ class ExamplesOfDimension(Scene): Write(label), run_time = 3 ) - self.dither() - self.dither() + self.wait() + self.wait() class FractalDimensionIsNonsense(Scene): def construct(self): @@ -569,7 +569,7 @@ class FractalDimensionIsNonsense(Scene): mathy.change_mode, "guilty" ) self.play(Blink(mathy)) - self.dither() + self.wait() class DimensionForNaturalNumbers(Scene): def construct(self): @@ -588,10 +588,10 @@ class DimensionForNaturalNumbers(Scene): Write(labels[0]), ShowCreation(line) ) - self.dither() + self.wait() for label in labels[1:]: self.play(Write(label)) - self.dither() + self.wait() class Show2DPlanein3D(Scene): def construct(self): @@ -608,13 +608,13 @@ class OfCourseItsMadeUp(TeacherStudentsScene): \\emph{is} a made up concept... """) self.change_student_modes(*["hesitant"]*3) - self.dither(2) + self.wait(2) self.teacher_says( """But it's useful!""", target_mode = "hooray" ) self.change_student_modes(*["happy"]*3) - self.dither(3) + self.wait(3) class FourSelfSimilarShapes(Scene): CONFIG = { @@ -675,18 +675,18 @@ class FourSelfSimilarShapes(Scene): self.play(GrowFromCenter(square)) self.play(FadeIn(cube)) self.play(ShowCreation(sierpinski)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), FadeIn(brace_text) ) - self.dither() + self.wait() self.play(*map(FadeOut, [brace, brace_text])) - self.dither() + self.wait() for title in titles: self.play(Write(title, run_time = 1)) - self.dither(2) + self.wait(2) def show_self_similarity(self, shapes): shapes_copy = shapes.copy() @@ -695,7 +695,7 @@ class FourSelfSimilarShapes(Scene): self.play(line.shift, 3*DOWN) self.play(ApplyFunction(break_up, line)) - self.dither() + self.wait() brace = Brace(line[0], DOWN) brace_text = brace.get_text("1/2") self.play( @@ -703,25 +703,25 @@ class FourSelfSimilarShapes(Scene): Write(brace_text) ) brace.add(brace_text) - self.dither() + self.wait() self.play(square.next_to, square, DOWN, LARGE_BUFF) self.play(ApplyFunction(break_up, square)) subsquare = square[0] subsquare.save_state() self.play(subsquare.replace, shapes[1]) - self.dither() + self.wait() self.play(subsquare.restore) self.play(brace.next_to, subsquare, DOWN) - self.dither() + self.wait() - self.dither(5)#Handle cube + self.wait(5)#Handle cube self.play(sierpinski.next_to, sierpinski, DOWN, LARGE_BUFF) self.play(ApplyFunction(break_up, sierpinski)) - self.dither() + self.wait() self.play(brace.next_to, sierpinski[0], DOWN) - self.dither(2) + self.wait(2) self.play(FadeOut(brace)) def mention_measurements(self): @@ -743,7 +743,7 @@ class FourSelfSimilarShapes(Scene): Write(label, run_time = 1), shape[0].highlight, YELLOW ) - self.dither() + self.wait() class BreakUpCubeIn3D(Scene): def construct(self): @@ -780,11 +780,11 @@ class GeneralWordForMeasurement(Scene): for word in words: self.play(FadeIn(word)) self.play(ShowCreation(lines, run_time = 2)) - self.dither() + self.wait() self.play(Write(measure)) - self.dither(2) + self.wait(2) self.play(Transform(measure, mass)) - self.dither(2) + self.wait(2) class ImagineShapesAsMetal(FourSelfSimilarShapes): def construct(self): @@ -814,8 +814,8 @@ class ImagineShapesAsMetal(FourSelfSimilarShapes): MoveToTarget(title), MoveToTarget(shape) ) - self.dither() - self.dither() + self.wait() + self.wait() for shape in shapes: self.play( @@ -823,7 +823,7 @@ class ImagineShapesAsMetal(FourSelfSimilarShapes): run_time = 3, rate_func = there_and_back ) - self.dither() + self.wait() class ScaledLineMass(Scene): CONFIG = { @@ -876,7 +876,7 @@ class ScaledLineMass(Scene): GrowFromCenter(big_brace), Write(big_brace_text) ) - self.dither() + self.wait() self.play( shape.copy().replace, shape_copy[0] @@ -887,19 +887,19 @@ class ScaledLineMass(Scene): GrowFromCenter(little_brace), Write(little_brace_text) ) - self.dither() + self.wait() self.play(Write(mass_scaling_label[1], run_time = 1)) - self.dither() + self.wait() self.play(FadeIn( VGroup(*shape_copy[1:]), submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play(Transform( shape_copy.copy(), shape )) - self.dither() + self.wait() def get_shape(self): return VGroup( @@ -1037,7 +1037,7 @@ class DefineTwoDimensional(PiCreatureScene): self.play(GrowFromCenter(brace)) self.play(top_L.next_to, brace, LEFT) - self.dither() + self.wait() self.brace = brace @@ -1057,7 +1057,7 @@ class DefineTwoDimensional(PiCreatureScene): brace.target = Brace(shape.target, LEFT) self.play(*map(MoveToTarget, group)) self.play(bottom_L.next_to, brace, LEFT) - self.dither() + self.wait() def show_dimension(self): top_dimension = self.dimension_in_title.copy() @@ -1067,7 +1067,7 @@ class DefineTwoDimensional(PiCreatureScene): self.dimension_in_exp, run_time = 2, )) - self.dither(3) + self.wait(3) def get_shape(self): return Square( @@ -1096,7 +1096,7 @@ class DefineSierpinskiDimension(DefineTwoDimensional): def construct(self): DefineTwoDimensional.construct(self) self.change_mode("confused") - self.dither() + self.wait() self.add_one_third() self.isolate_equation() @@ -1110,7 +1110,7 @@ class DefineSierpinskiDimension(DefineTwoDimensional): self.play(Write(equation)) self.change_mode("pondering") - self.dither() + self.wait() self.equation = VGroup(self.bottom_mass, equation) self.distilled_equation = VGroup( @@ -1141,7 +1141,7 @@ class DefineSierpinskiDimension(DefineTwoDimensional): self.pi_creature.change_mode, "confused", self.pi_creature.look_at, self.equation ) - self.dither() + self.wait() equation = self.distilled_equation self.play( @@ -1150,7 +1150,7 @@ class DefineSierpinskiDimension(DefineTwoDimensional): equation.to_corner, UP+RIGHT, run_time = 2 ) - self.dither(2) + self.wait(2) simpler_equation = TexMobject("2^D = 3") simpler_equation[1].highlight(self.dimension_color) @@ -1165,13 +1165,13 @@ class DefineSierpinskiDimension(DefineTwoDimensional): self.play(Write(simpler_equation)) self.change_mode("pondering") - self.dither(2) + self.wait(2) self.play(Write(log_expression)) self.play( self.pi_creature.change_mode, "hooray", self.pi_creature.look_at, log_expression ) - self.dither(2) + self.wait(2) def get_shape(self): return Sierpinski( @@ -1191,7 +1191,7 @@ class ShowSierpinskiCurve(Scene): curve, self.get_curve(order), run_time = 2 )) - self.dither() + self.wait() def get_curve(self, order): curve = SierpinskiCurve(order = order, monochromatic = True) @@ -1215,7 +1215,7 @@ class LengthAndAreaOfSierpinski(ShowSierpinskiCurve): curve = self.get_curve(order = self.curve_start_order) sierp = self.get_sierpinski(order = self.sierpinski_start_order) self.add(curve, sierp) - self.dither() + self.wait() for x in range(self.n_iterations): new_curve = self.get_curve(order = self.curve_start_order+x+1) @@ -1232,7 +1232,7 @@ class LengthAndAreaOfSierpinski(ShowSierpinskiCurve): run_time = 2 ) self.play(sierp.set_fill, None, 0) - self.dither() + self.wait() def get_curve(self, order): # curve = ShowSierpinskiCurve.get_curve(self, order) @@ -1262,7 +1262,7 @@ class FractionalAnalogOfLengthAndArea(Scene): """ )) self.play(Blink(morty)) - self.dither() + self.wait() class DimensionOfKoch(Scene): CONFIG = { @@ -1314,7 +1314,7 @@ class DimensionOfKoch(Scene): curve.to_corner(UP+RIGHT, LARGE_BUFF) self.play(ShowCreation(curve, run_time = 2)) - self.dither() + self.wait() self.curve = curve def break_up_curve(self): @@ -1331,7 +1331,7 @@ class DimensionOfKoch(Scene): break_up(broken_curve.target, self.break_up_factor) broken_curve.target.shift_onto_screen self.play(MoveToTarget(broken_curve)) - self.dither() + self.wait() self.add(broken_curve) self.broken_curve = broken_curve @@ -1349,11 +1349,11 @@ class DimensionOfKoch(Scene): Write(one), Write(one_third), ) - self.dither() + self.wait() self.play(Write(self.scaling_factor_mob)) - self.dither() + self.wait() self.play(Write(self.mass_scaling_factor_mob)) - self.dither() + self.wait() def show_dimension(self): raw_formula = TexMobject(""" @@ -1412,11 +1412,11 @@ class DimensionOfKoch(Scene): self.play(*map(FadeIn, formula[1:-1])) self.remove(third, fourth) self.add(formula) - self.dither(2) + self.wait(2) self.play(Transform(formula, simpler_formula)) - self.dither(2) + self.wait(2) self.play(Write(log_expression)) - self.dither(2) + self.wait(2) class DimensionOfQuadraticKoch(DimensionOfKoch): CONFIG = { @@ -1459,7 +1459,7 @@ class DimensionOfQuadraticKoch(DimensionOfKoch): resulting_fractal.shift(SPACE_WIDTH*RIGHT/2) self.add(seed_label, seed) - self.dither() + self.wait() self.play( curve.next_to, resulting_fractal, DOWN, MED_LARGE_BUFF, Write(resulting_fractal, run_time = 1) @@ -1471,7 +1471,7 @@ class DimensionOfQuadraticKoch(DimensionOfKoch): curve.insert_n_anchor_points(6*n_anchors) curve.make_jagged() self.play(Transform(curve, new_curve, run_time = 2)) - self.dither() + self.wait() self.curve = curve @@ -1502,10 +1502,10 @@ class DimensionOfQuadraticKoch(DimensionOfKoch): run_time = 2 ) ) - self.dither() + self.wait() self.play(Write(self.scaling_factor_mob)) self.play(Write(self.mass_scaling_factor_mob)) - self.dither(2) + self.wait(2) class ThisIsSelfSimilarityDimension(TeacherStudentsScene): def construct(self): @@ -1514,7 +1514,7 @@ class ThisIsSelfSimilarityDimension(TeacherStudentsScene): ``self-similarity dimension'' """) self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) class ShowSeveralSelfSimilarityDimensions(Scene): def construct(self): @@ -1562,7 +1562,7 @@ class ShowSeveralSelfSimilarityDimensions(Scene): label.next_to(curve, u*UP, buff = LARGE_BUFF) self.add(label) - self.dither() + self.wait() for order in range(2, max(max_orders)+1): anims = [] @@ -1572,7 +1572,7 @@ class ShowSeveralSelfSimilarityDimensions(Scene): new_curve.replace(curve) anims.append(Transform(curve, new_curve)) self.play(*anims, run_time = 2) - self.dither() + self.wait() self.curves = curves class SeparateFractals(Scene): @@ -1596,9 +1596,9 @@ class SeparateFractals(Scene): ) for curve in curves ]) - self.dither(2) + self.wait(2) self.play(curves.restore) - self.dither() + self.wait() class ShowDiskScaling(Scene): def construct(self): @@ -1631,7 +1631,7 @@ class ShowDiskScaling(Scene): shapes.next_to(title, DOWN) for shape in shapes: self.play(FadeIn(shape)) - self.dither(2) + self.wait(2) self.disk = disk self.to_fade = VGroup( @@ -1655,7 +1655,7 @@ class ShowDiskScaling(Scene): self.play(ShowCreation(radius)) self.play(Write(one)) - self.dither() + self.wait() self.disk.add(radius, one) @@ -1671,7 +1671,7 @@ class ShowDiskScaling(Scene): scaled_disk.target.submobjects[-1] = two self.play(MoveToTarget(scaled_disk)) - self.dither() + self.wait() self.scaled_disk = scaled_disk @@ -1682,7 +1682,7 @@ class ShowDiskScaling(Scene): mass_scaling.next_to(self.scaled_disk, UP) mass_scaling.to_edge(UP) self.play(Write(mass_scaling)) - self.dither() + self.wait() def try_fitting_small_disks(self): disk = self.disk.copy() @@ -1697,16 +1697,16 @@ class ShowDiskScaling(Scene): self.play(Transform(disk, foursome)) self.remove(*self.get_mobjects_from_last_animation()) self.add(foursome) - self.dither() + self.wait() self.play(ApplyFunction( lambda m : break_up(m, 0.2), foursome, rate_func = there_and_back, run_time = 4, )) - self.dither() + self.wait() self.play(FadeOut(foursome)) - self.dither() + self.wait() class WhatDoYouMeanByMass(TeacherStudentsScene): def construct(self): @@ -1715,9 +1715,9 @@ class WhatDoYouMeanByMass(TeacherStudentsScene): target_mode = "sassy" ) self.change_student_modes("pondering", "sassy", "confused") - self.dither() + self.wait() self.play(self.get_teacher().change_mode, "thinking") - self.dither(2) + self.wait(2) self.teacher_thinks("") self.zoom_in_on_thought_bubble() @@ -1878,15 +1878,15 @@ class BoxCountingWithDisk(BoxCountingScene): ShowCreation(grid), Animation(disk), ) - self.dither() + self.wait() self.play( FadeIn(corner_rect), FadeIn(counting_label) ) counting_mob = self.count_boxes(boxes) - self.dither() + self.wait() self.play(Write(prop_words, run_time = 2)) - self.dither(2) + self.wait(2) self.play(FadeOut(prop_words)) @@ -1902,7 +1902,7 @@ class BoxCountingWithDisk(BoxCountingScene): boxes = self.get_highlighted_boxes(disk) large_box_count = len(boxes) new_counting_mob = self.count_boxes(boxes) - self.dither() + self.wait() frac_line = TexMobject("-") frac_line.highlight(YELLOW) @@ -1915,7 +1915,7 @@ class BoxCountingWithDisk(BoxCountingScene): approx.shift_onto_screen() self.play(*map(Write, [frac_line, decimal])) self.play(Write(approx)) - self.dither() + self.wait() randy = Randolph().shift(3*RIGHT).to_edge(DOWN) self.play(FadeIn(randy)) @@ -1925,7 +1925,7 @@ class BoxCountingWithDisk(BoxCountingScene): bubble_kwargs = {"direction" : LEFT} )) self.play(Blink(randy)) - self.dither() + self.wait() class FinerBoxCountingWithDisk(BoxCountingWithDisk): CONFIG = { @@ -1966,7 +1966,7 @@ class PlotDiskBoxCounting(GraphScene): ]) self.play(ShowCreation(data_dots)) - self.dither() + self.wait() self.play(ShowCreation(self.graph)) self.label_graph( self.graph, @@ -1975,7 +1975,7 @@ class PlotDiskBoxCounting(GraphScene): buff = SMALL_BUFF, color = WHITE, ) - self.dither() + self.wait() def describe_better_fit(self): words = TextMobject("Better fit at \\\\ higher inputs") @@ -1986,7 +1986,7 @@ class PlotDiskBoxCounting(GraphScene): self.play(ShowCreation(arrow)) self.play(Write(words)) - self.dither(2) + self.wait(2) class FineGridSameAsLargeScaling(BoxCountingScene): CONFIG = { @@ -2002,18 +2002,18 @@ class FineGridSameAsLargeScaling(BoxCountingScene): grid.scale(self.scale_factor) self.add(grid, disk) - self.dither() + self.wait() self.play(disk.scale, self.scale_factor) - self.dither() + self.wait() self.play( grid.scale, 1./self.scale_factor, disk.scale, 1./self.scale_factor, disk.set_stroke, None, 0.5, ) - self.dither() + self.wait() boxes = self.get_highlighted_boxes(disk) self.play(ShowCreation(boxes, run_time = 3)) - self.dither(2) + self.wait(2) class BoxCountingSierpinski(BoxCountingScene): CONFIG = { @@ -2036,9 +2036,9 @@ class BoxCountingSierpinski(BoxCountingScene): self.play(ShowCreation(sierp)) self.play(*map(FadeIn, [corner_rect, counting_label])) - self.dither() + self.wait() counting_mob = self.count_boxes(boxes) - self.dither() + self.wait() self.play( FadeOut(boxes), sierp.scale, 2, sierp.get_corner(DOWN+RIGHT), @@ -2046,7 +2046,7 @@ class BoxCountingSierpinski(BoxCountingScene): self.play(counting_mob.next_to, counting_mob, DOWN) boxes = self.get_highlighted_boxes(sierp) new_counting_mob = self.count_boxes(boxes) - self.dither() + self.wait() frac_line = TexMobject("-") frac_line.highlight(YELLOW) @@ -2059,9 +2059,9 @@ class BoxCountingSierpinski(BoxCountingScene): equals_exp.shift_onto_screen() self.play(*map(Write, [frac_line, approx_three])) - self.dither() + self.wait() self.play(Write(equals_exp)) - self.dither() + self.wait() class PlotSierpinskiBoxCounting(PlotDiskBoxCounting): CONFIG = { @@ -2092,14 +2092,14 @@ class BoxCountingWithBritain(BoxCountingScene): boxes = self.get_highlighted_boxes(britain) self.play(ShowCreation(britain, run_time = 3)) - self.dither() + self.wait() self.play(ShowCreation(boxes, run_time = 3)) - self.dither() + self.wait() self.play(FadeOut(boxes)) self.play(britain.scale, 2.5, britain.get_corner(DOWN+RIGHT)) boxes = self.get_highlighted_boxes(britain) self.play(ShowCreation(boxes, run_time = 2)) - self.dither() + self.wait() def show_formula(self): corner_rect = self.get_corner_rect() @@ -2136,15 +2136,15 @@ class BoxCountingWithBritain(BoxCountingScene): FadeIn(corner_rect), Write(equation) ) - self.dither(2) + self.wait(2) self.play(FadeIn(simpler_eq)) - self.dither() + self.wait() self.play( FadeOut(equation), Animation(simpler_eq) ) self.play(MoveToTarget(simpler_eq)) - self.dither(2) + self.wait(2) log_expression1 = TexMobject( "\\log(", "N", ")", "=", @@ -2173,13 +2173,13 @@ class BoxCountingWithBritain(BoxCountingScene): self.play(Write(log_expression1)) self.remove(log_expression1) self.add(rewired_log_expression1) - self.dither() + self.wait() self.play(Transform( rewired_log_expression1, log_expression2, run_time = 2 )) - self.dither(2) + self.wait(2) self.final_expression = VGroup( simpler_eq, rewired_log_expression1 @@ -2205,7 +2205,7 @@ class GiveShapeAndPonder(Scene): self.play(Blink(morty)) self.play(randy.change_mode, "pondering") self.play(Blink(randy)) - self.dither() + self.wait() class CheapBoxCountingWithBritain(BoxCountingWithBritain): CONFIG = { @@ -2230,7 +2230,7 @@ class ConfusedAtParabolicData(PlotDiskBoxCounting): self.play(randy.change_mode, "confused") self.play(randy.look_at, self.x_axis_label_mob) self.play(Blink(randy)) - self.dither(2) + self.wait(2) class IntroduceLogLogPlot(GraphScene): CONFIG = { @@ -2275,7 +2275,7 @@ class IntroduceLogLogPlot(GraphScene): slope[-1].highlight(GREEN) slope.next_to(slope_lines, RIGHT) - self.dither() + self.wait() data_points = [ self.input_to_graph_point(x) + ((random.random()-0.5)/x)*UP for x in np.arange(1, 8, 0.7) @@ -2285,16 +2285,16 @@ class IntroduceLogLogPlot(GraphScene): for point in data_points ]) self.play(ShowCreation(data_dots, run_time = 3)) - self.dither() + self.wait() self.play( ShowCreation(graph), Animation(expression) ) - self.dither() + self.wait() self.play(ShowCreation(slope_lines)) self.play(Write(slope)) - self.dither() + self.wait() class ManyBritainCounts(BoxCountingWithBritain): CONFIG = { @@ -2316,7 +2316,7 @@ class ManyBritainCounts(BoxCountingWithBritain): self.play(britain.scale, 2, britain.point_from_proportion(0.8)) boxes = self.get_highlighted_boxes(britain) self.play(ShowCreation(boxes)) - self.dither() + self.wait() self.play(FadeOut(boxes)) class ReadyForRealDefinition(TeacherStudentsScene): @@ -2326,7 +2326,7 @@ class ReadyForRealDefinition(TeacherStudentsScene): fractals really are. """) self.change_student_modes(*["hooray"]*3) - self.dither(2) + self.wait(2) class DefineFractal(TeacherStudentsScene): def construct(self): @@ -2335,7 +2335,7 @@ class DefineFractal(TeacherStudentsScene): with a non-integer dimension. """) self.change_student_modes("thinking", "happy", "erm") - self.dither(3) + self.wait(3) self.teacher_says( "Kind of...", target_mode = "sassy" @@ -2345,7 +2345,7 @@ class DefineFractal(TeacherStudentsScene): ApplyMethod(pi.look, DOWN) for pi in self.get_pi_creatures() ]) - self.dither(3) + self.wait(3) class RoughnessAndFractionalDimension(Scene): def construct(self): @@ -2380,15 +2380,15 @@ class RoughnessAndFractionalDimension(Scene): Transform(randy, target, run_time = 2), Transform(one, new_dim) ) - self.dither() + self.wait() self.play(Blink(randy)) self.play(randy.look, DOWN+RIGHT) - self.dither() + self.wait() self.play(randy.look, DOWN+LEFT) self.play(Blink(randy)) - self.dither() + self.wait() self.play(Transform(randy, ponder_target)) - self.dither() + self.wait() class DifferentSlopesAtDifferentScales(IntroduceLogLogPlot): def construct(self): @@ -2422,12 +2422,12 @@ class DifferentSlopesAtDifferentScales(IntroduceLogLogPlot): self.play(ShowCreation(data_dots, run_time = 2)) self.play(ShowCreation(self.graph)) - self.dither() + self.wait() self.play( Write(words), ShowCreation(arrows) ) - self.dither() + self.wait() class HoldUpCoilExample(TeacherStudentsScene): def construct(self): @@ -2440,13 +2440,13 @@ class HoldUpCoilExample(TeacherStudentsScene): ApplyMethod(pi.look_at, point) for pi in self.get_students() ]) - self.dither(5) + self.wait(5) self.change_student_modes(*["thinking"]*3) self.play(*[ ApplyMethod(pi.look_at, point) for pi in self.get_students() ]) - self.dither(5) + self.wait(5) class SmoothHilbertZoom(Scene): def construct(self): @@ -2464,7 +2464,7 @@ class SmoothHilbertZoom(Scene): title.to_edge(UP) self.add(two_d_title) - self.dither() + self.wait() self.play( ApplyMethod( hilbert.scale, 100, @@ -2476,7 +2476,7 @@ class SmoothHilbertZoom(Scene): ), run_time = 3 ) - self.dither() + self.wait() class ListDimensionTypes(PiCreatureScene): CONFIG = { @@ -2495,7 +2495,7 @@ class ListDimensionTypes(PiCreatureScene): Write(text, run_time = 1), self.pi_creature.change_mode, "pondering" ) - self.dither(3) + self.wait(3) class ZoomInOnBritain(Scene): CONFIG = { @@ -2521,19 +2521,19 @@ class ZoomInOnBritain(Scene): )) self.add(britain) - self.dither() + self.wait() self.play( britain.scale, self.zoom_factor, point, run_time = 10 ) - self.dither() + self.wait() class NoteTheConstantSlope(Scene): def construct(self): words = TextMobject("Note the \\\\ constant slope") words.highlight(YELLOW) self.play(Write(words)) - self.dither(2) + self.wait(2) class FromHandwavyToQuantitative(Scene): def construct(self): @@ -2562,7 +2562,7 @@ class FromHandwavyToQuantitative(Scene): randy.change_mode, "happy" ) self.play(Blink(randy)) - self.dither() + self.wait() class WhatSlopeDoesLogLogPlotApproach(IntroduceLogLogPlot): CONFIG = { @@ -2609,7 +2609,7 @@ class WhatSlopeDoesLogLogPlotApproach(IntroduceLogLogPlot): morty.change_mode, "speaking" ) self.play(Blink(morty)) - self.dither() + self.wait() class BritainBoxCountHighZoom(BoxCountingWithBritain): def construct(self): @@ -2632,12 +2632,12 @@ class BritainBoxCountHighZoom(BoxCountingWithBritain): a, b = 0.25, 0.35 britain.pointwise_become_partial(britain, a, b) self.count_britain(britain) - self.dither() + self.wait() def count_britain(self, britain): boxes = self.get_highlighted_boxes(britain) self.play(ShowCreation(boxes)) - self.dither() + self.wait() self.play(FadeOut(boxes)) class IfBritainWasEventuallySmooth(Scene): @@ -2647,12 +2647,12 @@ class IfBritainWasEventuallySmooth(Scene): point = britain.point_from_proportion(0.3) self.add(britain) - self.dither() + self.wait() self.play( britain.scale, 200, point, run_time = 10 ) - self.dither() + self.wait() class SmoothBritainLogLogPlot(IntroduceLogLogPlot): CONFIG = { @@ -2699,17 +2699,17 @@ class SmoothBritainLogLogPlot(IntroduceLogLogPlot): self.play(ShowCreation(data_dots, run_time = 3)) self.play(ShowCreation(self.graph)) - self.dither() + self.wait() self.play( ShowCreation(slope_lines1), Write(slope_label1) ) - self.dither() + self.wait() self.play( ShowCreation(slope_lines2), Write(slope_label2) ) - self.dither() + self.wait() class SlopeAlwaysAboveOne(WhatSlopeDoesLogLogPlotApproach): CONFIG = { @@ -2724,7 +2724,7 @@ class ChangeWorldview(TeacherStudentsScene): you see the world. """) self.change_student_modes(*["thinking"]*3) - self.dither(3) + self.wait(3) class CompareBritainAndNorway(Scene): def construct(self): @@ -2763,7 +2763,7 @@ class CompareBritainAndNorway(Scene): *map(ShowCreation, [norway, britain]), run_time = 3 ) - self.dither() + self.wait() self.play(*it.chain(*[ [ mob.set_stroke, None, 0, @@ -2771,7 +2771,7 @@ class CompareBritainAndNorway(Scene): ] for mob in britain, norway ])) - self.dither(2) + self.wait(2) class CompareOceansLabels(Scene): def construct(self): @@ -2782,9 +2782,9 @@ class CompareOceansLabels(Scene): label2.shift(SPACE_WIDTH*RIGHT/2).to_edge(UP) self.play(Write(label1)) - self.dither() + self.wait() self.play(Write(label2)) - self.dither() + self.wait() class CompareOceans(Scene): def construct(self): @@ -2832,7 +2832,7 @@ class FractalNonFractalFlowChart(Scene): self.add(randy) self.add(is_fractal) - self.dither() + self.wait() for word, arrow, answer in (yes, yes_arrow, nature), (no, no_arrow, man_made): self.play( ShowCreation(arrow), @@ -2840,7 +2840,7 @@ class FractalNonFractalFlowChart(Scene): ) self.play(Write(answer, run_time = 1)) if word is yes: - self.dither() + self.wait() else: self.play(Blink(randy)) @@ -2926,19 +2926,19 @@ class MortyLookingAtRectangle(Scene): ) self.play(Write(url)) self.play(Blink(morty)) - self.dither() + self.wait() self.play( url.restore, morty.change_mode, "happy" ) self.play(ShowCreation(rect)) - self.dither() + self.wait() self.play(Blink(morty)) for mode in ["wave_2", "hooray", "happy", "pondering", "happy"]: self.play(morty.change_mode, mode) - self.dither(2) + self.wait(2) self.play(Blink(morty)) - self.dither(2) + self.wait(2) diff --git a/old_projects/generate_logo.py b/old_projects/generate_logo.py index bfd55d2d..31b8b537 100644 --- a/old_projects/generate_logo.py +++ b/old_projects/generate_logo.py @@ -70,6 +70,6 @@ class LogoGeneration(Scene): self.save_image(IMAGE_DIR) self.logo = MobjectFromPixelArray(self.frames[-1]) self.add(self.name_mob) - self.dither() + self.wait() diff --git a/old_projects/hanoi.py b/old_projects/hanoi.py index 9e6d909c..daebf3b9 100644 --- a/old_projects/hanoi.py +++ b/old_projects/hanoi.py @@ -256,7 +256,7 @@ class CountTo27InTernary(CountInTernary): def construct(self): for x in range(27): self.increment() - self.dither() + self.wait() class CountInBinaryTo256(BinaryCountingScene): def construct(self): @@ -472,17 +472,17 @@ def get_ternary_ruler_sequence(order = 4): class SolveHanoi(TowersOfHanoiScene): def construct(self): - self.dither() + self.wait() for x in get_ruler_sequence(self.num_disks-1): self.move_disk(x, stay_on_peg = False) - self.dither() + self.wait() class SolveConstrainedHanoi(ConstrainedTowersOfHanoiScene): def construct(self): - self.dither() + self.wait() for x in get_ternary_ruler_sequence(self.num_disks-1): self.move_disk(x, run_time = 0.5, stay_on_peg = False) - self.dither() + self.wait() class Keith(PiCreature): CONFIG = { @@ -581,7 +581,7 @@ class IntroduceKeith(Scene): morty.look_at, bubble ) self.play(Blink(keith)) - self.dither() + self.wait() original_content = bubble.content bubble.write("I'm usually meh \\\\ on puzzles") self.play( @@ -600,7 +600,7 @@ class IntroduceKeith(Scene): Transform(original_content, bubble.content) ) self.play(Blink(morty)) - self.dither() + self.wait() self.play(FadeIn(randy)) self.play( randy.change_mode, "confused", @@ -619,7 +619,7 @@ class IntroduceKeith(Scene): keith.change_mode, "hooray", keith.look_at, randy.eyes ) - self.dither() + self.wait() class IntroduceTowersOfHanoi(TowersOfHanoiScene): def construct(self): @@ -651,9 +651,9 @@ class IntroduceTowersOfHanoi(TowersOfHanoiScene): ), Write(self.peg_labels) ) - self.dither() + self.wait() self.bring_in_disks() - self.dither() + self.wait() def bring_in_disks(self): peg = self.pegs[0] @@ -704,7 +704,7 @@ class IntroduceTowersOfHanoi(TowersOfHanoiScene): ) last = label self.play(last.restore) - self.dither() + self.wait() def show_more_disk_possibility(self): original_num_disks = self.num_disks @@ -721,27 +721,27 @@ class IntroduceTowersOfHanoi(TowersOfHanoiScene): self.remove(new_disks) self.play(Transform(self.disks, new_disks)) - self.dither() + self.wait() self.play(Transform(self.disks, original_disks_copy)) self.remove(self.disks) self.disks = original_disks_copy self.add(self.disks) - self.dither() + self.wait() self.num_disks = original_num_disks self.disk_height = original_disk_height def move_full_tower(self): self.move_subtower_to_peg(self.num_disks, 1, run_time = 2) - self.dither() + self.wait() self.reset_disks(run_time = 1, submobject_mode = "lagged_start") - self.dither() + self.wait() def move_single_disk(self): for x in 0, 1, 0: self.move_disk(x) - self.dither() + self.wait() def cannot_move_disk_onto_smaller_disk(self): also_not_allowed = TextMobject("Not allowed") @@ -757,13 +757,13 @@ class IntroduceTowersOfHanoi(TowersOfHanoiScene): ]) cross.replace(disk) self.play(FadeIn(cross)) - self.dither() + self.wait() self.play( FadeOut(cross), FadeOut(self.title), disk.restore ) - self.dither() + self.wait() class ExampleFirstMoves(TowersOfHanoiScene): def construct(self): @@ -771,14 +771,14 @@ class ExampleFirstMoves(TowersOfHanoiScene): cross = TexMobject("\\times") cross.set_fill(RED, 0.7) - self.dither() + self.wait() self.play( self.disks[0].set_fill, YELLOW, self.disks[0].label.highlight, BLACK ) - self.dither() + self.wait() self.move_disk(0) - self.dither() + self.wait() self.play( self.disks[1].set_fill, YELLOW_D, self.disks[1].label.highlight, BLACK @@ -786,14 +786,14 @@ class ExampleFirstMoves(TowersOfHanoiScene): self.move_disk_to_peg(1, 1) cross.replace(self.disks[1]) self.play(FadeIn(cross)) - self.dither() + self.wait() self.move_disk_to_peg(1, 2, added_anims = [FadeOut(cross)]) - self.dither() + self.wait() for x in ruler_sequence[2:9]: self.move_disk(x) for x in ruler_sequence[9:]: self.move_disk(x, run_time = 0.5, stay_on_peg = False) - self.dither() + self.wait() class KeithShowingBinary(Scene): def construct(self): @@ -840,7 +840,7 @@ class KeithShowingBinary(Scene): else: added_anims.append(Blink(morty)) self.play(get_bit_flip(), *added_anims) - self.dither() + self.wait() self.play( FadeIn(randy), morty.change_mode, "plain", @@ -854,10 +854,10 @@ class KeithShowingBinary(Scene): Write(randy.bubble.content) ) self.play(Blink(randy)) - self.dither() + self.wait() self.play(morty.change_mode, "hooray") self.play(Blink(morty)) - self.dither() + self.wait() class FocusOnRhythm(Scene): def construct(self): @@ -914,7 +914,7 @@ class IntroduceBase10(Scene): run_time = 2 ) self.play(Write(title)) - self.dither() + self.wait() self.title = title def list_digits(self): @@ -925,7 +925,7 @@ class IntroduceBase10(Scene): digits.next_to(self.title, DOWN, buff = LARGE_BUFF) digits.shift(2*RIGHT) self.play(Write(digits, lag_factor = 5)) - self.dither() + self.wait() class RhythmOfDecimalCounting(CountingScene): CONFIG = { @@ -945,18 +945,18 @@ class RhythmOfDecimalCounting(CountingScene): GrowFromCenter(brace), Write(two_digits, run_time = 1) ) - self.dither(2) + self.wait(2) self.play( Transform(brace, one_brace), Transform(two_digits, tens_place) ) - self.dither() + self.wait() ten_group.save_state() self.play( ten_group.scale_in_place, 7, ten_group.shift, 2*(DOWN+LEFT), ) - self.dither() + self.wait() self.play( ten_group.restore, *map(FadeOut, [brace, two_digits]) @@ -965,7 +965,7 @@ class RhythmOfDecimalCounting(CountingScene): for x in range(89): self.increment(run_time_per_anim = 0.25) self.increment(run_time_per_anim = 1) - self.dither() + self.wait() hundred_group = self.curr_configurations[2][0] hundred_group.save_state() @@ -973,9 +973,9 @@ class RhythmOfDecimalCounting(CountingScene): hundred_group.scale, 14, hundred_group.to_corner, DOWN+LEFT ) - self.dither() + self.wait() self.play(hundred_group.restore) - self.dither() + self.wait() groups = [ VGroup(*pair) for pair in zip(self.dot_templates, self.curr_configurations) @@ -1044,12 +1044,12 @@ class IntroduceBinaryCounting(BinaryCountingScene): GrowFromCenter(brace), Write(bits) ) - self.dither() + self.wait() bits.save_state() self.play(Transform(bits, binary_digits)) - self.dither() + self.wait() self.play(bits.restore) - self.dither() + self.wait() def initial_counting(self): randy = Randolph().to_corner(DOWN+LEFT) @@ -1061,7 +1061,7 @@ class IntroduceBinaryCounting(BinaryCountingScene): self.play(self.number_mob.set_fill, self.power_colors[0], 1) self.increment() - self.dither() + self.wait() self.start_dot = self.curr_configurations[0][0] ##Up to 10 @@ -1081,7 +1081,7 @@ class IntroduceBinaryCounting(BinaryCountingScene): randy.look_at, self.number_mob, Write(bubble.content) ) - self.dither() + self.wait() curr_content = bubble.content bubble.write("$1 \\! \\cdot \\! 2+$", "$0$") bubble.content[0][0].highlight(self.power_colors[1]) @@ -1100,7 +1100,7 @@ class IntroduceBinaryCounting(BinaryCountingScene): one.highlight(zero.get_color()) self.play(Blink(randy)) self.increment(added_anims = [Transform(zero, one)]) - self.dither() + self.wait() #Up to 100 curr_content = bubble.content @@ -1134,7 +1134,7 @@ class IntroduceBinaryCounting(BinaryCountingScene): ) for x in range(8): self.increment(total_run_time = 1) - self.dither() + self.wait() for x in range(8): self.increment(total_run_time = 1.5) @@ -1208,12 +1208,12 @@ class BinaryCountingAtEveryScale(Scene): submobject_mode = "lagged_start", lag_factor = self.num_bits )) - self.dither() + self.wait() self.play( get_run_through(bit_mobs[2**(self.num_bits-1)+1:]), Write(again) ) - self.dither() + self.wait() class BinaryCountingAtSmallestScale(BinaryCountingAtEveryScale): CONFIG = { @@ -1271,7 +1271,7 @@ class IntroduceSolveByCounting(TowersOfHanoiScene): disk[1].set_fill, BLACK, last_bit.set_fill, YELLOW, ) - self.dither() + self.wait() self.move_disk(0, run_time = 2) self.play( last_bit.restore, @@ -1294,13 +1294,13 @@ class IntroduceSolveByCounting(TowersOfHanoiScene): twos_bit.set_fill, MAROON_B, ) self.move_disk(1, run_time = 2) - self.dither() + self.wait() self.move_disk_to_peg(1, 1, stay_on_peg = False) cross = TexMobject("\\times") cross.replace(disk) cross.set_fill(RED, opacity = 0.5) self.play(FadeIn(cross)) - self.dither() + self.wait() self.move_disk_to_peg( 1, 2, stay_on_peg = False, added_anims = [FadeOut(cross)] @@ -1317,7 +1317,7 @@ class IntroduceSolveByCounting(TowersOfHanoiScene): added_anims = [self.get_increment_animation()], run_time = 2 ) - self.dither() + self.wait() ##Fourth increment self.play( @@ -1341,11 +1341,11 @@ class IntroduceSolveByCounting(TowersOfHanoiScene): FadeOut(brace), FadeOut(words) ) - self.dither() + self.wait() for disk_index in 0, 1, 0: self.play(self.get_increment_animation()) self.move_disk(disk_index) - self.dither() + self.wait() ##Eighth incremement brace = braces[3] @@ -1373,7 +1373,7 @@ class IntroduceSolveByCounting(TowersOfHanoiScene): for disk_index in get_ruler_sequence(2): self.play(self.get_increment_animation()) self.move_disk(disk_index, stay_on_peg = False) - self.dither() + self.wait() def initialize_bit_mobs(self): bit_mobs = VGroup(*[ @@ -1420,7 +1420,7 @@ class SolveSixDisksByCounting(IntroduceSolveByCounting): stay_on_peg = self.stay_on_peg, run_time = self.run_time_per_move, ) - self.dither() + self.wait() class RecursionTime(Scene): def construct(self): @@ -1452,7 +1452,7 @@ class RecursionTime(Scene): bubble.content.gradient_highlight, BLUE_A, BLUE_E ) self.play(Blink(morty)) - self.dither() + self.wait() class RecursiveSolution(TowersOfHanoiScene): CONFIG = { @@ -1497,13 +1497,13 @@ class RecursiveSolution(TowersOfHanoiScene): ) big_disk.add(self.eyes) self.blink() - self.dither() + self.wait() self.change_mode("angry") for x in range(2): - self.dither() + self.wait() self.shake(big_disk) self.blink() - self.dither() + self.wait() self.change_mode("plain") self.look_at(self.peg_labels[2]) self.look_at(self.disks[0]) @@ -1515,7 +1515,7 @@ class RecursiveSolution(TowersOfHanoiScene): FadeIn(sub_step_brace), Write(sub_steps[0], run_time = 1) ]) - self.dither() + self.wait() self.move_disk_to_peg(0, 0, run_time = 2, added_anims = [ self.eyes.look_at_anim(self.pegs[0].get_top()) ]) @@ -1545,7 +1545,7 @@ class RecursiveSolution(TowersOfHanoiScene): ShowCreation(bubble), Write(bubble.content) ) - self.dither() + self.wait() self.blink() self.play(*map(FadeOut, [bubble, bubble.content])) big_disk.remove(self.eyes) @@ -1554,7 +1554,7 @@ class RecursiveSolution(TowersOfHanoiScene): Write(sub_steps[2]) ]) self.play(FadeOut(self.eyes)) - self.dither() + self.wait() #Highlight subproblem self.play( @@ -1575,7 +1575,7 @@ class RecursiveSolution(TowersOfHanoiScene): Write(q_mark), sub_steps[-1].highlight, YELLOW ) - self.dither() + self.wait() self.play( GrowFromCenter(sub_sub_steps_brace), *map(FadeOut, [arc, q_mark]) @@ -1668,9 +1668,9 @@ class KeithSaysBigToSmall(Scene): ShowCreation(bubble), Write(bubble.content) ) - self.dither() + self.wait() self.play(Blink(keith)) - self.dither() + self.wait() class CodeThisUp(Scene): def construct(self): @@ -1693,15 +1693,15 @@ class CodeThisUp(Scene): morty.look_at, point ) self.play(Blink(keith)) - self.dither(2) + self.wait(2) self.play(Blink(morty)) - self.dither() + self.wait() self.play( keith.change_mode, "hooray", keith.look_at, morty.eyes ) self.play(Blink(keith)) - self.dither() + self.wait() self.play( keith.change_mode, "speaking", keith.look_at, morty.eyes, @@ -1710,9 +1710,9 @@ class CodeThisUp(Scene): morty.change_mode, "happy", morty.look_at, keith.eyes, ) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() class HanoiSolutionCode(Scene): def construct(self): @@ -1733,7 +1733,7 @@ class NoRoomForInefficiency(Scene): Write(bubble.content) ) self.play(Blink(morty)) - self.dither() + self.wait() class WhyDoesBinaryAchieveThis(Scene): def construct(self): @@ -1756,9 +1756,9 @@ class WhyDoesBinaryAchieveThis(Scene): Write(bubble.content) ) self.play(keith.change_mode, "happy") - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() class BothAreSelfSimilar(Scene): def construct(self): @@ -1774,7 +1774,7 @@ class BothAreSelfSimilar(Scene): Write(bubble.content) ) self.play(Blink(morty)) - self.dither() + self.wait() class LargeScaleHanoiDecomposition(TowersOfHanoiScene): CONFIG = { @@ -1785,11 +1785,11 @@ class LargeScaleHanoiDecomposition(TowersOfHanoiScene): } def construct(self): self.move_subtower_to_peg(7, 1, stay_on_peg = False) - self.dither() + self.wait() self.move_disk(7, stay_on_peg = False) - self.dither() + self.wait() self.move_subtower_to_peg(7, 2, stay_on_peg = False) - self.dither() + self.wait() class SolveTwoDisksByCounting(SolveSixDisksByCounting): CONFIG = { @@ -1806,7 +1806,7 @@ class SolveTwoDisksByCounting(SolveSixDisksByCounting): disk_index, stay_on_peg = False, ) - self.dither() + self.wait() class ShowFourDiskFourBitsParallel(IntroduceSolveByCounting): CONFIG = { @@ -1816,19 +1816,19 @@ class ShowFourDiskFourBitsParallel(IntroduceSolveByCounting): def construct(self): self.initialize_bit_mobs() self.counting_subtask() - self.dither() + self.wait() self.disk_subtask() - self.dither() + self.wait() self.play(self.get_increment_animation()) self.move_disk( self.num_disks-1, stay_on_peg = False, ) - self.dither() + self.wait() self.counting_subtask() - self.dither() + self.wait() self.disk_subtask() - self.dither() + self.wait() def disk_subtask(self): sequence = get_ruler_sequence(self.num_disks-2) @@ -1899,7 +1899,7 @@ class CoolRight(Scene): Write(bubble.content) ) self.play(Blink(morty)) - self.dither() + self.wait() curr_content = bubble.content bubble.write("It gets \\\\ better...") self.play( @@ -1907,9 +1907,9 @@ class CoolRight(Scene): morty.change_mode, "hooray", morty.look, OUT ) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() ############ Part 2 ############ @@ -1940,17 +1940,17 @@ class MentionLastVideo(Scene): self.play(Write(name)) self.play(ShowCreation(arrow)) self.play(Blink(morty)) - self.dither(2) + self.wait(2) self.play( morty.change_mode, "confused", morty.look_at, point ) self.play(Blink(keith)) - self.dither(2) + self.wait(2) self.play( morty.change_mode, "surprised" ) - self.dither() + self.wait() class IntroduceConstrainedTowersOfHanoi(ConstrainedTowersOfHanoiScene): CONFIG = { @@ -1966,12 +1966,12 @@ class IntroduceConstrainedTowersOfHanoi(ConstrainedTowersOfHanoiScene): self.disks.save_state() for index in 0, 0, 1, 0: self.move_disk(index) - self.dither() - self.dither() + self.wait() + self.wait() self.play(self.disks.restore) self.disk_tracker = [set(range(self.num_disks)), set([]), set([])] - self.dither() + self.wait() self.move_disk_to_peg(0, 1) self.move_disk_to_peg(1, 2) self.play(ShowCreation(self.big_curved_arrow)) @@ -1984,7 +1984,7 @@ class IntroduceConstrainedTowersOfHanoi(ConstrainedTowersOfHanoiScene): big_cross.set_fill(opacity = 0.5) self.play(FadeIn(cross)) self.play(FadeIn(big_cross)) - self.dither() + self.wait() def add_arcs(self): @@ -2004,7 +2004,7 @@ class IntroduceConstrainedTowersOfHanoi(ConstrainedTowersOfHanoiScene): self.play(ShowCreation(curved_arrow1)) self.play(ShowCreation(curved_arrow2)) - self.dither() + self.wait() big_curved_arrow = Arc(start_angle = 5*np.pi/6, angle = -2*np.pi/3) big_curved_arrow.scale_to_fit_width(0.9*self.pegs.get_width()) @@ -2032,9 +2032,9 @@ class StillRecruse(Scene): ) self.play(morty.change_mode, "hooray") self.play(Blink(keith)) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() class RecursiveSolutionToConstrained(RecursiveSolution): CONFIG = { @@ -2098,7 +2098,7 @@ class RecursiveSolutionToConstrained(RecursiveSolution): self.look_at(self.pegs[0].get_top()) self.change_mode("angry") self.shake(big_disk) - self.dither() + self.wait() #Talk about tower blocking tower = VGroup(*self.disks[:self.num_disks-1]) @@ -2117,16 +2117,16 @@ class RecursiveSolutionToConstrained(RecursiveSolution): self.shake(tower, RIGHT, added_anims = [Animation(big_disk)]) self.blink() self.shake(big_disk) - self.dither() + self.wait() self.move_subtower_to_peg(self.num_disks-1, 1, added_anims = [ Transform(arrow, new_arrow), self.eyes.look_at_anim(self.pegs[1]) ]) self.play(Write(blocking[0])) self.shake(big_disk, RIGHT) - self.dither() + self.wait() self.blink() - self.dither() + self.wait() self.play(FadeIn(sub_steps_brace)) self.move_subtower_to_peg(self.num_disks-1, 2, added_anims = [ FadeOut(blocking), @@ -2140,7 +2140,7 @@ class RecursiveSolutionToConstrained(RecursiveSolution): self.move_disk_to_peg(self.num_disks-1, 1, added_anims = [ Write(sub_steps[1], run_time = 1), ]) - self.dither() + self.wait() self.move_subtower_to_peg(self.num_disks-1, 0, added_anims = [ self.eyes.look_at_anim(self.pegs[0]), Write(sub_steps[2], run_time = 1), @@ -2149,7 +2149,7 @@ class RecursiveSolutionToConstrained(RecursiveSolution): self.move_disk_to_peg(self.num_disks-1, 2, added_anims = [ Write(sub_steps[3], run_time = 1), ]) - self.dither() + self.wait() big_disk.remove(self.eyes) self.move_subtower_to_peg(self.num_disks-1, 2, added_anims = [ self.eyes.look_at_anim(self.pegs[2].get_top()), @@ -2186,7 +2186,7 @@ class RecursiveSolutionToConstrained(RecursiveSolution): self.move_disk_to_peg(num_disks-1, 1, added_anims = [ Write(sub_sub_steps[1], run_time = 1) ]) - self.dither() + self.wait() self.move_subtower_to_peg(num_disks-1, 0, added_anims = [ self.eyes.look_at_anim(self.pegs[0]), Write(sub_sub_steps[2], run_time = 1) @@ -2195,13 +2195,13 @@ class RecursiveSolutionToConstrained(RecursiveSolution): self.move_disk_to_peg(num_disks-1, 2, added_anims = [ Write(sub_sub_steps[3], run_time = 1) ]) - self.dither() + self.wait() big_disk.remove(self.eyes) self.move_subtower_to_peg(num_disks-1, 2, added_anims = [ self.eyes.look_at_anim(self.pegs[2].get_top()), Write(sub_sub_steps[4], run_time = 1) ]) - self.dither() + self.wait() #Show smallest subdivisions smaller_subdivision = VGroup( @@ -2234,7 +2234,7 @@ class RecursiveSolutionToConstrained(RecursiveSolution): ) self.blink() self.play(FadeOut(self.eyes)) - self.dither() + self.wait() #final movements movements = [ @@ -2252,7 +2252,7 @@ class RecursiveSolutionToConstrained(RecursiveSolution): disk_index, peg_index, stay_on_peg = False ) - self.dither() + self.wait() class SimpleConstrainedBreakdown(TowersOfHanoiScene): CONFIG = { @@ -2260,15 +2260,15 @@ class SimpleConstrainedBreakdown(TowersOfHanoiScene): } def construct(self): self.move_subtower_to_peg(self.num_disks-1, 2) - self.dither() + self.wait() self.move_disk(self.num_disks-1) - self.dither() + self.wait() self.move_subtower_to_peg(self.num_disks-1, 0) - self.dither() + self.wait() self.move_disk(self.num_disks-1) - self.dither() + self.wait() self.move_subtower_to_peg(self.num_disks-1, 2) - self.dither() + self.wait() class SolveConstrainedByCounting(ConstrainedTowersOfHanoiScene): CONFIG = { @@ -2348,7 +2348,7 @@ class CompareNumberSystems(Scene): FadeIn(symbol.name) ] self.play(Write(symbol, run_time = 2), *added_anims) - self.dither() + self.wait() self.play(FadeIn(keith)) self.play(keith.change_mode, "confused") self.play(keith.look_at, zero_to_nine) @@ -2366,14 +2366,14 @@ class CompareNumberSystems(Scene): morty.look_at, zero_one_two ) self.play(Blink(morty)) - self.dither() + self.wait() self.play( morty.shrug, morty.look_at, keith.eyes, keith.shrug, keith.look_at, morty.eyes ) - self.dither() + self.wait() self.play( morty.change_mode, "hesitant", morty.look_at, zero_one.name, @@ -2382,7 +2382,7 @@ class CompareNumberSystems(Scene): ) self.play(Blink(morty)) self.play(Write(dots, run_time = 3)) - self.dither() + self.wait() class IntroduceTernaryCounting(CountingScene): CONFIG = { @@ -2397,7 +2397,7 @@ class IntroduceTernaryCounting(CountingScene): def construct(self): for x in range(2): self.increment() - self.dither() + self.wait() self.increment() brace = Brace(self.number_mob[-1]) threes_place = brace.get_text("Three's place") @@ -2405,17 +2405,17 @@ class IntroduceTernaryCounting(CountingScene): GrowFromCenter(brace), Write(threes_place) ) - self.dither() + self.wait() for x in range(6): self.increment() - self.dither() + self.wait() new_brace = Brace(self.number_mob[-1]) nines_place = new_brace.get_text("Nine's place") self.play( Transform(brace, new_brace), Transform(threes_place, nines_place), ) - self.dither() + self.wait() for x in range(9): self.increment() @@ -2481,7 +2481,7 @@ class TernaryCountingSelfSimilarPattern(Scene): ) else: self.play(get_increment()) - self.dither() + self.wait() class TernaryCountingSelfSimilarPatternFiveTrits(TernaryCountingSelfSimilarPattern): CONFIG = { @@ -2493,7 +2493,7 @@ class CountInTernary(IntroduceTernaryCounting): def construct(self): for x in range(9): self.increment() - self.dither() + self.wait() class SolveConstrainedWithTernaryCounting(ConstrainedTowersOfHanoiScene): CONFIG = { @@ -2502,7 +2502,7 @@ class SolveConstrainedWithTernaryCounting(ConstrainedTowersOfHanoiScene): def construct(self): for x in range(3**self.num_disks-1): self.increment(run_time = 0.75) - self.dither() + self.wait() def setup(self): ConstrainedTowersOfHanoiScene.setup(self) @@ -2569,17 +2569,17 @@ class DescribeSolutionByCountingToConstrained(SolveConstrainedWithTernaryCountin Write(word, run_time = 1), self.curr_ternary_mob[0].highlight, color ) - self.dither() + self.wait() self.play( self.disks[0].set_fill, color, self.disks[0].label.set_fill, BLACK, ) self.move_next_disk(stay_on_peg = True) - self.dither() + self.wait() self.ternary_mobs[2][0].highlight(color) self.increment_number() self.move_next_disk(stay_on_peg = True) - self.dither() + self.wait() #Count 10 color = MAROON_B @@ -2590,25 +2590,25 @@ class DescribeSolutionByCountingToConstrained(SolveConstrainedWithTernaryCountin Transform(word, words[1]), self.curr_ternary_mob[1].highlight, color ) - self.dither() + self.wait() self.play( self.disks[1].set_fill, color, self.disks[1].label.set_fill, BLACK, ) self.move_next_disk(stay_on_peg = True) - self.dither() + self.wait() self.play(*map(FadeOut, [brace, word])) #Count up to 22 for x in range(5): self.increment() - self.dither() + self.wait() #Count to 100 color = RED words[2].highlight(color) - self.dither() + self.wait() self.increment_number() self.play( FadeIn(braces[2]), @@ -2617,9 +2617,9 @@ class DescribeSolutionByCountingToConstrained(SolveConstrainedWithTernaryCountin self.disks[2].set_fill, color, self.disks[2].label.set_fill, BLACK, ) - self.dither() + self.wait() self.move_next_disk(stay_on_peg = True) - self.dither() + self.wait() self.play(*map(FadeOut, [braces[2], words[2]])) for x in range(20): @@ -2633,10 +2633,10 @@ class Describe2222(Scene): VGroup(ternary_mob, brace, description).scale(1.5) self.add(ternary_mob) - self.dither() + self.wait() self.play(GrowFromCenter(brace)) self.play(Write(description)) - self.dither() + self.wait() class KeithAsksAboutConfigurations(Scene): def construct(self): @@ -2655,7 +2655,7 @@ class KeithAsksAboutConfigurations(Scene): ) self.play(Blink(morty)) self.play(morty.change_mode, "pondering") - self.dither() + self.wait() class AskAboutConfigurations(SolveConstrainedWithTernaryCounting): def construct(self): @@ -2666,7 +2666,7 @@ class AskAboutConfigurations(SolveConstrainedWithTernaryCounting): for x in range(15): self.remove(self.curr_ternary_mob) - self.dither(2) + self.wait(2) for y in range(7): self.increment(run_time = 0) @@ -2704,7 +2704,7 @@ class AnswerConfigurationsCount(TowersOfHanoiScene): disk.shift, x_diff*RIGHT ) self.play(disk.restore) - self.dither() + self.wait() def get_parentheticals(self, top_mob): parentheticals = VGroup(*reversed([ @@ -2760,7 +2760,7 @@ class ThisIsMostEfficientText(Scene): text.scale_to_fit_width(2*SPACE_WIDTH - 1) text.to_edge(DOWN) self.play(Write(text)) - self.dither(2) + self.wait(2) class RepeatingConfiguraiton(Scene): def construct(self): @@ -2788,7 +2788,7 @@ class RepeatingConfiguraiton(Scene): ShowCreation(special_arrows), special_dots.highlight, RED ) - self.dither() + self.wait() self.play( mid_mobs.shift, 2*DOWN, FadeOut(special_arrows) @@ -2797,7 +2797,7 @@ class RepeatingConfiguraiton(Scene): ShowCreation(mid_arrow), Write(more_efficient) ) - self.dither() + self.wait() class ShowSomeGraph(Scene): def construct(self): @@ -2838,7 +2838,7 @@ class ShowSomeGraph(Scene): submobject_mode = "lagged_start", run_time = 2, )) - self.dither() + self.wait() class SierpinskiGraphScene(Scene): CONFIG = { @@ -2976,7 +2976,7 @@ class SierpinskiGraphScene(Scene): ) self.remove(everything) self.add(*everything) - self.dither() + self.wait() class IntroduceGraphStructure(SierpinskiGraphScene): CONFIG = { @@ -3005,7 +3005,7 @@ class IntroduceGraphStructure(SierpinskiGraphScene): node.scale_to_fit_height, 2*SPACE_HEIGHT-2, node.next_to, ORIGIN, vect ) - self.dither() + self.wait() self.play(node.restore) node.saved_state = None vect = -vect @@ -3035,10 +3035,10 @@ class IntroduceGraphStructure(SierpinskiGraphScene): ) edge.target = self.node_indices_to_edge(12, 14) self.play(ShowCreation(edge)) - self.dither() + self.wait() for node in nodes: self.play(ShowCreation(node.arc)) - self.dither() + self.wait() self.play(*[ FadeOut(node.arc) for node in nodes @@ -3047,9 +3047,9 @@ class IntroduceGraphStructure(SierpinskiGraphScene): MoveToTarget(edge), *[node.restore for node in nodes] ) - self.dither() + self.wait() self.play(ShowCreation(self.edges, run_time = 3)) - self.dither() + self.wait() def tour_structure(self): for n in range(3): @@ -3062,12 +3062,12 @@ class IntroduceGraphStructure(SierpinskiGraphScene): for disk in self.disks[0] ] ) - self.dither() + self.wait() self.zoom_into_node(0, 3) self.zoom_into_node(15, 1) - self.dither() + self.wait() self.zoom_into_node(20, 1) - self.dither() + self.wait() class DescribeTriforcePattern(SierpinskiGraphScene): CONFIG = { @@ -3096,16 +3096,16 @@ class DescribeTriforcePattern(SierpinskiGraphScene): node.target.center().next_to(ORIGIN, vect) self.play(*map(MoveToTarget, nodes)) - self.dither() + self.wait() self.play(*[node.restore for node in nodes]) bold_edges = [ self.node_indices_to_edge(*pair).copy().set_stroke(self.disk_color, 6) for pair in self.index_pairs ] self.play(ShowCreation(bold_edges[0])) - self.dither() + self.wait() self.play(*map(ShowCreation, bold_edges[1:])) - self.dither() + self.wait() power_of_three = 3**(self.scale-1) index_sets = [ @@ -3126,13 +3126,13 @@ class DescribeTriforcePattern(SierpinskiGraphScene): rate_func = wiggle ) self.play(*map(wiggle_island, islands[:2])) - self.dither() + self.wait() self.play(wiggle_island(islands[2])) - self.dither() + self.wait() for index_set in index_sets: self.zoom_into_nodes(index_set) self.zoom_into_nodes(list(it.chain(*index_sets))) - self.dither() + self.wait() class TriforcePatternWord(Scene): def construct(self): @@ -3140,7 +3140,7 @@ class TriforcePatternWord(Scene): word.scale(2) word.to_corner(DOWN+RIGHT) self.play(Write(word)) - self.dither(2) + self.wait(2) class DescribeOrderTwoPattern(DescribeTriforcePattern): CONFIG = { @@ -3173,13 +3173,13 @@ class ShowPathThroughGraph(SierpinskiGraphScene): ) for n1, n2 in zip(self.nodes, self.nodes[1:]) ]) - self.dither() + self.wait() self.play(ShowCreation( arrows, rate_func = None, run_time = 5 )) - self.dither(2) + self.wait(2) for index in range(9): self.zoom_into_node(index) @@ -3191,7 +3191,7 @@ class MentionFinalAnimation(Scene): bubble.write("Before the final\\\\ animation...") self.add(morty) - self.dither() + self.wait() self.play( morty.change_mode, "speaking", morty.look_at, bubble.content, @@ -3199,9 +3199,9 @@ class MentionFinalAnimation(Scene): Write(bubble.content) ) self.play(Blink(morty)) - self.dither(2) + self.wait(2) self.play(Blink(morty)) - self.dither(2) + self.wait(2) class PatreonThanks(Scene): CONFIG = { @@ -3255,7 +3255,7 @@ class PatreonThanks(Scene): for patrons in left_patrons, right_patrons: for index in 0, -1: self.play(morty.look_at, patrons[index]) - self.dither() + self.wait() class MortyLookingAtRectangle(Scene): def construct(self): @@ -3273,15 +3273,15 @@ class MortyLookingAtRectangle(Scene): self.play(morty.change_mode, "raise_right_hand") self.play(Write(url)) self.play(Blink(morty)) - self.dither() + self.wait() self.play( url.restore, morty.change_mode, "happy" ) self.play(ShowCreation(rect)) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() class ShowSierpinskiCurvesOfIncreasingOrder(Scene): CONFIG = { @@ -3310,20 +3310,20 @@ class ShowSierpinskiCurvesOfIncreasingOrder(Scene): graph, path = graphs[0], paths[0] self.add(graph) - self.dither() + self.wait() self.play(ShowCreation(path, run_time = 3, rate_func = None)) - self.dither() + self.wait() self.play(graph.fade, 0.5, Animation(path)) for other_graph in graphs[1:]: other_graph.fade(0.5) - self.dither() + self.wait() for new_graph, new_path in zip(graphs[1:], paths[1:]): self.play( Transform(graph, new_graph), Transform(path, new_path), run_time = 2 ) - self.dither() + self.wait() self.path = path def get_path(self, graph_scene): diff --git a/old_projects/highD.py b/old_projects/highD.py index 59933aa9..d264876f 100644 --- a/old_projects/highD.py +++ b/old_projects/highD.py @@ -281,10 +281,10 @@ class SliderScene(Scene): self.ambient_velocity *= -1 self.add_foreground_mobjects(self.sliders) - def wind_down_ambient_movement(self, time = 1, dither = True): + def wind_down_ambient_movement(self, time = 1, wait = True): self.ambient_change_end_time = self.ambient_change_time + time - if dither: - self.dither(time) + if wait: + self.wait(time) if self.skip_animations: self.ambient_change_time += time @@ -332,11 +332,11 @@ class SliderScene(Scene): self.ambient_slider_movement_update() Scene.update_frame(self, *args, **kwargs) - def dither(self, time = 1): + def wait(self, time = 1): if self.ambiently_change_sliders: self.play(Animation(self.sliders, run_time = time)) else: - Scene.dither(self,time) + Scene.wait(self,time) ########## @@ -395,7 +395,7 @@ class MathIsATease(Scene): ), Blink(randy), ) - self.dither() + self.wait() class TODODeterminants(TODOStub): CONFIG = { @@ -472,7 +472,7 @@ class CircleToPairsOfPoints(Scene): ) ] ) - self.dither() + self.wait() ######### Rotation equations ########## @@ -525,7 +525,7 @@ class CircleToPairsOfPoints(Scene): Animation(circle), randy.change, "hooray" ) - self.dither() + self.wait() class GreatSourceOfMaterial(TeacherStudentsScene): def construct(self): @@ -534,7 +534,7 @@ class GreatSourceOfMaterial(TeacherStudentsScene): target_mode = "hooray" ) self.change_student_modes(*["happy"]*3) - self.dither(3) + self.wait(3) class CirclesSpheresSumsSquares(ExternallyAnimatedScene): pass @@ -579,7 +579,7 @@ class BackAndForth(Scene): self.play(ShowCreation(plane, run_time = 3)) self.play(Write(triplet)) # self.play(ShowCreation(triplet.arrow)) - self.dither(3) + self.wait(3) for tup, eq, to_draw in (pair, circle_eq, circle), (triplet, sphere_eq, VMobject()): for mob in tup, eq: mob.xyz = VGroup(*filter( @@ -598,7 +598,7 @@ class BackAndForth(Scene): ))), ShowCreation(to_draw) ) - self.dither(3) + self.wait(3) class SphereForming(ExternallyAnimatedScene): pass @@ -616,10 +616,10 @@ class PreviousVideos(Scene): title = titles[0] self.add(title, screen) - self.dither(2) + self.wait(2) for new_title in titles[1:]: self.play(Transform(title, new_title)) - self.dither(2) + self.wait(2) class TODOTease(TODOStub): CONFIG = { @@ -639,12 +639,12 @@ class AskAboutLongerLists(TeacherStudentsScene): ]) self.student_says(question, run_time = 1) - self.dither() + self.wait() for alt_tup in alt_tups: alt_tup.move_to(tup) self.play(Transform(tup, alt_tup)) - self.dither() - self.dither() + self.wait() + self.wait() self.play( RemovePiCreatureBubble(self.students[1]), self.teacher.change, "raise_right_hand" @@ -654,13 +654,13 @@ class AskAboutLongerLists(TeacherStudentsScene): look_at_arg = self.teacher.get_top() + 2*UP ) self.play(self.teacher.look, UP) - self.dither(5) + self.wait(5) self.student_says( "I...don't see it.", target_mode = "maybe", student_index = 0 ) - self.dither(3) + self.wait(3) class FourDCubeRotation(ExternallyAnimatedScene): pass @@ -691,7 +691,7 @@ class Professionals(PiCreatureScene): FadeIn(pi), Write(title, run_time = 1), ) - self.dither() + self.wait() def add_equation(self): quaternion = TexMobject( @@ -730,7 +730,7 @@ class Professionals(PiCreatureScene): Write(term, run_time = 1), pi.change, "pondering", term ) - self.dither(2) + self.wait(2) self.terms = terms @@ -760,8 +760,8 @@ class Professionals(PiCreatureScene): Write(label, run_time = 1) ) example.add(label) - self.dither() - self.dither() + self.wait() + self.wait() self.play( FadeOut(examples), self.terms.shift, UP, @@ -779,9 +779,9 @@ class Professionals(PiCreatureScene): np.linspace(0, 0.5, len(self.pi_creatures)) ) ]) - self.dither() + self.wait() self.play(Animation(self.terms[-1])) - self.dither(2) + self.wait(2) ###### @@ -819,13 +819,13 @@ class OfferAHybrid(SliderScene): equation.target.shift(2*SPACE_WIDTH*LEFT/3) self.add(titles, h_line, v_lines, equation) - self.dither() + self.wait() self.play(*map(MoveToTarget, [titles, v_lines, equation])) self.play(Write(self.sliders, run_time = 1)) self.initialize_ambiant_slider_movement() - self.dither(10) + self.wait(10) self.wind_down_ambient_movement() - self.dither() + self.wait() def get_titles(self): titles = VGroup(*map(TextMobject, [ @@ -885,7 +885,7 @@ class DismissProjection(PiCreatureScene): Write(equation), LaggedStart(ShowCreation, sphere), ) - self.dither() + self.wait() self.equations = equations self.spheres = spheres @@ -938,15 +938,15 @@ class DismissProjection(PiCreatureScene): ), run_time = 3, ) - self.dither() + self.wait() self.play(Write(descriptor, run_time = 2)) - self.dither() + self.wait() self.play( dot.move_to, equation.get_left(), dot.set_fill, None, 0, path_arc = -np.pi/12 ) - self.dither(2) + self.wait(2) self.sphere_words = sphere_words self.sphere_arrow = arrow @@ -962,22 +962,22 @@ class DismissProjection(PiCreatureScene): self.play(FadeIn(morty)) self.play(morty.change, "raise_right_hand", sphere) - self.dither(3) + self.wait(3) self.play(morty.change, "confused", sphere) - self.dither(3) + self.wait(3) self.play( morty.change, "erm", alt_dims, FadeIn(alt_dim) ) for new_alt_dim in alt_dims[1:]: - self.dither() + self.wait() self.play(Transform(alt_dim, new_alt_dim)) - self.dither() + self.wait() self.play(morty.change, "concerned_musician") self.play(FadeOut(alt_dim)) - self.dither() + self.wait() self.play(morty.change, "angry", sphere) - self.dither(2) + self.wait(2) def transition_to_next_scene(self): equation = self.equations[-1] @@ -998,7 +998,7 @@ class DismissProjection(PiCreatureScene): self.pi_creature ]))) self.play(*map(MoveToTarget, [equation, tup])) - self.dither() + self.wait() ### @@ -1044,7 +1044,7 @@ class Introduce4DSliders(SliderScene): self.sliders.shift(0.8*LEFT) self.add(equation, tup) - self.dither() + self.wait() self.equation = equation self.tup = tup @@ -1073,7 +1073,7 @@ class Introduce4DSliders(SliderScene): dials.set_fill(opacity = 1) self.initialize_ambiant_slider_movement() self.play(FadeOut(self.tup)) - self.dither(10) + self.wait(10) def ask_about_constraint(self): equation = self.equation @@ -1084,12 +1084,12 @@ class Introduce4DSliders(SliderScene): self.play(ShowCreation(rect)) self.play(FadeIn(randy)) self.play(randy.change, "pondering", rect) - self.dither() + self.wait() for mob in self.sliders, rect: self.play(randy.look_at, mob) self.play(Blink(randy)) - self.dither() - self.dither() + self.wait() + self.wait() class TwoDimensionalCase(Introduce4DSliders): CONFIG = { @@ -1144,7 +1144,7 @@ class TwoDimensionalCase(Introduce4DSliders): def let_values_wander(self, total_time = 5): self.initialize_ambiant_slider_movement() - self.dither(total_time - 1) + self.wait(total_time - 1) self.wind_down_ambient_movement() def introduce_real_estate(self): @@ -1182,7 +1182,7 @@ class TwoDimensionalCase(Introduce4DSliders): ShowCreation(arrow), Write(decimal) ) - self.dither() + self.wait() sliders = self.sliders def create_update_func(i): @@ -1218,9 +1218,9 @@ class TwoDimensionalCase(Introduce4DSliders): blue_rects.save_state() self.play(DrawBorderThenFill(blue_rects)) - self.dither() + self.wait() self.play(ReplacementTransform(blue_rects, red_rects)) - self.dither() + self.wait() self.play(FadeOut(red_rects)) blue_rects.restore() @@ -1231,11 +1231,11 @@ class TwoDimensionalCase(Introduce4DSliders): rect = SurroundingRectangle(x_re) self.reset_dials([1, 0]) - self.dither() + self.wait() self.play(ShowCreation(rect)) self.play(FadeOut(rect)) self.play(FocusOn(self.dot)) - self.dither() + self.wait() self.reset_dials([0.9, -np.sqrt(0.19)]) x_brace, y_brace = [ @@ -1255,18 +1255,18 @@ class TwoDimensionalCase(Introduce4DSliders): self.play(ReplacementTransform( VGroup(x_text.copy()), x_re )) - self.dither(2) + self.wait(2) self.play( GrowFromCenter(y_brace), Write(y_text), ) - self.dither(2) + self.wait(2) self.play(FadeIn(self.real_estate_rects)) self.reset_dials([1, 0], run_time = 1) self.reset_dials([0.9, -np.sqrt(0.19)], run_time = 2) self.play(FadeOut(self.real_estate_rects)) self.play(*map(FadeOut, [x_brace, y_brace, x_text, y_text])) - self.dither() + self.wait() def note_circle_steepness(self): line = Line( @@ -1303,15 +1303,15 @@ class TwoDimensionalCase(Introduce4DSliders): Animation(VGroup(*[slider.dial for slider in self.sliders])), ) self.add_foreground_mobjects(self.sliders) - self.dither() + self.wait() for x in np.arange(0.95, 0.05, -0.05): self.reset_dials( [np.sqrt(x), np.sqrt(1-x)], run_time = 0.5 ) - self.dither(0.5) + self.wait(0.5) self.initialize_ambiant_slider_movement() - self.dither(10) + self.wait(10) def write_distance_squared(self): d_squared = TexMobject("(\\text{Distance})^2") @@ -1319,7 +1319,7 @@ class TwoDimensionalCase(Introduce4DSliders): d_squared.highlight(YELLOW) self.play(Write(d_squared)) - self.dither(3) + self.wait(3) ##### @@ -1335,7 +1335,7 @@ class TwoDimensionalCase(Introduce4DSliders): class TwoDimensionalCaseIntro(TwoDimensionalCase): def construct(self): self.initialize_ambiant_slider_movement() - self.dither(10) + self.wait(10) class ThreeDCase(TwoDimensionalCase): CONFIG = { @@ -1361,7 +1361,7 @@ class ThreeDCase(TwoDimensionalCase): self.add_real_estate_decimals() self.initialize_ambiant_slider_movement() self.point_out_third_slider() - self.dither(3) + self.wait(3) self.hold_x_at(0.5, 12) self.revert_to_original_skipping_status() self.hold_x_at(0.85, 12) @@ -1411,10 +1411,10 @@ class ThreeDCase(TwoDimensionalCase): def point_out_third_slider(self): rect = SurroundingRectangle(self.sliders[-1]) - self.dither(4) + self.wait(4) self.play(ShowCreation(rect)) self.play(FadeOut(rect)) - self.dither(8) + self.wait(8) def hold_x_at(self, x_val, wait_time): #Save these @@ -1425,7 +1425,7 @@ class ThreeDCase(TwoDimensionalCase): self.sliders = VGroup(*self.sliders[1:]) self.total_real_estate = self.total_real_estate-x_val**2 self.initialize_ambiant_slider_movement() - self.dither(wait_time-2) + self.wait(wait_time-2) self.wind_down_ambient_movement() self.sliders = all_sliders self.total_real_estate = original_total_real_estate @@ -1438,7 +1438,7 @@ class ThreeDCaseInsert(ThreeDCase): self.add_real_estate_decimals() self.reset_dials([0.85, np.sqrt(1-0.85**2)], run_time = 0) self.reset_dials([1], run_time = 3) - self.dither() + self.wait() class SphereAtRest(ExternallyAnimatedScene): pass @@ -1446,7 +1446,7 @@ class SphereAtRest(ExternallyAnimatedScene): class BugOnASurface(TeacherStudentsScene): def construct(self): self.teacher_says("You're a bug \\\\ on a surface") - self.dither(3) + self.wait(3) class SphereWithWanderingDotAtX0point5(ExternallyAnimatedScene): pass @@ -1476,7 +1476,7 @@ class BugOnTheSurfaceSlidersPart(ThreeDCase): np.sin(u)*np.cos(t), np.sin(u)*np.sin(t), ]) - self.dither(self.frame_duration) + self.wait(self.frame_duration) class BugOnTheSurfaceSpherePart(ExternallyAnimatedScene): pass @@ -1500,7 +1500,7 @@ class FourDCase(SliderScene, TeacherStudentsScene): dot = Dot(fill_opacity = 0) dot.to_corner(UP+LEFT, buff = 2) self.play(Animation(dot)) - self.dither() + self.wait() self.play( Animation(self.sliders), self.teacher.change, "raise_right_hand", @@ -1509,12 +1509,12 @@ class FourDCase(SliderScene, TeacherStudentsScene): *["pondering"]*3, look_at_arg = self.sliders ) - self.dither(4) + self.wait(4) def fix_one_slider(self): x_slider = self.sliders[0] dial = x_slider.dial - self.wind_down_ambient_movement(dither = False) + self.wind_down_ambient_movement(wait = False) self.play(self.teacher.change, "speaking") self.sliders.remove(x_slider) self.total_real_estate = np.linalg.norm(self.get_vector())**2 @@ -1530,7 +1530,7 @@ class FourDCase(SliderScene, TeacherStudentsScene): look_at_arg = self.sliders, added_anims = [self.teacher.change, "plain"] ) - self.dither(5) + self.wait(5) self.x_slider = x_slider self.x_arrow = arrow @@ -1546,7 +1546,7 @@ class FourDCase(SliderScene, TeacherStudentsScene): None, "pondering", "pondering", look_at_arg = self.students[0].bubble, ) - self.dither(4) + self.wait(4) self.play(RemovePiCreatureBubble(self.students[0])) def set_aside_sliders(self): @@ -1562,11 +1562,11 @@ class FourDCase(SliderScene, TeacherStudentsScene): "Time for some \\\\ high-dimensional \\\\ strangeness!", target_mode = "hooray", ) - self.dither(7) + self.wait(7) ##### - def non_blink_dither(self, time = 1): - SliderScene.dither(self, time) + def non_blink_wait(self, time = 1): + SliderScene.wait(self, time) class TwoDBoxExample(Scene): def setup(self): @@ -1592,7 +1592,7 @@ class TwoDBoxExample(Scene): ) box.replace(line, stretch = True) self.play(ShowCreation(box)) - self.dither() + self.wait() def label_corner_coordinates(self): corner_dots = VGroup() @@ -1651,9 +1651,9 @@ class TwoDBoxExample(Scene): run_time = 1, rate_func = smooth, )) - self.dither(0.5) + self.wait(0.5) self.play(*map(FadeOut, [radius, r_equals_1])) - self.dither() + self.wait() self.corner_radius = radius self.corner_circles = circles @@ -1676,7 +1676,7 @@ class TwoDBoxExample(Scene): self.play(circle.scale, 1.2, rate_func = wiggle) self.play(ShowCreation(radius)) self.play(Write(r_equals_q)) - self.dither(2) + self.wait(2) self.play(FadeOut(r_equals_q[1])) self.inner_radius = radius @@ -1730,13 +1730,13 @@ class TwoDBoxExample(Scene): FadeIn(triangle), Write(VGroup(bottom_one, side_one, sqrt_1_plus_1)) ) - self.dither(2) + self.wait(2) self.play(ReplacementTransform(sqrt_1_plus_1, sqrt_2)) self.play( Write(root_2_value, run_time = 1), *map(FadeOut, [bottom_one, side_one]) ) - self.dither() + self.wait() self.play(ShowCreation(corner_radius)) self.play(Rotating( corner_radius, about_point = c0_center, @@ -1744,13 +1744,13 @@ class TwoDBoxExample(Scene): rate_func = smooth )) self.play(FadeOut(triangle), Animation(corner_radius)) - self.dither() + self.wait() self.play( Write(rhs), Transform(sqrt_2, sqrt_2_target), ) self.play(Write(root_2_minus_1_value)) - self.dither(2) + self.wait(2) class ThreeDBoxExample(ExternallyAnimatedScene): pass @@ -1770,7 +1770,7 @@ class ThreeDCubeCorners(Scene): self.play(Write(name, run_time = 2)) self.play(LaggedStart(FadeIn, coordinates, run_time = 3)) - self.dither() + self.wait() class ShowDistanceFormula(TeacherStudentsScene): def construct(self): @@ -1799,10 +1799,10 @@ class ShowDistanceFormula(TeacherStudentsScene): rule.restore, self.teacher.change, "raise_right_hand", ) - self.dither(3) + self.wait(3) self.student_says("Why?", student_index = 0) self.play(self.teacher.change, "thinking") - self.dither(3) + self.wait(3) class GeneralizePythagoreanTheoremBeyondTwoD(ThreeDScene): def construct(self): @@ -1845,7 +1845,7 @@ class GeneralizePythagoreanTheoremBeyondTwoD(ThreeDScene): ShowCreation(line), Write(tex, run_time = 1) ) - self.dither() + self.wait() self.play( group.rotate, 0.45*np.pi, LEFT, group.shift, 2*DOWN @@ -1867,7 +1867,7 @@ class GeneralizePythagoreanTheoremBeyondTwoD(ThreeDScene): Write(z, run_time = 1) ) self.play(ShowCreation(three_d_diag)) - self.dither() + self.wait() full_group = VGroup(group, z_line, z, three_d_diag, dot) self.play(Rotating( @@ -1875,7 +1875,7 @@ class GeneralizePythagoreanTheoremBeyondTwoD(ThreeDScene): axis = UP, run_time = 10, )) - self.dither() + self.wait() class ThreeDBoxFormulas(Scene): def construct(self): @@ -1897,11 +1897,11 @@ class ThreeDBoxFormulas(Scene): VGroup(question, answer).shift(0.55*RIGHT) self.play(Write(question)) - self.dither(2) + self.wait(2) self.play(ReplacementTransform(question, answer)) - self.dither(2) + self.wait(2) self.play(Write(inner_r)) - self.dither(2) + self.wait(2) class AskAboutHigherDimensions(TeacherStudentsScene): def construct(self): @@ -1909,16 +1909,16 @@ class AskAboutHigherDimensions(TeacherStudentsScene): "What happens for \\\\ higher dimensions?" ) self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) self.student_thinks( "$\\sqrt{N} - 1$", target_mode = "happy", student_index = 1 ) - self.dither() + self.wait() pi = self.students[1] self.play(pi.change, "confused", pi.bubble) - self.dither(3) + self.wait(3) class TenSliders(SliderScene): CONFIG = { @@ -1929,7 +1929,7 @@ class TenSliders(SliderScene): } def construct(self): self.initialize_ambiant_slider_movement() - self.dither(self.run_time) + self.wait(self.run_time) self.wind_down_ambient_movement() class TwoDBoxWithSliders(TwoDimensionalCase): @@ -1996,7 +1996,7 @@ class TwoDBoxWithSliders(TwoDimensionalCase): self.initialize_ambiant_slider_movement() self.play(Write(question)) - self.dither(4) + self.wait(4) self.wind_down_ambient_movement() self.question = question @@ -2020,7 +2020,7 @@ class TwoDBoxWithSliders(TwoDimensionalCase): for x, slider in zip(self.center_point, self.sliders): slider.center_value = x self.initialize_ambiant_slider_movement() - self.dither(7) + self.wait(7) self.wind_down_ambient_movement() self.play( self.circle.move_to, @@ -2040,7 +2040,7 @@ class TwoDBoxWithSliders(TwoDimensionalCase): slider.center_value = x self.initialize_ambiant_slider_movement() - self.dither(5) + self.wait(5) def write_x_and_y_real_estate(self): phrases = VGroup( @@ -2062,13 +2062,13 @@ class TwoDBoxWithSliders(TwoDimensionalCase): Write(phrases[0]), GrowFromCenter(x_brace) ) - self.dither(3) + self.wait(3) self.play( Transform(*phrases), Transform(x_brace, y_brace) ) - self.dither(5) - self.wind_down_ambient_movement(dither = False) + self.wait(5) + self.wind_down_ambient_movement(wait = False) self.play(*map(FadeOut, [x_brace, phrases[0]])) def swap_with_top_right_circle(self): @@ -2090,7 +2090,7 @@ class TwoDBoxWithSliders(TwoDimensionalCase): slider.center_value = 1 self.center_point[1] = 1 self.initialize_ambiant_slider_movement() - self.dither(3) + self.wait(3) def show_center_circle(self): origin = self.plane.coords_to_point(0, 0) @@ -2102,7 +2102,7 @@ class TwoDBoxWithSliders(TwoDimensionalCase): self.play(FocusOn(circle)) self.play(GrowFromCenter(circle, run_time = 2)) - self.dither(3) + self.wait(3) def describe_tangent_point(self): target_vector = np.array([ @@ -2114,11 +2114,11 @@ class TwoDBoxWithSliders(TwoDimensionalCase): v_line = Line(point[0]*RIGHT+origin[1]*UP, point) while np.linalg.norm(self.get_vector()-target_vector) > 0.5: - self.dither() + self.wait() self.wind_down_ambient_movement(0) self.reset_dials(target_vector) self.play(*map(ShowCreation, [h_line, v_line])) - self.dither() + self.wait() re_line = DashedLine( self.sliders[0].dial.get_left() + MED_SMALL_BUFF*LEFT, @@ -2129,7 +2129,7 @@ class TwoDBoxWithSliders(TwoDimensionalCase): words.next_to(re_line, RIGHT) self.play(ShowCreation(re_line)) self.play(Write(words)) - self.dither() + self.wait() self.evenly_shared_words = words self.re_line = re_line @@ -2148,7 +2148,7 @@ class TwoDBoxWithSliders(TwoDimensionalCase): self.add_foreground_mobjects(ghost_dials) self.reset_dials(target_vector) - self.dither() + self.wait() #Comment on real estate exchange x_words = TextMobject("Gain expensive \\\\", "real estate") @@ -2173,13 +2173,13 @@ class TwoDBoxWithSliders(TwoDimensionalCase): Write(x_words, run_time = 2), ShowCreation(x_arrow) ) - self.dither() + self.wait() self.play(FadeOut(self.evenly_shared_words)) self.play( Write(y_words, run_time = 2), ShowCreation(y_arrow) ) - self.dither(2) + self.wait(2) #Swap perspective word_starts = VGroup(y_words[0], x_words[0]) @@ -2199,13 +2199,13 @@ class TwoDBoxWithSliders(TwoDimensionalCase): ) for slider in self.sliders ]) - self.dither() + self.wait() self.play(ShowCreation(crosses)) self.play( LaggedStart(MoveToTarget, new_words), Animation(crosses) ) - self.dither(3) + self.wait(3) #Return to original position target_vector = np.array(2*[1-np.sqrt(0.5)]) @@ -2222,11 +2222,11 @@ class TwoDBoxWithSliders(TwoDimensionalCase): slider.center_value = x self.set_to_vector(target_vector) self.total_real_estate = self.get_current_total_real_estate() - self.dither(2) + self.wait(2) def wander_on_inner_circle(self): self.initialize_ambiant_slider_movement() - self.dither(9) + self.wait(9) def ask_about_inner_real_estate(self): question = TextMobject("What is \\\\ $x^2 + y^2$?") @@ -2247,18 +2247,18 @@ class TwoDBoxWithSliders(TwoDimensionalCase): target_vector = np.array(2*[1-np.sqrt(0.5)]) while np.linalg.norm(target_vector - self.get_vector()) > 0.5: - self.dither() + self.wait() self.wind_down_ambient_movement(0) self.reset_dials(target_vector) self.play(Write(question)) - self.dither(3) + self.wait(3) self.play( ShowCreation(half_line), Write(half) ) - self.dither() + self.wait() self.play(Write(rhs)) - self.dither(3) + self.wait(3) class AskWhy(TeacherStudentsScene): def construct(self): @@ -2266,7 +2266,7 @@ class AskWhy(TeacherStudentsScene): "Wait, why?", target_mode = "confused" ) - self.dither(3) + self.wait(3) class MentionComparisonToZeroPointFive(TeacherStudentsScene): def construct(self): @@ -2276,7 +2276,7 @@ class MentionComparisonToZeroPointFive(TeacherStudentsScene): target_mode = "hooray" ) self.change_student_modes(*["happy"]*3) - self.dither(3) + self.wait(3) class ThreeDBoxExampleWithSliders(SliderScene): CONFIG = { @@ -2317,7 +2317,7 @@ class ThreeDBoxExampleWithSliders(SliderScene): ShowCreation(arrow, rate_func = squish_rate_func(smooth, 0.7, 1)), run_time = 3 ) - self.dither(5) + self.wait(5) self.sphere_name = sphere_name self.arrow = arrow @@ -2350,7 +2350,7 @@ class ThreeDBoxExampleWithSliders(SliderScene): Transform(self.arrow, new_arrow), ) self.play(LaggedStart(FadeIn, re_words)) - self.dither(2) + self.wait(2) self.re_words = re_words self.re_line = re_line @@ -2383,7 +2383,7 @@ class ThreeDBoxExampleWithSliders(SliderScene): Write(half_label, run_time = 1), ShowCreation(half_line) ) - self.dither() + self.wait() self.add(ghost_dials) self.play(*[ ApplyMethod(slider.set_value, 0.5) @@ -2391,7 +2391,7 @@ class ThreeDBoxExampleWithSliders(SliderScene): ]) self.play(ShowCreation(cross)) self.play(Write(new_re)) - self.dither(3) + self.wait(3) self.play( FadeOut(new_re), FadeOut(cross), @@ -2430,7 +2430,7 @@ class ThreeDBoxExampleWithSliders(SliderScene): ) self.initialize_ambiant_slider_movement() self.play(Write(inner_sphere_words)) - self.dither(5) + self.wait(5) self.wind_down_ambient_movement(0) self.play(*[ ApplyMethod(slider.set_value, x) @@ -2439,7 +2439,7 @@ class ThreeDBoxExampleWithSliders(SliderScene): self.play(ReplacementTransform( inner_sphere_words, question )) - self.dither(2) + self.wait(2) self.re_question = question @@ -2452,11 +2452,11 @@ class ThreeDBoxExampleWithSliders(SliderScene): bound.to_edge(RIGHT) self.play(Write(bound)) - self.dither(2) + self.wait(2) def comment_on_inner_sphere_smallness(self): self.initialize_ambiant_slider_movement() - self.dither(15) + self.wait(15) class Rotating3DCornerSphere(ExternallyAnimatedScene): pass @@ -2496,7 +2496,7 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders): self.play(Write(title)) self.play(LaggedStart(FadeIn, coordinate_mobs)) - self.dither() + self.wait() self.coordinate_mobs = coordinate_mobs self.coordinates = coordinates @@ -2522,7 +2522,7 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders): self.sliders[0].number_to_point(coords[0]+1) ) self.add(coord_mob_copy) - self.dither() + self.wait() self.remove(coord_mob_copy) coord_mob.highlight(WHITE) self.add(coord_mob_copy) @@ -2537,7 +2537,7 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders): ]) ) self.initialize_ambiant_slider_movement() - self.dither(4) + self.wait(4) def show_closest_point(self): target_vector = 0.5*np.ones(4) @@ -2557,7 +2557,7 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders): ]) self.play(ShowCreation(re_line)) self.play(Write(half_label)) - self.dither(2) + self.wait(2) self.re_line = re_line self.half_label = half_label @@ -2584,7 +2584,7 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders): self.play(FadeIn(re_words)) self.play(LaggedStart(DrawBorderThenFill, re_rects, run_time = 3)) - self.dither(2) + self.wait(2) self.re_words = re_words self.re_rects = re_rects @@ -2612,23 +2612,23 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders): self.re_words.next_to, sphere_words.target, UP, MED_LARGE_BUFF, path_arc = np.pi ) - self.dither(2) + self.wait(2) re_shift_vect = 0.5*self.sliders[0].unit_size*DOWN self.play(LaggedStart( ApplyMethod, self.re_rects, lambda m : (m.shift, re_shift_vect), path_arc = np.pi )) - self.dither() + self.wait() re_words_rect = SurroundingRectangle(self.re_words) self.play(ShowCreation(re_words_rect)) - self.dither() + self.wait() self.play(FadeOut(re_words_rect)) - self.dither() + self.wait() self.set_center_point(np.zeros(4)) self.initialize_ambiant_slider_movement() - self.dither(4) + self.wait(4) def compute_inner_radius_numerically(self): computation = TexMobject( @@ -2649,7 +2649,7 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders): self.play(LaggedStart(FadeIn, computation, run_time = 3)) self.play(GrowFromCenter(brace)) self.play(Write(brace_text, run_time = 2)) - self.dither(16) + self.wait(16) computation.add(brace, brace_text) self.computation = computation @@ -2664,12 +2664,12 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders): arrow.highlight(BLUE) arrow.shift(touching_words.get_bottom()) - self.wind_down_ambient_movement(dither = False) + self.wind_down_ambient_movement(wait = False) self.play(FadeOut(self.computation)) self.reset_dials([1]) self.play(Write(touching_words)) self.play(ShowCreation(arrow)) - self.dither(2) + self.wait(2) class TwoDInnerSphereTouchingBox(TwoDBoxWithSliders, PiCreatureScene): def setup(self): @@ -2699,7 +2699,7 @@ class TwoDInnerSphereTouchingBox(TwoDBoxWithSliders, PiCreatureScene): ShowCreation(little_inner_circle), randy.change, "pondering", little_inner_circle ) - self.dither() + self.wait() self.play( ReplacementTransform( little_inner_circle.copy(), big_inner_circle @@ -2710,16 +2710,16 @@ class TwoDInnerSphereTouchingBox(TwoDBoxWithSliders, PiCreatureScene): big_inner_circle.save_state() self.play(big_inner_circle.move_to, self.circle) self.play(big_inner_circle.restore) - self.dither() + self.wait() self.play(LaggedStart( DrawBorderThenFill, tangency_points, rate_func = double_smooth )) self.play(randy.change, "maybe") self.play(randy.look_at, self.circle) - self.dither() + self.wait() self.play(randy.look_at, little_inner_circle) - self.dither() + self.wait() #### @@ -2769,7 +2769,7 @@ class FiveDBoxExampleWithSliders(FourDBoxExampleWithSliders): self.sliders[0].number_to_point(coords[0]+1) ) self.add(coords_mob) - self.dither(0.25) + self.wait(0.25) self.remove(coords_mob) self.add(coords_mob) sphere_words.add(coords_mob) @@ -2777,7 +2777,7 @@ class FiveDBoxExampleWithSliders(FourDBoxExampleWithSliders): self.initialize_ambiant_slider_movement() self.play(FadeOut(n_sphere_words)) - self.dither(3) + self.wait(3) def show_closest_point(self): target_x = 1-np.sqrt(0.2) @@ -2812,7 +2812,7 @@ class FiveDBoxExampleWithSliders(FourDBoxExampleWithSliders): DrawBorderThenFill, re_rects, rate_func = double_smooth )) - self.dither() + self.wait() self.re_rects = re_rects self.re_words = re_words @@ -2843,14 +2843,14 @@ class FiveDBoxExampleWithSliders(FourDBoxExampleWithSliders): Write(half_label), ShowCreation(half_line) ) - self.dither(2) + self.wait(2) self.add(ghost_dials) self.play(*[ ApplyMethod(slider.set_value, 0.5) for slider in self.sliders ]) self.play(Transform(self.re_words[0], point_25)) - self.dither(2) + self.wait(2) self.play(*[ ApplyMethod(slider.set_value, x) for x, slider in zip(curr_vector, self.sliders) @@ -2904,12 +2904,12 @@ class FiveDBoxExampleWithSliders(FourDBoxExampleWithSliders): ), MoveToTarget(self.re_words), ) - self.dither(2) + self.wait(2) self.set_center_point(np.zeros(5)) self.total_real_estate = (np.sqrt(5)-1)**2 self.initialize_ambiant_slider_movement() - self.dither(12) + self.wait(12) def compute_radius(self): computation = TexMobject( @@ -2919,7 +2919,7 @@ class FiveDBoxExampleWithSliders(FourDBoxExampleWithSliders): computation.to_corner(UP+LEFT) self.play(Write(computation, run_time = 2)) - self.dither(12) + self.wait(12) def poke_out_of_box(self): self.wind_down_ambient_movement(0) @@ -2939,7 +2939,7 @@ class FiveDBoxExampleWithSliders(FourDBoxExampleWithSliders): ShowCreation(arrow), Write(words) ) - self.dither(2) + self.wait(2) class SkipAheadTo10(TeacherStudentsScene): def construct(self): @@ -2950,7 +2950,7 @@ class SkipAheadTo10(TeacherStudentsScene): self.change_student_modes( "pleading", "confused", "horrified" ) - self.dither(3) + self.wait(3) class TenDBoxExampleWithSliders(FiveDBoxExampleWithSliders): CONFIG = { @@ -2973,7 +2973,7 @@ class TenDBoxExampleWithSliders(FiveDBoxExampleWithSliders): def initial_wandering(self): self.initialize_ambiant_slider_movement() - self.dither(9) + self.wait(9) def show_closest_point(self): target_x = 1-np.sqrt(1./self.n_sliders) @@ -3001,7 +3001,7 @@ class TenDBoxExampleWithSliders(FiveDBoxExampleWithSliders): DrawBorderThenFill, re_rects, rate_func = double_smooth )) - self.dither(2) + self.wait(2) self.re_line = re_line self.re_rects = re_rects @@ -3037,12 +3037,12 @@ class TenDBoxExampleWithSliders(FiveDBoxExampleWithSliders): path_arc = np.pi ), ) - self.dither(2) + self.wait(2) self.set_center_point(np.zeros(self.n_sliders)) self.total_real_estate = (np.sqrt(self.n_sliders)-1)**2 self.initialize_ambiant_slider_movement() - self.dither(5) + self.wait(5) def compute_inner_radius_numerically(self): computation = TexMobject( @@ -3054,7 +3054,7 @@ class TenDBoxExampleWithSliders(FiveDBoxExampleWithSliders): self.play(Write(computation, run_time = 2)) def wander_on_inner_sphere(self): - self.dither(10) + self.wait(10) def poke_outside_outer_box(self): self.wind_down_ambient_movement() @@ -3076,7 +3076,7 @@ class TenDBoxExampleWithSliders(FiveDBoxExampleWithSliders): Write(words, run_time = 2), ShowCreation(arrow) ) - self.dither(3) + self.wait(3) class TwoDOuterBox(TwoDInnerSphereTouchingBox): def construct(self): @@ -3096,7 +3096,7 @@ class TwoDOuterBox(TwoDInnerSphereTouchingBox): ShowCreation(box), self.randy.change, "pondering", ) - self.dither(3) + self.wait(3) self.outer_box = box @@ -3114,7 +3114,7 @@ class ThreeDOuterBoundingBoxWords(Scene): words.highlight(MAROON_B) self.play(Write(words)) - self.dither(4) + self.wait(4) class FaceDistanceDoesntDependOnDimension(TwoDOuterBox): def construct(self): @@ -3140,7 +3140,7 @@ class FaceDistanceDoesntDependOnDimension(TwoDOuterBox): ShowCreation(arrow) ) self.play(self.randy.change, "thinking") - self.dither(3) + self.wait(3) class TenDCornerIsVeryFarAway(TenDBoxExampleWithSliders): CONFIG = { @@ -3179,13 +3179,13 @@ class TenDCornerIsVeryFarAway(TenDBoxExampleWithSliders): ), run_time = 10, ) - self.dither() + self.wait() class InnerRadiusIsUnbounded(TeacherStudentsScene): def construct(self): self.teacher_says("Inner radius \\\\ is unbounded") self.change_student_modes(*["erm"]*3) - self.dither(3) + self.wait(3) class ProportionOfSphereInBox(GraphScene): CONFIG = { @@ -3230,9 +3230,9 @@ class ProportionOfSphereInBox(GraphScene): footnote.highlight(YELLOW) self.play(ShowCreation(graph, run_time = 5, rate_func = None)) - self.dither() + self.wait() self.add(footnote) - self.dither(0.25) + self.wait(0.25) class ShowingToFriend(PiCreatureScene, SliderScene): CONFIG = { @@ -3253,11 +3253,11 @@ class ShowingToFriend(PiCreatureScene, SliderScene): morty, randy = self.morty, self.randy self.play(morty.change, "raise_right_hand", self.sliders) self.play(randy.change, "happy", self.sliders) - self.dither(7) + self.wait(7) self.play(randy.change, "skeptical", morty.eyes) - self.dither(3) + self.wait(3) self.play(randy.change, "thinking", self.sliders) - self.dither(6) + self.wait(6) ### @@ -3268,8 +3268,8 @@ class ShowingToFriend(PiCreatureScene, SliderScene): self.randy.to_edge(DOWN).shift(4*LEFT) return VGroup(self.morty, self.randy) - def non_blink_dither(self, time = 1): - SliderScene.dither(self, time) + def non_blink_wait(self, time = 1): + SliderScene.wait(self, time) class QuestionsFromStudents(TeacherStudentsScene): def construct(self): @@ -3278,25 +3278,25 @@ class QuestionsFromStudents(TeacherStudentsScene): target_mode = "sassy", run_time = 2, ) - self.dither() + self.wait() self.teacher_says( "No less real \\\\ than reals", target_mode = "shruggie", content_introduction_class = FadeIn, ) - self.dither(2) + self.wait(2) self.student_says( "How do you think \\\\ about volume?", student_index = 0, content_introduction_class = FadeIn, ) - self.dither() + self.wait() self.student_says( "How do cubes work?", student_index = 2, run_time = 2, ) - self.dither(2) + self.wait(2) class FunHighDSpherePhenomena(Scene): def construct(self): @@ -3322,7 +3322,7 @@ class FunHighDSpherePhenomena(Scene): for item in items: self.play(LaggedStart(FadeIn, item, run_time = 2)) - self.dither() + self.wait() class TODOBugOnSurface(TODOStub): CONFIG = { @@ -3354,7 +3354,7 @@ class CoordinateFree(PiCreatureScene): target_mode = "hooray" )) self.play(FadeOut(plane, run_time = 2)) - self.dither(3) + self.wait(3) class Skeptic(TeacherStudentsScene, SliderScene): def setup(self): @@ -3397,7 +3397,7 @@ class Skeptic(TeacherStudentsScene, SliderScene): target_mode = "sassy", added_anims = [self.teacher.change, "guilty"] ) - self.dither(2) + self.wait(2) equation.remove(*variables) self.play(ReplacementTransform(variables, slider_labels)) self.play( @@ -3406,7 +3406,7 @@ class Skeptic(TeacherStudentsScene, SliderScene): self.students[0], target_mode = "hesitant" ), ) - self.dither(4) + self.wait(4) bubble = self.teacher.get_bubble( "It's much \\\\ more playful!", bubble_class = SpeechBubble @@ -3418,7 +3418,7 @@ class Skeptic(TeacherStudentsScene, SliderScene): ShowCreation(bubble), Write(bubble.content) ) - self.dither(3) + self.wait(3) self.play( RemovePiCreatureBubble( self.teacher, target_mode = "raise_right_hand", @@ -3441,11 +3441,11 @@ class Skeptic(TeacherStudentsScene, SliderScene): self.teacher.change, "happy" ) self.play(ShowCreation(line)) - self.dither(3) + self.wait(3) ##### - def non_blink_dither(self, time = 1): - SliderScene.dither(self, time) + def non_blink_wait(self, time = 1): + SliderScene.wait(self, time) class ClipFrom4DBoxExampleTODO(TODOStub): CONFIG = { @@ -3467,7 +3467,7 @@ class JustBecauseYouCantVisualize(Scene): FadeIn, part, run_time = 0.05*len(part) )) - self.dither(2) + self.wait(2) class Announcements(TeacherStudentsScene): def construct(self): @@ -3493,7 +3493,7 @@ class Announcements(TeacherStudentsScene): for pi in self.pi_creatures ]) self.play(Write(items[1], run_time = 2)) - self.dither(2) + self.wait(2) class Promotion(PiCreatureScene): CONFIG = { @@ -3513,15 +3513,15 @@ class Promotion(PiCreatureScene): self.pi_creature.change, "raise_right_hand" ) self.play(ShowCreation(rect)) - self.dither(2) + self.wait(2) self.change_mode("thinking") - self.dither() + self.wait() self.look_at(url) - self.dither(10) + self.wait(10) self.change_mode("happy") - self.dither(10) + self.wait(10) self.change_mode("raise_right_hand") - self.dither(10) + self.wait(10) self.remove(rect) self.play( @@ -3530,7 +3530,7 @@ class Promotion(PiCreatureScene): url_rect = SurroundingRectangle(url) self.play(ShowCreation(url_rect)) self.play(FadeOut(url_rect)) - self.dither(3) + self.wait(3) class BrilliantGeometryQuiz(ExternallyAnimatedScene): pass @@ -3556,12 +3556,12 @@ class Podcast(TeacherStudentsScene): ), Write(title) ) - self.dither(5) + self.wait(5) self.play( Write(q_and_a), self.teacher.change, "raise_right_hand", ) - self.dither(4) + self.wait(4) class HighDPatreonThanks(PatreonThanks): CONFIG = { diff --git a/old_projects/hilbert/fractal_porn.py b/old_projects/hilbert/fractal_porn.py index eda5f514..a4c2b2b6 100644 --- a/old_projects/hilbert/fractal_porn.py +++ b/old_projects/hilbert/fractal_porn.py @@ -57,7 +57,7 @@ class BringInPeano(Intro): """) self.setup(PeanoCurve) self.play(ShimmerIn(words1)) - self.dither(5) + self.wait(5) self.remove(words1) self.add(words2.to_edge(UP)) for x in range(3): @@ -132,7 +132,7 @@ class SurpriseFractal(Intro): self.setup(Sierpinski) self.add(TextMobject("Speaking of other fractals\\dots")) - self.dither(3) + self.wait(3) self.clear() self.play(ShimmerIn(words)) for x in range(9): @@ -160,7 +160,7 @@ class IntroduceKoch(Intro): self.increase_order() self.remove(words[1]) self.add(words[2]) - self.dither(6) + self.wait(6) class StraightKoch(KochCurve): CONFIG = { @@ -212,19 +212,19 @@ class FromKochToSpaceFilling(Scene): )) self.remove(words[0]) self.add(words[1]) - self.dither(4) + self.wait(4) self.remove(words[1]) self.add(words[2]) - self.dither(3) + self.wait(3) for order in range(2, self.max_order): self.play(Transform( curve, StraightKoch(order = order) )) if order == 2: - self.dither(2) + self.wait(2) elif order == 3: - self.dither() + self.wait() self.clear() @@ -257,7 +257,7 @@ class FromKochToSpaceFilling(Scene): ShowCreation(arrow), ShimmerIn(theta) ) - self.dither(2) + self.wait(2) self.remove(theta, arrow) self.play( Transform(koch, duller_koch), @@ -321,7 +321,7 @@ class FromKochToSpaceFilling(Scene): Transform(left_curve, duller, **kwargs), Transform(right_curve, duller_f, **kwargs) ) - self.dither() + self.wait() kwargs["run_time"] = 7 kwargs["rate_func"] = None self.remove(words[1]) @@ -332,7 +332,7 @@ class FromKochToSpaceFilling(Scene): ) self.remove(words[2]) self.add(words[3]) - self.dither() + self.wait() diff --git a/old_projects/hilbert/section1.py b/old_projects/hilbert/section1.py index 39fcd7bb..16d2bc93 100644 --- a/old_projects/hilbert/section1.py +++ b/old_projects/hilbert/section1.py @@ -65,7 +65,7 @@ class AboutSpaceFillingCurves(TransformOverIncreasingOrders): self.play(Transform(self.curve, self.bubble)) self.show_infinite_objects() self.pose_question() - self.dither() + self.wait() def show_infinite_objects(self): sigma, summand, equals, result = TexMobject([ @@ -91,19 +91,19 @@ class AboutSpaceFillingCurves(TransformOverIncreasingOrders): mob.sort_points(np.linalg.norm) self.play(ShimmerIn(infinity)) - self.dither() + self.wait() self.play( ShimmerIn(summand), ShimmerIn(equals), ShimmerIn(result), DelayByOrder(Transform(infinity, sigma)) ) - self.dither() + self.wait() self.play( Transform(summand, alt_summand), Transform(result, alt_result), ) - self.dither() + self.wait() self.remove(infinity) self.play(*[ CounterclockwiseTransform( @@ -111,7 +111,7 @@ class AboutSpaceFillingCurves(TransformOverIncreasingOrders): Mobject(rationals, other_equals, naturals) ) ]) - self.dither() + self.wait() self.clear() self.add(self.bubble) @@ -122,14 +122,14 @@ class AboutSpaceFillingCurves(TransformOverIncreasingOrders): question_mark = TextMobject("?").scale(2) self.add(question_mark) - self.dither() + self.wait() self.play(*[ ShimmerIn(mob) for mob in infinity, rightarrow, N ] + [ ApplyMethod(question_mark.next_to, rightarrow, UP), ]) - self.dither() + self.wait() @@ -140,7 +140,7 @@ class PostponePhilosophizing(Scene): ]).scale(2).split() self.add(abstract, arrow, concrete) - self.dither() + self.wait() self.play(*[ ApplyMethod( word1.replace, word2, @@ -148,7 +148,7 @@ class PostponePhilosophizing(Scene): ) for word1, word2 in it.permutations([abstract, concrete]) ]) - self.dither() + self.wait() class GrowHilbertWithName(Scene): @@ -171,7 +171,7 @@ class GrowHilbertWithName(Scene): class SectionOne(Scene): def construct(self): self.add(TextMobject("Section 1: Seeing with your ears")) - self.dither() + self.wait() class WriteSomeSoftware(Scene): pass #Done viea screen capture, written here for organization @@ -188,7 +188,7 @@ class ImageToSound(Scene): string.mobject.sort_points(lambda p : -np.linalg.norm(p)) self.add(picture) - self.dither() + self.wait() self.play(Transform( picture, string.mobject, run_time = 3, @@ -214,7 +214,7 @@ class LinksInDescription(Scene): """) self.play(ShimmerIn(text)) self.play(ShowCreation(Arrow(text, 3*DOWN))) - self.dither(2) + self.wait(2) class ImageDataIsTwoDimensional(Scene): @@ -233,7 +233,7 @@ class ImageDataIsTwoDimensional(Scene): ShimmerIn(words_mob), run_time = 2 ) - self.dither() + self.wait() class SoundDataIsOneDimensional(Scene): @@ -299,7 +299,7 @@ class SoundDataIsOneDimensional(Scene): for dot in dots ] ) - self.dither(0.5) + self.wait(0.5) class GridOfPixels(Scene): def construct(self): @@ -316,20 +316,20 @@ class GridOfPixels(Scene): side_words.next_to(side_brace, LEFT) self.add(high_res) - self.dither() + self.wait() self.play(DelayByOrder(Transform(high_res, low_res))) - self.dither() + self.wait() self.play( GrowFromCenter(top_brace), GrowFromCenter(side_brace), ShimmerIn(top_words), ShimmerIn(side_words) ) - self.dither() + self.wait() for mob in grid, high_res: mob.sort_points(np.linalg.norm) self.play(DelayByOrder(Transform(high_res, grid))) - self.dither() + self.wait() class ShowFrequencySpace(Scene): @@ -337,7 +337,7 @@ class ShowFrequencySpace(Scene): freq_line = get_freq_line() self.add(freq_line) - self.dither() + self.wait() for tex, vect in zip(["20 Hz", "20{,}000 Hz"], [LEFT, RIGHT]): tex_mob = TextMobject(tex) tex_mob.to_edge(vect) @@ -347,7 +347,7 @@ class ShowFrequencySpace(Scene): ShimmerIn(tex_mob), ShowCreation(arrow) ) - self.dither() + self.wait() @@ -389,12 +389,12 @@ class AssociatePixelWithFrequency(Scene): ] self.add(small_grid) - self.dither() + self.wait() self.play( Transform(small_grid, big_grid) ) self.play(FadeIn(pixel)) - self.dither() + self.wait() self.play( FadeOut(small_grid), ShowCreation(freq_line) @@ -403,7 +403,7 @@ class AssociatePixelWithFrequency(Scene): self.play( Transform(pixel, dot), ) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.play(loud_vibration) self.play( @@ -450,12 +450,12 @@ class ListenToAllPixels(Scene): words.to_edge(UP, buff = 0.1) self.add(grid) - self.dither() + self.wait() self.play(DelayByOrder(ApplyMethod( grid.gradient_highlight, red, blue ))) self.play(Transform(grid, freq_line)) - self.dither() + self.wait() self.play( ShimmerIn( words, @@ -494,12 +494,12 @@ class LayAsideSpeculation(Scene): lower_right = Point().to_corner(DOWN+RIGHT, buff = 0) self.add(words) - self.dither() + self.wait() self.play( Transform(words, lower_right), Transform(lower_left, mapping) ) - self.dither() + self.wait() class RandomMapping(Scene): @@ -526,20 +526,20 @@ class RandomMapping(Scene): rate_func = rate_func, path_func = path_along_arc(-np.pi/2) )) - self.dither() + self.wait() class DataScrambledAnyway(Scene): def construct(self): self.add(TextMobject("Data is scrambled anyway, right?")) - self.dither() + self.wait() class LeverageExistingIntuitions(Scene): def construct(self): self.add(TextMobject("Leverage existing intuitions")) - self.dither() + self.wait() @@ -572,17 +572,17 @@ class ThinkInTermsOfReverseMapping(Scene): ] self.add(grid, freq_line, arrow) - self.dither() + self.wait() self.play(ApplyMethod( arrow.rotate, np.pi, path_func = clockwise_path() )) - self.dither() + self.wait() self.play(ShowCreation(arrow1)) self.add(dot1) self.play(ShowCreation(arrow2)) self.add(dot2) - self.dither() + self.wait() self.remove(arrow1, arrow2) self.play( Transform(dot1, dot3), @@ -594,7 +594,7 @@ class ThinkInTermsOfReverseMapping(Scene): ) self.play(ShowCreation(arrow3)) self.play(ShowCreation(arrow4)) - self.dither() + self.wait() class WeaveLineThroughPixels(Scene): @@ -649,15 +649,15 @@ class WeaveLineThroughPixels(Scene): run_time = 5, rate_func = None )) - self.dither() + self.wait() self.play( Transform(curve, line), Transform(squares, targets), run_time = 3 ) - self.dither() + self.wait() self.play(ShowCreation(freq_line)) - self.dither() + self.wait() class WellPlayedGameOfSnake(Scene): @@ -673,9 +673,9 @@ class WellPlayedGameOfSnake(Scene): run_time = 7, rate_func = None )) - self.dither() + self.wait() self.play(ShimmerIn(words)) - self.dither() + self.wait() class TellMathematicianFriend(Scene): @@ -702,7 +702,7 @@ class TellMathematicianFriend(Scene): ShowCreation(arrow), ShimmerIn(description) ) - self.dither() + self.wait() point = Point(bubble.get_tip()) self.play( Transform(point, bubble), @@ -710,7 +710,7 @@ class TellMathematicianFriend(Scene): self.remove(point) self.add(bubble) self.play(ShimmerIn(words1)) - self.dither() + self.wait() self.remove(description, arrow) self.play( Transform(mathy.mouth, squiggle_mouth), @@ -718,10 +718,10 @@ class TellMathematicianFriend(Scene): ) self.remove(words1) self.add(words2) - self.dither(2) + self.wait(2) self.remove(words2) self.add(words3) - self.dither(2) + self.wait(2) self.play( ApplyPointwiseFunction( lambda p : 15*p/np.linalg.norm(p), @@ -749,22 +749,22 @@ class Order1PseudoHilbertCurve(Scene): curve = HilbertCurve(order = 1) self.add(words, s) - self.dither() + self.wait() self.play(Transform( s, pre_words, path_func = path_along_arc(-np.pi/3) )) - self.dither() + self.wait() self.play(ShowCreation(grid1)) - self.dither() + self.wait() self.play(ShowCreation(grid2)) - self.dither() + self.wait() kwargs = { "run_time" : 5, "rate_func" : None } self.play(ShowCreation(curve, **kwargs)) - self.dither() + self.wait() class Order2PseudoHilbertCurve(Scene): def construct(self): @@ -798,18 +798,18 @@ class Order2PseudoHilbertCurve(Scene): order_2_curve = HilbertCurve(order = 2) self.add(words, grid2) - self.dither() + self.wait() self.play(ShowCreation(grid4)) self.play(*[ ShowCreation(mini_curve) for mini_curve in mini_curves ]) - self.dither() + self.wait() self.play(ShowCreation(naive_curve, run_time = 5)) self.remove(*mini_curves) - self.dither() + self.wait() self.play(Transform(naive_curve, order_2_curve)) - self.dither() + self.wait() class Order3PseudoHilbertCurve(Scene): @@ -834,11 +834,11 @@ class Order3PseudoHilbertCurve(Scene): ] self.add(words, grid4) - self.dither() + self.wait() self.play(ShowCreation(grid8)) - self.dither() + self.wait() self.play(*map(GrowFromCenter, mini_curves)) - self.dither() + self.wait() self.clear() self.add(words, grid8, *mini_curves) self.play(*[ @@ -849,13 +849,13 @@ class Order3PseudoHilbertCurve(Scene): ] ]) self.play(ShowCreation(order_3_curve, run_time = 5)) - self.dither() + self.wait() class GrowToOrder8PseudoHilbertCurve(Scene): def construct(self): self.curve = HilbertCurve(order = 1) self.add(self.curve) - self.dither() + self.wait() while self.curve.order < 8: self.increase_order() @@ -878,7 +878,7 @@ class GrowToOrder8PseudoHilbertCurve(Scene): GrowFromCenter(mini_curve) for mini_curve in mini_curves[1:] ]) - self.dither() + self.wait() self.clear() self.add(*mini_curves) self.play(*[ @@ -891,7 +891,7 @@ class GrowToOrder8PseudoHilbertCurve(Scene): self.curve = HilbertCurve(order = self.curve.order+1) self.play(ShowCreation(self.curve, run_time = 2)) self.remove(*mini_curves) - self.dither() + self.wait() class UseOrder8(Scene): @@ -905,13 +905,13 @@ class UseOrder8(Scene): self.add(mathy, bubble) self.play(ShimmerIn(bubble.content)) - self.dither() + self.wait() self.clear() self.add(words) self.play(ShowCreation( curve, run_time = 7, rate_func = None )) - self.dither() + self.wait() @@ -942,13 +942,13 @@ class HilbertBetterThanSnakeQ(Scene): Transform(hilbert_curve, new_hc), Transform(snake_curve, new_sc) ]) - self.dither() + self.wait() class ImagineItWorks(Scene): def construct(self): self.add(TextMobject("Imagine your project succeeds...")) - self.dither() + self.wait() class RandyWithHeadphones(Scene): @@ -961,9 +961,9 @@ class RandyWithHeadphones(Scene): randy = Randolph() self.add(randy, headphones) - self.dither(2) + self.wait(2) self.play(ApplyMethod(randy.blink)) - self.dither(4) + self.wait(4) class IncreaseResolution(Scene): @@ -994,13 +994,13 @@ class IncreaseResolution(Scene): ShimmerIn(top_words), ShimmerIn(side_words) ) - self.dither() + self.wait() self.play( DelayByOrder(Transform(*grids)), Transform(top_words, new_top_words), Transform(side_words, new_side_words) ) - self.dither() + self.wait() class IncreasingResolutionWithSnakeCurve(Scene): @@ -1022,7 +1022,7 @@ class IncreasingResolutionWithSnakeCurve(Scene): for curve in start_curve, end_curve ] self.add(start_curve) - self.dither() + self.wait() self.play( ShowCreation(start_dots, run_time = 2), ApplyMethod(start_curve.fade) @@ -1032,7 +1032,7 @@ class IncreasingResolutionWithSnakeCurve(Scene): Transform(start_curve, end_curve), Transform(start_dots, end_dots) ) - self.dither() + self.wait() class TrackSpecificCurvePoint(Scene): @@ -1054,13 +1054,13 @@ class TrackSpecificCurvePoint(Scene): self.play(ShowCreation(line)) self.play(Transform(dot, start_dot)) - self.dither() + self.wait() for new_dot, curve in zip(dots, curves): self.play( Transform(line, curve), Transform(dot, new_dot) ) - self.dither() + self.wait() class TrackSpecificSnakeCurvePoint(TrackSpecificCurvePoint): @@ -1076,10 +1076,10 @@ class NeedToRelearn(Scene): arrow = Arrow(top_words, bottom_words) self.play(ShimmerIn(top_words)) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.play(ShimmerIn(bottom_words)) - self.dither() + self.wait() class TrackSpecificHilbertCurvePoint(TrackSpecificCurvePoint): diff --git a/old_projects/hilbert/section2.py b/old_projects/hilbert/section2.py index f67e9471..c94c6588 100644 --- a/old_projects/hilbert/section2.py +++ b/old_projects/hilbert/section2.py @@ -64,7 +64,7 @@ def get_time_line(): class SectionTwo(Scene): def construct(self): self.add(TextMobject("Section 2: Filling space")) - self.dither() + self.wait() class HilbertCurveIsPerfect(Scene): def construct(self): @@ -92,9 +92,9 @@ class HilbertCurveIsPerfect(Scene): Transform(curve, colored_curve), run_time = 3 ) - self.dither() + self.wait() self.play(Transform(curve, line, run_time = 5)) - self.dither() + self.wait() class AskMathematicianFriend(Scene): @@ -103,14 +103,14 @@ class AskMathematicianFriend(Scene): bubble.sort_points(lambda p : np.dot(p, UP+RIGHT)) self.add(mathy) - self.dither() + self.wait() self.play(ApplyMethod( mathy.blink, rate_func = squish_rate_func(there_and_back) )) - self.dither() + self.wait() self.play(ShowCreation(bubble)) - self.dither() + self.wait() self.play( ApplyMethod(mathy.shift, 3*(DOWN+LEFT)), ApplyPointwiseFunction( @@ -155,7 +155,7 @@ class TimeLineAboutSpaceFilling(Scene): GrowFromCenter(brace), ShimmerIn(words) ) - self.dither() + self.wait() self.play( Transform(time_line, curve_start), FadeOut(brace), @@ -166,7 +166,7 @@ class TimeLineAboutSpaceFilling(Scene): run_time = 5, rate_func = None )) - self.dither() + self.wait() @@ -193,16 +193,16 @@ class NotPixelatedSpace(Scene): ]) self.add(grid) - self.dither() + self.wait() self.play(Transform(grid, space_mobject, run_time = 5)) self.remove(grid) self.highlight_region(space_region, DARK_GREY) - self.dither() + self.wait() self.add(infinitely, detailed) - self.dither() + self.wait() self.play(DelayByOrder(Transform(detailed, extending))) self.play(ShowCreation(arrows)) - self.dither() + self.wait() self.clear() self.highlight_region(space_region, DARK_GREY) self.play(ShowCreation(line)) @@ -227,7 +227,7 @@ class HistoryOfDiscover(Scene): self.add(time_line) - self.dither() + self.wait() for year, curve, vect, text in [ (1890, peano_curve, UP, "Peano Curve"), (1891, hilbert_curve, DOWN, "Hilbert Curve"), @@ -247,9 +247,9 @@ class HistoryOfDiscover(Scene): ShimmerIn(words) ) self.play(ShowCreation(curve)) - self.dither() + self.wait() self.play(ShowCreation(squares)) - self.dither() + self.wait() self.play(ApplyMethod( Mobject(*self.mobjects).shift, 20*(DOWN+RIGHT) )) @@ -289,21 +289,21 @@ class DefinitionOfCurve(Scene): self.play( ApplyMethod(start_words.shift, 2*(DOWN+RIGHT)) ) - self.dither() + self.wait() self.play(Transform(start_words, end_words)) - self.dither() + self.wait() self.play(ShowCreation(curve)) - self.dither() + self.wait() self.play(ShowCreation( dots, run_time = 3, )) - self.dither() + self.wait() self.clear() self.play(ShowCreation(fine_curve, run_time = 5)) - self.dither() + self.wait() self.play(ShimmerIn(space_filling_fractal)) - self.dither() + self.wait() class PseudoHilbertCurvesDontFillSpace(Scene): @@ -312,7 +312,7 @@ class PseudoHilbertCurvesDontFillSpace(Scene): grid = Grid(2, 2, stroke_width=1) self.add(grid, curve) for order in range(2, 6): - self.dither() + self.wait() new_grid = Grid(2**order, 2**order, stroke_width=1) self.play( ShowCreation(new_grid), @@ -340,7 +340,7 @@ class PseudoHilbertCurvesDontFillSpace(Scene): ) - self.dither() + self.wait() self.play( FadeOut(grid), FadeOut(curve), @@ -349,7 +349,7 @@ class PseudoHilbertCurvesDontFillSpace(Scene): self.play( ApplyMethod(square.replace, grid) ) - self.dither() + self.wait() class HilbertCurveIsLimit(Scene): @@ -361,7 +361,7 @@ class HilbertCurveIsLimit(Scene): self.add(mathy, bubble) self.play(ShimmerIn(bubble.content)) - self.dither() + self.wait() class DefiningCurves(Scene): @@ -389,21 +389,21 @@ class DefiningCurves(Scene): low_arrow = Arrow(number_line, grid) self.play(ShimmerIn(words)) - self.dither() + self.wait() self.play( FadeOut(words), ApplyMethod(curves1.replace, curves2), ShimmerIn(top_words.split()[1]) ) - self.dither() + self.wait() self.play(FadeIn(number)) self.play(ShowCreation(arrow)) self.play(FadeIn(pair)) - self.dither() + self.wait() self.play(ShowCreation(number_line)) self.play(ShowCreation(low_arrow)) self.play(ShowCreation(grid)) - self.dither() + self.wait() class PseudoHilbertCurveAsFunctionExample(Scene): @@ -453,16 +453,16 @@ class PseudoHilbertCurveAsFunctionExample(Scene): ShimmerIn(function), ShowCreation(function_arrow) ) - self.dither() + self.wait() self.remove(function_arrow, function) self.play(ShowCreation(line)) - self.dither() + self.wait() self.play( ShimmerIn(arg), ShowCreation(arrow1), ShowCreation(dot1) ) - self.dither() + self.wait() self.remove(arrow1) self.play( FadeIn(grid), @@ -470,12 +470,12 @@ class PseudoHilbertCurveAsFunctionExample(Scene): Transform(dot1, dot2), run_time = 2 ) - self.dither() + self.wait() self.play( ShimmerIn(result), ShowCreation(arrow2) ) - self.dither() + self.wait() @@ -488,7 +488,7 @@ class ContinuityRequired(Scene): ]) words.split()[1].highlight(YELLOW_C) self.add(words) - self.dither() + self.wait() @@ -588,7 +588,7 @@ class FormalDefinitionOfContinuity(Scene): ShowCreation(line), ShowCreation(self.interval), ) - self.dither() + self.wait() def move_dot(self): kwargs = { @@ -600,7 +600,7 @@ class FormalDefinitionOfContinuity(Scene): Homotopy(self.output_homotopy, self.output_dot, **kwargs), ShowCreation(self.output, **kwargs) ) - self.dither() + self.wait() def label_jump(self): jump_points = Mobject( @@ -614,7 +614,7 @@ class FormalDefinitionOfContinuity(Scene): GrowFromCenter(self.brace), ShimmerIn(self.jump) ) - self.dither() + self.wait() self.remove(self.brace, self.jump) @@ -655,21 +655,21 @@ class FormalDefinitionOfContinuity(Scene): ShimmerIn(text), ShowCreation(arrow) ) - self.dither() + self.wait() self.remove(A_text, A_arrow, B_text, B_arrow) self.play(ShowCreation(input_circle)) - self.dither() + self.wait() self.play(ShowCreation(input_points)) - self.dither() + self.wait() input_points_copy = input_points.copy() self.play( Transform(input_points_copy, output_points), run_time = 2 ) - self.dither() + self.wait() self.play(ShowCreation(output_circle)) - self.dither() - self.dither() + self.wait() + self.wait() self.remove(*[ input_circle, input_points, output_circle, input_points_copy @@ -684,7 +684,7 @@ class FormalDefinitionOfContinuity(Scene): run_time = 5, ) self.play(vary_circles) - self.dither() + self.wait() text = TextMobject("Function is ``Continuous at A''") text.shift(2*UP).to_edge(LEFT) arrow = Arrow(text, self.input_dot) @@ -692,7 +692,7 @@ class FormalDefinitionOfContinuity(Scene): ShimmerIn(text), ShowCreation(arrow) ) - self.dither() + self.wait() self.remove(vary_circles.mobject, text, arrow) def discontinuous_point(self): @@ -739,7 +739,7 @@ class FormalDefinitionOfContinuity(Scene): ShimmerIn(point_description), ShowCreation(arrow) ) - self.dither() + self.wait() self.remove(point_description, arrow) tup = self.get_circles_and_points( @@ -755,16 +755,16 @@ class FormalDefinitionOfContinuity(Scene): run_time = 2 ) self.play(ShowCreation(output_circle)) - self.dither() + self.wait() self.play(ShimmerIn(text)) self.remove(input_circle, input_points, output_circle, input_points_copy) self.play(vary_circles) - self.dither() + self.wait() self.play( ShimmerIn(discontinuous_at_A), ShowCreation(discontinuous_arrow) ) - self.dither(3) + self.wait(3) self.remove(vary_circles.mobject, discontinuous_at_A, discontinuous_arrow) def continuous_point(self): @@ -796,7 +796,7 @@ class FunctionIsContinuousText(Scene): self.play(ShimmerIn(all_points)) self.play(ShowCreation(arrow)) self.play(ShimmerIn(continuous)) - self.dither() + self.wait() class DefineActualHilbertCurveText(Scene): @@ -804,7 +804,7 @@ class DefineActualHilbertCurveText(Scene): self.add(TextMobject(""" Finally define a Hilbert Curve\\dots """)) - self.dither() + self.wait() class ReliesOnWonderfulProperty(Scene): @@ -813,7 +813,7 @@ class ReliesOnWonderfulProperty(Scene): \\dots which relies on a certain property of Pseudo-Hilbert-curves. """)) - self.dither() + self.wait() class WonderfulPropertyOfPseudoHilbertCurves(Scene): @@ -838,7 +838,7 @@ class WonderfulPropertyOfPseudoHilbertCurves(Scene): ShowCreation(arrow), ShowCreation(dot) ) - self.dither() + self.wait() self.play( FadeOut(arrow), *[ @@ -856,7 +856,7 @@ class WonderfulPropertyOfPseudoHilbertCurves(Scene): Transform(dot, new_dot), Transform(num_str, new_num_str) ) - self.dither() + self.wait() text.to_edge(UP) text_parts = text.split() @@ -869,7 +869,7 @@ class WonderfulPropertyOfPseudoHilbertCurves(Scene): self.play(Transform(starters, text)) arrow = Arrow(text_parts[-2].get_bottom(), dot, buff = 0.1) self.play(ShowCreation(arrow)) - self.dither() + self.wait() class FollowManyPoints(Scene): def construct(self): @@ -897,9 +897,9 @@ class FollowManyPoints(Scene): starter_dots.shift(2*UP) self.add(curve, text) - self.dither() + self.wait() self.play(DelayByOrder(ApplyMethod(starter_dots.shift, 2*DOWN))) - self.dither() + self.wait() self.remove(starter_dots) self.add(dots) for num in range(1, 10): @@ -913,7 +913,7 @@ class FollowManyPoints(Scene): Transform(curve, new_curve), Transform(dots, new_dots), ) - # self.dither() + # self.wait() class FormalDefinitionOfHilbertCurve(Scene): @@ -940,7 +940,7 @@ class FormalDefinitionOfHilbertCurve(Scene): ShimmerIn(explanation), ShowCreation(exp_arrow) ) - self.dither() + self.wait() self.remove(explanation, exp_arrow) self.play(ShowCreation(curve)) self.play( @@ -948,7 +948,7 @@ class FormalDefinitionOfHilbertCurve(Scene): ShowCreation(x_arrow), ShowCreation(dot) ) - self.dither() + self.wait() self.remove(x_arrow) limit = Mobject(*text.split()[3:]).ingest_submobjects() limit.stroke_width = 1 @@ -969,7 +969,7 @@ class CouldNotDefineForSnakeCurve(Scene): You could not define a limit curve from snake curves. """)) - self.dither() + self.wait() class ThreeThingsToProve(Scene): def construct(self): @@ -1001,11 +1001,11 @@ class ThreeThingsToProve(Scene): self.add(definition) self.play(ShimmerIn(intro)) - self.dither() + self.wait() self.play(Transform(intro, prove_that)) for item in items[1:-1]: self.play(ShimmerIn(item)) - self.dither() + self.wait() diff --git a/old_projects/hilbert/section3.py b/old_projects/hilbert/section3.py index b14de0bf..82309d67 100644 --- a/old_projects/hilbert/section3.py +++ b/old_projects/hilbert/section3.py @@ -39,7 +39,7 @@ from helpers import * class SectionThree(Scene): def construct(self): self.add(TextMobject("A few words on the usefulness of infinite math")) - self.dither() + self.wait() class InfiniteResultsFiniteWorld(Scene): @@ -78,17 +78,17 @@ class InfiniteResultsFiniteWorld(Scene): self.play(ShimmerIn(left_words)) self.play(ShowCreation(arrow)) self.play(ShimmerIn(right_words)) - self.dither() + self.wait() self.play( ShimmerIn(left_formula), ApplyMethod(left_words.next_to, left_formula, UP) ) - self.dither() + self.wait() self.play( ShimmerIn(right_formula), Transform(right_words, right_overwords) ) - self.dither() + self.wait() self.finite_analog( Mobject(left_formula, left_words), arrow, @@ -126,7 +126,7 @@ class InfiniteResultsFiniteWorld(Scene): mob.sort_points(np.linalg.norm) self.play(GrowFromCenter(ex)) - self.dither() + self.wait() self.play( Transform(left_mob, new_left), Transform(arrow.copy(), left_arrow), @@ -138,7 +138,7 @@ class InfiniteResultsFiniteWorld(Scene): GrowFromCenter(brace), ShimmerIn(finite_analog) ) - self.dither() + self.wait() self.equivalence( left_mob, left_arrow, @@ -167,7 +167,7 @@ class InfiniteResultsFiniteWorld(Scene): Transform(arrow, words), ApplyMethod(right_mob.to_edge, RIGHT) ) - self.dither() + self.wait() class HilbertCurvesStayStable(Scene): @@ -185,7 +185,7 @@ class HilbertCurvesStayStable(Scene): words.to_edge(UP) self.add(curve, grid) - self.dither() + self.wait() for n in range(3, 7): if n == 5: self.play(ShimmerIn(words)) @@ -200,7 +200,7 @@ class HilbertCurvesStayStable(Scene): self.remove(grid) grid = new_grid self.play(Transform(curve, new_curve)) - self.dither() + self.wait() @@ -259,16 +259,16 @@ class InfiniteObjectsEncapsulateFiniteObjects(Scene): finite.next_to(words[2], DOWN, buff = n) self.play(ShimmerIn(words[0])) - self.dither() + self.wait() self.play(ShimmerIn(infinite_objects[0])) self.play(ShowCreation(infinite_objects[1])) self.play(ShimmerIn(infinite_objects[2])) - self.dither() + self.wait() self.play(ShimmerIn(words[1]), ShimmerIn(words[2])) self.play(ShimmerIn(finite_objects[0])) self.play(ShowCreation(finite_objects[1])) self.play(ShimmerIn(finite_objects[2])) - self.dither() + self.wait() class StatementRemovedFromReality(Scene): diff --git a/old_projects/inventing_math.py b/old_projects/inventing_math.py index 20ffea36..b5f7897d 100644 --- a/old_projects/inventing_math.py +++ b/old_projects/inventing_math.py @@ -162,7 +162,7 @@ class IntroduceDivergentSum(Scene): for x in range(NUM_WRITTEN_TERMS): self.add(equation[x]) if x == 0: - self.dither(0.75) + self.wait(0.75) continue brace.stretch_to_fit_width( max(equation[x].points[:,0]) - min_x_coord @@ -173,7 +173,7 @@ class IntroduceDivergentSum(Scene): sum_value = TexMobject(str(2**(x+1) - 1)) sum_value.shift(brace.get_center() + 0.5*DOWN) self.add(brace, sum_value) - self.dither(0.75) + self.wait(0.75) self.remove(sum_value) ellipses = Mobject( *[equation[NUM_WRITTEN_TERMS + i] for i in range(3)] @@ -197,7 +197,7 @@ class IntroduceDivergentSum(Scene): ) self.clear() self.add(*equation) - self.dither() + self.wait() class ClearlyNonsense(Scene): def construct(self): @@ -225,13 +225,13 @@ class ClearlyNonsense(Scene): deepcopy(div_sum).scale(0.5).shift(3*UP) )) self.play(ShowCreation(number_line)) - self.dither() + self.wait() self.add(how_here) self.play(ShowCreation(neg_1_arrow)) - self.dither() + self.wait() self.add(this_way) self.play(ShowCreation(right_arrow)) - self.dither() + self.wait() class OutlineOfVideo(Scene): def construct(self): @@ -284,7 +284,7 @@ class OutlineOfVideo(Scene): DelayByOrder(FadeIn(element)) for element in group ]) - self.dither() + self.wait() # # class ReasonsForMakingVideo(Scene): # # def construct(self): @@ -314,9 +314,9 @@ class OutlineOfVideo(Scene): # # FadeIn(line_one_first), # # FadeIn(line_one_last) # # ) -# # self.dither() +# # self.wait() # # self.add(line_two) -# # self.dither() +# # self.wait() # class DiscoverAndDefine(Scene): # def construct(self): @@ -334,9 +334,9 @@ class OutlineOfVideo(Scene): # self.add(sum_mob) # self.play(FadeIn(discover)) -# self.dither() +# self.wait() # self.play(FadeIn(Mobject(*define_parts))) -# self.dither() +# self.wait() class YouAsMathematician(Scene): def construct(self): @@ -363,11 +363,11 @@ class YouAsMathematician(Scene): ShowCreation(arrow), BlinkPiCreature(you) ) - self.dither() + self.wait() self.play(ShowCreation(bubble)) for part in equation_parts: self.play(DelayByOrder(FadeIn(part)), run_time = 0.5) - self.dither() + self.wait() self.play( BlinkPiCreature(you), FadeOut(explanation), @@ -399,7 +399,7 @@ class YouAsMathematician(Scene): ], run_time = 2.0 ) - self.dither() + self.wait() def disapproving_friend(self): friend = Mortimer().to_corner(DOWN+RIGHT) @@ -409,7 +409,7 @@ class YouAsMathematician(Scene): self.add(friend, bubble) self.play(DelayByOrder(FadeIn(bubble.content))) - self.dither() + self.wait() self.remove(friend, bubble, bubble.content) @@ -420,7 +420,7 @@ class DotsGettingCloser(Scene): for x in LEFT, RIGHT ] self.add(*dots) - self.dither() + self.wait() for x in range(10): distance = min(dots[1].points[:,0])-max(dots[0].points[:,0]) self.play(ApplyMethod(dots[0].shift, 0.5*distance*RIGHT)) @@ -440,7 +440,7 @@ class ZoomInOnInterval(Scene): # new_line.stretch_to_fit_height(height) self.add(number_line) - self.dither() + self.wait() self.play(Transform(number_line, new_line)) self.clear() squish = lambda p : (p[0], 0, 0) @@ -454,7 +454,7 @@ class ZoomInOnInterval(Scene): ) self.clear() self.add(*interval) - self.dither() + self.wait() class DanceDotOnInterval(Scene): def construct(self, mode): @@ -480,7 +480,7 @@ class DanceDotOnInterval(Scene): ApplyMethod(dot.shift, DOWN) for dot in dots ]) - self.dither() + self.wait() for count in range(num_written_terms): shift_val = 2*RIGHT*INTERVAL_RADIUS*(1-prop)*(prop**count) start = dots[0].get_center() @@ -505,9 +505,9 @@ class DanceDotOnInterval(Scene): FadeIn(num), FadeIn(arrow), ) - self.dither() + self.wait() self.write_partial_sums() - self.dither() + self.wait() def write_partial_sums(self): partial_sums = TexMobject(PARTIAL_CONVERGENT_SUMS_TEXT, size = "\\small") @@ -521,7 +521,7 @@ class DanceDotOnInterval(Scene): FadeIn(partial_sum_parts[y]) for y in range(x, x+4) ]) - self.dither(2) + self.wait(2) class OrganizePartialSums(Scene): def construct(self): @@ -540,7 +540,7 @@ class OrganizePartialSums(Scene): pure_sum.to_edge(LEFT).shift(2*RIGHT+count*UP) self.add(*partial_sum_parts) - self.dither() + self.wait() self.play(*[ ClockwiseTransform(*pair) for pair in zip(pure_sums, new_pure_sums) @@ -558,9 +558,9 @@ class OrganizePartialSums(Scene): infinite_sum.to_corner(DOWN+LEFT).shift(2*RIGHT) self.play(ShowCreation(dots)) - self.dither() + self.wait() self.play(FadeIn(Mobject(down_arrow, infinite_sum))) - self.dither() + self.wait() class SeeNumbersApproachOne(Scene): def construct(self): @@ -585,7 +585,7 @@ class SeeNumbersApproachOne(Scene): ShowCreation(dots), run_time = 2.0 ) - self.dither() + self.wait() class OneAndInfiniteSumAreTheSameThing(Scene): def construct(self): @@ -595,15 +595,15 @@ class OneAndInfiniteSumAreTheSameThing(Scene): point = Point(equals.get_center()).highlight("black") self.add(one.shift(LEFT)) - self.dither() + self.wait() self.add(inf_sum.shift(RIGHT)) - self.dither() + self.wait() self.play( ApplyMethod(one.shift, RIGHT), ApplyMethod(inf_sum.shift, LEFT), CounterclockwiseTransform(point, equals) ) - self.dither() + self.wait() class HowDoYouDefineInfiniteSums(Scene): @@ -619,16 +619,16 @@ class HowDoYouDefineInfiniteSums(Scene): sum_mob.shift(text[-1].get_center()+2*RIGHT) self.add(you) - self.dither() + self.wait() for mob in text[:-1]: self.add(mob) - self.dither(0.1) + self.wait(0.1) self.play(BlinkPiCreature(you)) - self.dither() + self.wait() self.add(text[-1]) - self.dither() + self.wait() self.add(sum_mob) - self.dither() + self.wait() class LessAboutNewThoughts(Scene): @@ -649,14 +649,14 @@ class LessAboutNewThoughts(Scene): kwargs = {"run_time" : 0.25} self.add(*words) - self.dither() + self.wait() self.play(ShowCreation(gen_cross, **kwargs)) self.play(ShowCreation(new_cross, **kwargs)) - self.dither() + self.wait() self.add(disecting) - self.dither(0.5) + self.wait(0.5) self.add(old) - self.dither() + self.wait() class ListOfPartialSums(Scene): def construct(self): @@ -680,7 +680,7 @@ class ListOfPartialSums(Scene): run_time = 1.0 ) self.play(ShowCreation(dots)) - self.dither() + self.wait() self.play( FadeIn(Mobject(*equals)), *[ @@ -688,14 +688,14 @@ class ListOfPartialSums(Scene): for number, finite_sum in zip(numbers, sums) ] ) - self.dither() + self.wait() self.play(*[ ApplyMethod(s.highlight, "yellow", rate_func = there_and_back) for s in sums ]) - self.dither() + self.wait() self.add(one.highlight("green")) - self.dither() + self.wait() class ShowDecreasingDistance(Scene): @@ -719,7 +719,7 @@ class ShowDecreasingDistance(Scene): self.add(dots.split()[0]) self.add(number_line, *lines) - self.dither() + self.wait() self.play( ApplyMethod(vert_line0.shift, RIGHT), Transform( @@ -729,7 +729,7 @@ class ShowDecreasingDistance(Scene): ShowCreation(dots), run_time = 2.5 ) - self.dither() + self.wait() class CircleZoomInOnOne(Scene): def construct(self): @@ -762,7 +762,7 @@ class CircleZoomInOnOne(Scene): DelayByOrder(FadeIn(mob)) for mob in arrow, curr_num ]) - self.dither() + self.wait() for num in numbers[1:] + [text]: curr_num.points = np.array(list(reversed(curr_num.points))) self.play( @@ -774,7 +774,7 @@ class CircleZoomInOnOne(Scene): ) self.remove(curr_num) curr_num = num - self.dither() + self.wait() class ZoomInOnOne(Scene): def construct(self): @@ -840,7 +840,7 @@ class DefineInfiniteSum(Scene): def construct(self): self.put_expression_in_corner() self.list_partial_sums() - self.dither() + self.wait() def put_expression_in_corner(self): buff = 0.24 @@ -852,7 +852,7 @@ class DefineInfiniteSum(Scene): expression = Mobject(define, infinite_sum) self.add(expression) - self.dither() + self.wait() self.play(ApplyFunction( lambda mob : mob.scale(0.5).to_corner(UP+LEFT, buff = buff), expression @@ -867,7 +867,7 @@ class DefineInfiniteSum(Scene): ShowCreation(line.highlight("white")) for line in lines ]) - self.dither() + self.wait() def list_partial_sums(self): num_terms = 10 @@ -887,10 +887,10 @@ class DefineInfiniteSum(Scene): for term, count in zip(terms, it.count()): self.add(term) - self.dither(0.1) + self.wait(0.1) if count % 3 == 2: - self.dither(0.5) - self.dither() + self.wait(0.5) + self.wait() esses = np.array(terms)[range(0, len(terms), 3)] other_terms = filter(lambda m : m not in esses, terms) self.play(*[ @@ -943,7 +943,7 @@ class YouJustInventedSomeMath(Scene): self.add(you) for mob in text: self.add(mob) - self.dither(0.2) + self.wait(0.2) self.play(WaveArm(you)) self.play(BlinkPiCreature(you)) @@ -969,8 +969,8 @@ class SeekMoreGeneralTruths(Scene): for qsum in sums.split(): qsum.sort_points(lambda p : np.dot(p, DOWN+RIGHT)) self.play(DelayByOrder(FadeIn(qsum))) - self.dither(0.5) - self.dither() + self.wait(0.5) + self.wait() class ChopIntervalInProportions(Scene): args_list = [("9", ), ("p", )] @@ -1048,7 +1048,7 @@ class ChopIntervalInProportions(Scene): Transform(term_to_replace, new_term_to_replace), *additional_anims ) - self.dither() + self.wait() self.play( Transform( term_to_replace, @@ -1094,7 +1094,7 @@ class ChopIntervalInProportions(Scene): FadeIn(mob) for mob in braces + [lt, rt] ] + additional_anims) - self.dither() + self.wait() brace_to_replace = braces[1] term_to_replace = rt if mode == "9": @@ -1107,7 +1107,7 @@ class ChopIntervalInProportions(Scene): self.play(Transform( right_terms[-1], split_100 )) - self.dither() + self.wait() @@ -1168,7 +1168,7 @@ class PointNineRepeating(RearrangeEquation): } for term in TexMobject(start_terms).split(): self.add(term) - self.dither(0.5) + self.wait(0.5) self.clear() RearrangeEquation.construct( self, @@ -1224,12 +1224,12 @@ class PlugNumbersIntoRightside(Scene): self.add(lhs, *rhs) - self.dither() + self.wait() self.play(FadeIn(right_words)) curr = rhs[1] for num, count in zip(nums, it.count()): self.play(CounterclockwiseTransform(curr, num)) - self.dither() + self.wait() if count == 2: self.play(FadeIn(left_words)) @@ -1334,7 +1334,7 @@ class ListPartialDivergentSums(Scene): ApplyMethod(terms[x].highlight, "green"), run_time = 0.1 ) - self.dither() + self.wait() class NotARobot(Scene): def construct(self): @@ -1372,7 +1372,7 @@ class SumPowersOfTwoAnimation(Scene): full_top_sum = TexMobject(["1", "+2", "+4", "+8", "+16"]).split() self.add(equation) - self.dither() + self.wait() self.add(circle, curr_dots, topbrace, bottombrace) for n in range(1,iterations): bottom_num = TexMobject(str(2**n)) @@ -1411,7 +1411,7 @@ class SumPowersOfTwoAnimation(Scene): new_top_sum_start = Mobject(*new_top_sum[:-1]) new_top_sum_end = new_top_sum[-1] - self.dither() + self.wait() self.play(*[ FadeIn(mob) for mob in [ @@ -1422,7 +1422,7 @@ class SumPowersOfTwoAnimation(Scene): alt_bottom_num, ] ]) - self.dither() + self.wait() self.play( Transform(topbrace, new_topbrace), Transform(alt_topbrace, new_topbrace), @@ -1464,14 +1464,14 @@ class PretendTheyDoApproachNegativeOne(RearrangeEquation): column.shift(shift_val) shift_val = shift_val + (column.get_width()+0.2)*RIGHT self.play(ShimmerIn(columns[0])) - self.dither() + self.wait() self.add(columns[1]) - self.dither() + self.wait() self.play( DelayByOrder(Transform(deepcopy(columns[0]), columns[-1])), FadeIn(columns[2]) ) - self.dither() + self.wait() class DistanceBetweenRationalNumbers(Scene): def construct(self): @@ -1490,15 +1490,15 @@ class DistanceBetweenRationalNumbers(Scene): self.add(text, *nums) self.play(*[ShowCreation(arrow) for arrow in arrows]) self.play(ShimmerIn(dist)) - self.dither() + self.wait() class NotTheOnlyWayToOrganize(Scene): def construct(self): self.play(ShowCreation(NumberLine().add_numbers())) - self.dither() + self.wait() words = "Is there any other reasonable way to organize numbers?" self.play(FadeIn(TextMobject(words).shift(2*UP))) - self.dither() + self.wait() class DistanceIsAFunction(Scene): args_list = [ @@ -1528,7 +1528,7 @@ class DistanceIsAFunction(Scene): ] dist.highlight("orange") self.add(dist) - self.dither() + self.wait() elif mode == "Euclidian": examples = [ ("1", "5", "4"), @@ -1548,7 +1548,7 @@ class DistanceIsAFunction(Scene): ] dist.highlight("green") self.add(dist) - self.dither() + self.wait() example_mobs = [ ( TexMobject(tup[0]).shift(arg0.get_center()), @@ -1573,7 +1573,7 @@ class DistanceIsAFunction(Scene): self.remove(*previous) self.add(*mobs) previous = mobs - self.dither() + self.wait() class ShiftInvarianceNumberLine(Scene): def construct(self): @@ -1593,7 +1593,7 @@ class ShiftInvarianceNumberLine(Scene): """).scale(0.5).to_corner(DOWN+RIGHT) self.add(number_line, topbrace, dist0, footnote) - self.dither() + self.wait() self.remove(dist0) self.play( ApplyMethod(topbrace.shift, 2*RIGHT), @@ -1602,7 +1602,7 @@ class ShiftInvarianceNumberLine(Scene): for pair in zip(dist0.split(), dist1.split()) ] ) - self.dither() + self.wait() class NameShiftInvarianceProperty(Scene): def construct(self): @@ -1625,9 +1625,9 @@ class NameShiftInvarianceProperty(Scene): self.add(prop) self.play(ShimmerIn(label), ShimmerIn(u_brace)) - self.dither() + self.wait() self.play(ShimmerIn(name)) - self.dither() + self.wait() class TriangleInequality(Scene): @@ -1658,13 +1658,13 @@ class TriangleInequality(Scene): for symbol, loc in zip(symbols, locations): self.add(TexMobject(symbol).shift(loc)) self.play(ShowCreation(ac_line), FadeIn(ac_copy)) - self.dither() + self.wait() self.play(*[ ShowCreation(line) for line in ab_line, bc_line ]+[ FadeIn(dist) for dist in ab_copy, bc_copy ]) - self.dither() + self.wait() self.play(*[ Transform(*pair) for pair in zip(all_copies, all_dists) @@ -1672,7 +1672,7 @@ class TriangleInequality(Scene): FadeIn(mob) for mob in plus, greater_than ]) - self.dither() + self.wait() @@ -1701,7 +1701,7 @@ class StruggleToFindFrameOfMind(Scene): ))) self.remove(copy) self.add(mob) - self.dither() + self.wait() class RoomsAndSubrooms(Scene): @@ -1734,7 +1734,7 @@ class RoomsAndSubrooms(Scene): mob.sort_points(np.linalg.norm) self.play(ShowCreation(mob)) - self.dither() + self.wait() class RoomsAndSubroomsWithNumbers(Scene): @@ -1743,17 +1743,17 @@ class RoomsAndSubroomsWithNumbers(Scene): zero_one_width = SPACE_WIDTH-0.3 zero, power_mobs = self.draw_numbers(zero_local, zero_one_width) - self.dither() + self.wait() rectangles = self.draw_first_rectangles(zero_one_width) rect_clusters = self.draw_remaining_rectangles(rectangles) self.adjust_power_mobs(zero, power_mobs, rect_clusters[-1]) - self.dither() + self.wait() num_mobs = self.draw_remaining_numbers( zero, power_mobs, rect_clusters ) - self.dither() + self.wait() self.add_negative_one(num_mobs) - self.dither() + self.wait() self.show_distances(num_mobs, rect_clusters) @@ -1791,7 +1791,7 @@ class RoomsAndSubroomsWithNumbers(Scene): rectangles.append(rect) for rect in rectangles: self.play(ShowCreation(rect)) - self.dither() + self.wait() return rectangles def draw_remaining_rectangles(self, rectangles): @@ -1872,7 +1872,7 @@ class RoomsAndSubroomsWithNumbers(Scene): self.add(num_mobs[n]) last_left_mob = left_mob self.remove(zero_copy, power_mob_copy) - self.dither() + self.wait() return num_mobs @staticmethod @@ -1919,7 +1919,7 @@ class RoomsAndSubroomsWithNumbers(Scene): ) for index in pair ]) - self.dither() + self.wait() for index in pair: num_mobs[index].highlight("white") @@ -1979,7 +1979,7 @@ class DeduceWhereNegativeOneFalls(Scene): self.remove(u_brace, *texts) self.remove(*last_args) self.add(*new_args) - self.dither(rest_time) + self.wait(rest_time) last_args = new_args @@ -2004,7 +2004,7 @@ class OtherRationalNumbers(Scene): for pair, locus in zip(pairs, locii): fraction = TexMobject("\\frac{%d}{%d}"%pair).shift(locus) self.play(ShimmerIn(fraction)) - self.dither() + self.wait() class PAdicMetric(Scene): def construct(self): @@ -2018,18 +2018,18 @@ class PAdicMetric(Scene): curr = deepcopy(p_str) self.add(curr, text) - self.dither() + self.wait() for prime, count in zip(primes, it.count()): prime.scale(1.0).highlight(colors.next()) prime.shift(center_of_mass([p_str.get_top(), p_str.get_center()])) self.play(DelayByOrder(Transform(curr, prime))) - self.dither() + self.wait() if count == 2: self.spill(Mobject(curr, text), arrow, new_numbers) self.remove(curr) curr = prime self.play(DelayByOrder(Transform(curr, p_str))) - self.dither() + self.wait() def spill(self, start, arrow, end): start.sort_points(lambda p : p[1]) @@ -2099,7 +2099,7 @@ class FuzzyDiscoveryToNewMath(Scene): self.add(fuzzy, lines) self.play(*map(ShimmerIn, fuzzy_discoveries)) - self.dither() + self.wait() self.play(DelayByOrder(Transform( deepcopy(fuzzy), new_math ))) @@ -2107,7 +2107,7 @@ class FuzzyDiscoveryToNewMath(Scene): DelayByOrder(Transform(deepcopy(disc), math)) for disc, math in zip(fuzzy_discoveries, new_maths) ]) - self.dither() + self.wait() class DiscoveryAndInvention(Scene): @@ -2124,7 +2124,7 @@ class DiscoveryAndInvention(Scene): arrows = [] self.add(discovery, vs, invention) - self.dither() + self.wait() arrow = Arrow( nrd.get_bottom(), tail = discovery.get_top() @@ -2134,14 +2134,14 @@ class DiscoveryAndInvention(Scene): ShowCreation(arrow) ) arrows.append(arrow) - self.dither() + self.wait() arrow = Arrow( invention.get_top(), tail = nrd.get_bottom() ) self.play(ShowCreation(arrow)) arrows.append(arrow) - self.dither() + self.wait() arrow = Arrow( rt.get_top(), tail = invention.get_bottom() @@ -2151,13 +2151,13 @@ class DiscoveryAndInvention(Scene): ShowCreation(arrow) ) arrows.append(arrow) - self.dither() + self.wait() arrow = Arrow( discovery.get_bottom(), tail = rt.get_top() ) self.play(ShowCreation(arrow)) - self.dither() + self.wait() arrows.append(arrow) for color in Color("yellow").range_to("red", 4): for arrow in arrows: diff --git a/old_projects/leibniz.py b/old_projects/leibniz.py index 46f52d1b..c551d247 100644 --- a/old_projects/leibniz.py +++ b/old_projects/leibniz.py @@ -221,7 +221,7 @@ class Introduction(PiCreatureScene): morty.change_mode, "raise_right_hand", DrawBorderThenFill(video) ) - self.dither() + self.wait() self.play( Write(primes, run_time = 2), morty.change_mode, "happy", @@ -229,12 +229,12 @@ class Introduction(PiCreatureScene): video.center, video.set_fill, None, 0 ) - self.dither() + self.wait() self.play( Write(plane, run_time = 2), morty.change, "raise_right_hand" ) - self.dither() + self.wait() self.remove(morty) morty = morty.copy() self.add(morty) @@ -247,7 +247,7 @@ class Introduction(PiCreatureScene): FadeOut(VGroup(morty.eyes, morty.mouth)), Write(VGroup(*pi_group[1:])) ) - self.dither(2) + self.wait(2) self.play( plane.scale_to_fit_width, pi_group.get_width(), plane.next_to, pi_group, DOWN, MED_LARGE_BUFF @@ -268,9 +268,9 @@ class Introduction(PiCreatureScene): FadeIn(titles[0]) ) self.show_frame() - self.dither(2) + self.wait(2) self.play(Transform(*titles)) - self.dither(3) + self.wait(3) def get_primes(self): return TexMobject("2, 3, 5, 7, 11, 13, \\dots") @@ -311,7 +311,7 @@ class ShowSum(TeacherStudentsScene): self.change_student_modes( "hooray", "sassy", "angry" ) - self.dither(2) + self.wait(2) def show_sum(self): line = UnitInterval() @@ -395,7 +395,7 @@ class ShowSum(TeacherStudentsScene): anims.append(FadeIn(fading_term)) self.play(*anims, run_time = run_time) if term: - self.dither() + self.wait() else: run_time *= 0.8 self.play( @@ -404,10 +404,10 @@ class ShowSum(TeacherStudentsScene): dot.move_to, sum_point ) self.play(ShowCreation(sum_arrow)) - self.dither() + self.wait() self.change_student_modes("erm", "confused", "maybe") self.play(self.teacher.change_mode, "happy") - self.dither(2) + self.wait(2) class FermatsDreamExcerptWrapper(Scene): def construct(self): @@ -417,7 +417,7 @@ class FermatsDreamExcerptWrapper(Scene): words.scale(0.8) words.to_edge(UP) self.add(words) - self.dither() + self.wait() class ShowCalculus(PiCreatureScene): def construct(self): @@ -452,18 +452,18 @@ class ShowCalculus(PiCreatureScene): FadeIn(rhs), self.pi_creature.change, mode ) - self.dither() + self.wait() self.change_mode("maybe") - self.dither() + self.wait() self.look_at(rhs_group[-1]) - self.dither() + self.wait() self.pi_creature_says( "Where's the \\\\ circle?", bubble_kwargs = {"width" : 4, "height" : 3}, target_mode = "maybe" ) self.look_at(rhs_group[0]) - self.dither() + self.wait() def create_pi_creature(self): return Randolph(color = BLUE_C).to_corner(DOWN+LEFT) @@ -516,10 +516,10 @@ class CertainRegularityInPrimes(LatticePointScene): curr_group = groups[0] self.play(Write(curr_group, run_time = 2)) - self.dither() + self.wait() for group in groups[1:]: self.play(Transform(curr_group, group)) - self.dither(2) + self.wait(2) class Outline(PiCreatureScene): def construct(self): @@ -565,7 +565,7 @@ class Outline(PiCreatureScene): FadeIn(question) ] ) - self.dither(2) + self.wait(2) self.play( RemovePiCreatureBubble(self.pi_creature), question.to_corner, UP+RIGHT @@ -630,7 +630,7 @@ class Outline(PiCreatureScene): self.play( FadeIn(step) ) - self.dither() + self.wait() self.play( lattice_group.scale_to_fit_height, 2.5, lattice_group.next_to, self.question, DOWN, @@ -640,8 +640,8 @@ class Outline(PiCreatureScene): def write_steps_2_and_3(self): for step in self.steps[1:3]: self.play(FadeIn(step)) - self.dither(2) - self.dither() + self.wait(2) + self.wait() def show_chi(self): input_range = range(1, 7) @@ -676,7 +676,7 @@ class Outline(PiCreatureScene): for mob in [chis, arrows, numerators] ]) self.change_mode("pondering") - self.dither() + self.wait() self.chis = chis self.arrows = arrows @@ -701,7 +701,7 @@ class Outline(PiCreatureScene): Write(rhs) ) self.change_mode("confused") - self.dither(2) + self.wait(2) self.complicated_formula = rhs @@ -738,7 +738,7 @@ class Outline(PiCreatureScene): Write(expression), self.pi_creature.change_mode, "pondering" ) - self.dither(3) + self.wait(3) ######## def create_pi_creature(self): @@ -800,7 +800,7 @@ class CountLatticePoints(LatticePointScene): DrawBorderThenFill(example_dot), run_time = 2, ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [label, lines, example_dot])) def draw_lattice_points_in_circle(self): @@ -824,7 +824,7 @@ class CountLatticePoints(LatticePointScene): self.play(FadeIn(brace)) self.add_foreground_mobject(brace) self.draw_lattice_points() - self.dither() + self.wait() self.play(*map(FadeOut, [brace, radius])) self.circle = circle @@ -853,7 +853,7 @@ class CountLatticePoints(LatticePointScene): ), Animation(self.lattice_points) ) - self.dither() + self.wait() self.play(FadeOut(squares), Animation(self.lattice_points)) def write_pi_R_squared(self): @@ -887,13 +887,13 @@ class CountLatticePoints(LatticePointScene): FadeIn(background), Write(radius_10_eq) ) - self.dither(2) + self.wait(2) self.play(ReplacementTransform( radius_10_eq.copy(), radius_million_eq )) self.play(FadeIn(brace)) - self.dither(3) + self.wait(3) self.radius_10_eq = radius_10_eq self.million_group = VGroup(radius_million_eq, brace) @@ -921,14 +921,14 @@ class CountLatticePoints(LatticePointScene): self.radius_R_eq ) ) - self.dither(2) + self.wait(2) self.play( final_group.arrange_submobjects, RIGHT, final_group.next_to, ORIGIN, UP ) rect = BackgroundRectangle(final_group) self.play(FadeIn(rect), Animation(final_group)) - self.dither(2) + self.wait(2) class SoYouPlay(TeacherStudentsScene): def construct(self): @@ -937,9 +937,9 @@ class SoYouPlay(TeacherStudentsScene): run_time = 2 ) self.change_student_modes("happy", "thinking", "hesitant") - self.dither() + self.wait() self.look_at(Dot().to_corner(UP+LEFT)) - self.dither(3) + self.wait(3) class CountThroughRings(LatticePointScene): CONFIG = { @@ -982,7 +982,7 @@ class CountThroughRings(LatticePointScene): arg_creator = lambda m : (m.set_stroke, PINK, 4), rate_func = there_and_back, )) - self.dither() + self.wait() self.remove_foreground_mobject(self.lattice_points) digest_locals(self, ["circles", "radii"]) @@ -1002,7 +1002,7 @@ class CountThroughRings(LatticePointScene): self.lattice_points.set_fill, GREY, 0.5, Animation(points_on_example_circle) ) - self.dither() + self.wait() digest_locals(self, ["points_on_example_circle", "example_circle"]) @@ -1047,7 +1047,7 @@ class CountThroughRings(LatticePointScene): ) self.play(ShowCreation(radial_line)) self.play(Write(distance)) - self.dither(2) + self.wait(2) a_num, b_num = [ TexMobject(str(coord))[0] @@ -1060,9 +1060,9 @@ class CountThroughRings(LatticePointScene): Transform(a, a_num), Transform(b, b_num), ) - self.dither() + self.wait() self.play(Transform(distance, distance_num)) - self.dither(3) + self.wait(3) self.play(*map(FadeOut, [ self.example_circle, self.points_on_example_circle, distance, a, b, @@ -1115,7 +1115,7 @@ class CountThroughRings(LatticePointScene): count_mob, added_anims = [FadeIn(root)] ) - self.dither(2) + self.wait(2) self.play( FadeOut(left_roots), FadeIn(top_rect), @@ -1131,7 +1131,7 @@ class CountThroughRings(LatticePointScene): self.show_ring_count( r_squared, top_list[r_squared], ) - self.dither(3) + self.wait(3) def show_ring_count( @@ -1188,7 +1188,7 @@ class CountThroughRings(LatticePointScene): *added_anims, run_time = run_time ) - self.dither(run_time) + self.wait(run_time) if len(points) > 0: mover = points.copy() else: @@ -1262,7 +1262,7 @@ class LookAtExampleRing(LatticePointScene): FadeIn(points, submobject_mode = "lagged_start"), run_time = 2, ) - self.dither() + self.wait() curr_label = labels[0] curr_sum_of_squares = sums_of_squares[0] @@ -1280,7 +1280,7 @@ class LookAtExampleRing(LatticePointScene): Animation(VGroup(x, y)) ) self.remove(x, y) - self.dither() + self.wait() for label, sum_of_squares in zip(labels, sums_of_squares)[1:]: self.play( @@ -1295,7 +1295,7 @@ class LookAtExampleRing(LatticePointScene): ) ) curr_sum_of_squares = sum_of_squares - self.dither() + self.wait() points.save_state() points.generate_target() @@ -1309,9 +1309,9 @@ class LookAtExampleRing(LatticePointScene): points, run_time = 2, )) - self.dither() + self.wait() self.play(points.restore, run_time = 2) - self.dither() + self.wait() self.play(*map(FadeOut, [ curr_label, curr_sum_of_squares, circle, points, @@ -1342,9 +1342,9 @@ class LookAtExampleRing(LatticePointScene): ), run_time = 2, ) - self.dither() + self.wait() self.play(Write(equation)) - self.dither(3) + self.wait(3) class Given2DThinkComplex(TeacherStudentsScene): def construct(self): @@ -1359,7 +1359,7 @@ class Given2DThinkComplex(TeacherStudentsScene): self.teacher_says(tex) self.change_student_modes("pondering", "confused", "erm") - self.dither() + self.wait() self.play( Write(plane), RemovePiCreatureBubble( @@ -1371,7 +1371,7 @@ class Given2DThinkComplex(TeacherStudentsScene): *["thinking"]*3, look_at_arg = plane ) - self.dither(3) + self.wait(3) class IntroduceComplexConjugate(LatticePointScene): CONFIG = { @@ -1466,11 +1466,11 @@ class IntroduceComplexConjugate(LatticePointScene): Write(y_coord) ) self.play(FadeIn(tuple_label)) - self.dither() + self.wait() self.play(*map(FadeOut, [tuple_label, y_coord])) self.play(*map(FadeIn, [complex_label, imag_y_coord])) self.play(*map(Write, [imag_coords, ticks])) - self.dither() + self.wait() self.play(*map(FadeOut, [ v_arrow, h_arrow, x_coord, imag_y_coord, @@ -1519,12 +1519,12 @@ class IntroduceComplexConjugate(LatticePointScene): run_time = 3, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) self.play( GrowFromCenter(brace), Write(conjugate_words, run_time = 2) ) - self.dither() + self.wait() self.play(*[ ReplacementTransform(m1.copy(), m2) for m1, m2 in [ @@ -1532,7 +1532,7 @@ class IntroduceComplexConjugate(LatticePointScene): (self.complex_label, label), ] ]) - self.dither(2) + self.wait(2) self.conjugate_label = VGroup(brace, conjugate_words) self.equation = equation @@ -1549,7 +1549,7 @@ class IntroduceComplexConjugate(LatticePointScene): target_mode = "confused", )) self.play(Blink(randy)) - self.dither(2) + self.wait(2) self.play( RemovePiCreatureBubble( randy, target_mode = "erm", @@ -1603,26 +1603,26 @@ class IntroduceComplexConjugate(LatticePointScene): self.play(group.shift, vect) group = VGroup(x1, y2) self.play(group.shift, -vect) - self.dither() + self.wait() self.play(group.shift, vect) group = VGroup(x2, y1) self.play(group.shift, -vect) - self.dither() + self.wait() self.play(group.shift, vect) group = VGroup(*it.chain(y1, y2)) self.play(group.shift, -vect) - self.dither() + self.wait() self.play( FadeIn(expansion[1].rect), ReplacementTransform(group.copy(), expansion[1]), ) self.play(group.shift, vect) - self.dither(2) + self.wait(2) self.play( Transform(expansion[1].rect, alt_y_term.rect), Transform(expansion[1], alt_y_term), ) - self.dither() + self.wait() self.play(*map(FadeOut, [ expansion[0].rect, expansion[1].rect, @@ -1665,7 +1665,7 @@ class IntroduceComplexConjugate(LatticePointScene): ) self.play(Blink(morty)) self.play(RemovePiCreatureBubble(randy, target_mode = "pondering")) - self.dither() + self.wait() self.play(*map(FadeOut, [randy, morty, screen])) def show_geometrically(self): @@ -1713,9 +1713,9 @@ class IntroduceComplexConjugate(LatticePointScene): top_dot.magnitude_word, submobject_mode = "lagged_start" )) - self.dither() + self.wait() self.play(ShowCreation(top_dot.arc)) - self.dither(2) + self.wait(2) self.play(ShowCreation(low_dot.line)) self.play( ReplacementTransform( @@ -1741,9 +1741,9 @@ class IntroduceComplexConjugate(LatticePointScene): mover[1].move_to, self.plane.coords_to_point(25, 0), run_time = 2 ) - self.dither() + self.wait() self.play(Write(twenty_five_label)) - self.dither(3) + self.wait(3) class NameGaussianIntegers(LatticePointScene): CONFIG = { @@ -1802,7 +1802,7 @@ class NameGaussianIntegers(LatticePointScene): run_time = 2, submobject_mode = "lagged_start" )) - self.dither(3) + self.wait(3) self.play(FadeOut(gauss_name)) self.gaussian_integers = gaussian_integers @@ -1825,7 +1825,7 @@ class NameGaussianIntegers(LatticePointScene): *map(GrowFromCenter, dots) ) self.play(Write(root_label)) - self.dither() + self.wait() self.circle_dots = dots @@ -1894,7 +1894,7 @@ class NameGaussianIntegers(LatticePointScene): ReplacementTransform(last_dot.line_pair, dot.line_pair), ] self.play(*anims) - self.dither() + self.wait() last_dot = dot class FactorOrdinaryNumber(TeacherStudentsScene): @@ -1927,7 +1927,7 @@ class FactorOrdinaryNumber(TeacherStudentsScene): self.teacher.change_mode, "raise_right_hand", Write(number) ) - self.dither(2) + self.wait(2) self.play( number.restore, Write(VGroup(*equation[1:])), @@ -1938,7 +1938,7 @@ class FactorOrdinaryNumber(TeacherStudentsScene): look_at_arg = equation, added_anims = [self.teacher.change_mode, "happy"] ) - self.dither() + self.wait() last_alt_rhs = None for alt_rhs in alt_rhs_list: equation.generate_target() @@ -1955,7 +1955,7 @@ class FactorOrdinaryNumber(TeacherStudentsScene): look_at_arg = alt_rhs, added_anims = [Write(title[0])] ) - self.dither(2) + self.wait(2) last_alt_rhs = alt_rhs self.play( @@ -1967,7 +1967,7 @@ class FactorOrdinaryNumber(TeacherStudentsScene): ) ) self.change_student_modes(*["happy"]*3) - self.dither(3) + self.wait(3) class IntroduceGaussianPrimes(LatticePointScene, PiCreatureScene): CONFIG = { @@ -2076,7 +2076,7 @@ class IntroduceGaussianPrimes(LatticePointScene, PiCreatureScene): DrawBorderThenFill(five_dot), FadeIn(five_label) ) - self.dither() + self.wait() self.play( ReplacementTransform( VGroup(five_dot).copy(), @@ -2084,9 +2084,9 @@ class IntroduceGaussianPrimes(LatticePointScene, PiCreatureScene): ) ) self.play(*map(Write, [p1_label, p2_label])) - self.dither() + self.wait() self.play(Write(gaussian_prime)) - self.dither() + self.wait() #Show morty self.play(FadeIn(morty)) @@ -2094,7 +2094,7 @@ class IntroduceGaussianPrimes(LatticePointScene, PiCreatureScene): morty, "\\emph{Almost} unique", bubble_kwargs = {"height" : 2, "width" : 5}, )) - self.dither() + self.wait() self.play(RemovePiCreatureBubble(morty, target_mode = "pondering")) #Show neg_alternate expression @@ -2110,12 +2110,12 @@ class IntroduceGaussianPrimes(LatticePointScene, PiCreatureScene): Transform(p2_label, p6_label), ) self.play(Write(neg_alt_factorization)) - self.dither() + self.wait() self.play( FadeOut(neg_alt_factorization), *[m.restore for m in movers] ) - self.dither() + self.wait() ##Show i_alternate expression self.play( @@ -2132,7 +2132,7 @@ class IntroduceGaussianPrimes(LatticePointScene, PiCreatureScene): ] ] ) - self.dither() + self.wait() self.play( ShowCreation(times_neg_i_arc), FadeIn(times_neg_i), @@ -2147,10 +2147,10 @@ class IntroduceGaussianPrimes(LatticePointScene, PiCreatureScene): ] ] ) - self.dither() + self.wait() self.play(Write(i_alt_factorization)) self.change_mode("hesitant") - self.dither(3) + self.wait(3) class FromIntegerFactorsToGaussianFactors(TeacherStudentsScene): def construct(self): @@ -2186,12 +2186,12 @@ class FromIntegerFactorsToGaussianFactors(TeacherStudentsScene): ), *map(ShowCreation, mob.arrows) ) - self.dither() + self.wait() self.play(*[ ApplyMethod(pi.change, "pondering", expression) for pi in self.get_pi_creatures() ]) - self.dither(5) + self.wait(5) group = VGroup( expression, two.arrows, two.factors, @@ -2201,7 +2201,7 @@ class FromIntegerFactorsToGaussianFactors(TeacherStudentsScene): "Now for a \\\\ surprising fact...", added_anims = [FadeOut(group)] ) - self.dither(2) + self.wait(2) class FactorizationPattern(Scene): def construct(self): @@ -2267,7 +2267,7 @@ class FactorizationPattern(Scene): map(ShowCreation, arrows), map(DrawBorderThenFill, dots), )) - self.dither() + self.wait() self.play(*[ MoveToTarget( mover, @@ -2281,7 +2281,7 @@ class FactorizationPattern(Scene): run_time = 2, submobject_mode = "lagged_start" )) - self.dither(4) + self.wait(4) self.play(*map(FadeOut, [movers, factorizations])) def show_three_mod_four_primes(self): @@ -2316,12 +2316,12 @@ class FactorizationPattern(Scene): map(ShowCreation, arrows), map(DrawBorderThenFill, dots), )) - self.dither() + self.wait() self.play( Write(words), *map(ShowCreation, word_arrows) ) - self.dither(4) + self.wait(4) self.play(*map(FadeOut, [words, word_arrows])) def ask_why_this_is_true(self): @@ -2344,9 +2344,9 @@ class FactorizationPattern(Scene): look_at_arg = self.number_line, )) self.play(Blink(randy)) - self.dither() + self.wait() self.play(FadeIn(links_text)) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ randy, randy.bubble, randy.bubble.content, links_text @@ -2384,19 +2384,19 @@ class FactorizationPattern(Scene): ShowCreation(arrow), DrawBorderThenFill(two_dot) ) - self.dither() + self.wait() self.play( MoveToTarget(mover), Write(factorization) ) self.revert_to_original_skipping_status() - self.dither(2) + self.wait(2) self.play(ShowCreation(time_i_arrow)) self.play(Write(times_i)) - self.dither(2) + self.wait(2) self.play(FadeIn(words)) - self.dither(2) + self.wait(2) class RingsWithOneModFourPrimes(CertainRegularityInPrimes): CONFIG = { @@ -2452,12 +2452,12 @@ class FactorTwo(LatticePointScene): (two_dot, factor_dots), ] ]) - self.dither(2) + self.wait(2) dot_copy = factor_dots[1].copy() dot_copy.highlight(RED) for angle in np.pi/2, -np.pi/2: self.play(Rotate(dot_copy, angle, run_time = 2)) - self.dither(2) + self.wait(2) class CountThroughRingsCopy(CountThroughRings): pass @@ -2531,7 +2531,7 @@ class IntroduceRecipe(Scene): path_arc = -np.pi/6 )) self.play(Write(factorization)) - self.dither() + self.wait() self.factored_N_mob = N_mob self.integer_factorization = factorization @@ -2580,7 +2580,7 @@ class IntroduceRecipe(Scene): movers, replace_mobject_with_target_in_scene = True )) - self.dither() + self.wait() self.gaussian_factorization = factorization @@ -2595,10 +2595,10 @@ class IntroduceRecipe(Scene): right_factors.target.next_to(T_chart.right_h_line, DOWN) self.play(ShowCreation(T_chart)) - self.dither() + self.wait() self.play(MoveToTarget(left_factors)) self.play(MoveToTarget(right_factors)) - self.dither() + self.wait() digest_locals(self, ["left_factors", "right_factors"]) @@ -2622,11 +2622,11 @@ class IntroduceRecipe(Scene): main_arrow = double_arrows[0] self.play(Write(main_arrow, run_time = 1)) - self.dither() + self.wait() for new_arrow in double_arrows[1:]: self.play(Transform(main_arrow, new_arrow)) - self.dither() - self.dither() + self.wait() + self.wait() self.play(FadeOut(main_arrow)) def take_product_of_columns(self): @@ -2639,8 +2639,8 @@ class IntroduceRecipe(Scene): self.play(ReplacementTransform( group.copy(), VGroup(product) )) - self.dither() - self.dither(3) + self.wait() + self.wait(3) def mark_left_product_as_result(self): rect = self.get_result_surrounding_rect() @@ -2654,7 +2654,7 @@ class IntroduceRecipe(Scene): Write(words, run_time = 2), ShowCreation(arrow) ) - self.dither(3) + self.wait(3) self.play(*map(FadeOut, [words, arrow])) self.output_label_group = VGroup(words, arrow) @@ -2662,7 +2662,7 @@ class IntroduceRecipe(Scene): def swap_factors(self): for i in range(len(self.left_factors)): self.swap_factors_at_index(i) - self.dither() + self.wait() ######### @@ -2756,7 +2756,7 @@ class IntroduceRecipe(Scene): ]+[ ReplacementTransform(rect, new_rect) ]) - self.dither() + self.wait() def get_result_surrounding_rect(self, product = None): if product is None: @@ -2782,14 +2782,14 @@ class IntroduceRecipe(Scene): # ) anims += [ShowCreation(arrow)] self.play(*anims) - self.dither(2) + self.wait(2) class StateThreeChoices(TeacherStudentsScene): def construct(self): self.teacher_says( "$5^2$ gives 3 choices." ) - self.dither(3) + self.wait(3) class ThreeOutputsAsLatticePoints(LatticePointScene): CONFIG = { @@ -2843,7 +2843,7 @@ class ThreeOutputsAsLatticePoints(LatticePointScene): stroke_width = 4 ) ) - self.dither(2) + self.wait(2) self.original_dots = dots @@ -2855,7 +2855,7 @@ class LooksLikeYoureMissingSome(TeacherStudentsScene): student_index = 0, ) self.play(self.teacher.change, "guilty") - self.dither(3) + self.wait(3) class ShowAlternateFactorizationOfTwentyFive(IntroduceRecipe): CONFIG = { @@ -2937,8 +2937,8 @@ class ThreeOutputsAsLatticePointsContinued(ThreeOutputsAsLatticePoints): dots_copy.highlight, color, path_arc = angle ) - self.dither() - self.dither(2) + self.wait() + self.wait(2) class RecipeFor125(IntroduceRecipe): CONFIG = { @@ -2969,7 +2969,7 @@ class StateFourChoices(TeacherStudentsScene): self.teacher_says( "$5^3$ gives 4 choices." ) - self.dither(3) + self.wait(3) class Show125Circle(ThreeOutputsAsLatticePointsContinued): CONFIG = { @@ -3039,13 +3039,13 @@ class RecipeFor375(IntroduceRecipe): morty.change, "angry", three.target ) self.play(Blink(morty)) - self.dither() + self.wait() for factors in self.left_factors, self.right_factors: self.play( three.next_to, factors, DOWN, morty.change, "sassy", factors.get_bottom() ) - self.dither() + self.wait() self.right_factors.add(three) self.play(morty.change_mode, "pondering") @@ -3081,7 +3081,7 @@ class Show375Circle(LatticePointScene): group = VGroup( self.plane, radial_line, root_label, circle ) - self.dither(2) + self.wait(2) class RecipeFor1125(IntroduceRecipe): CONFIG = { @@ -3115,7 +3115,7 @@ class RecipeFor1125(IntroduceRecipe): product = self.product_mobjects[0] self.play(Write(words)) - self.dither() + self.wait() class Show125CircleSimple(LatticePointScene): CONFIG = { @@ -3150,7 +3150,7 @@ class Show125CircleSimple(LatticePointScene): ), run_time = 2, ) - self.dither(2) + self.wait(2) class Show1125Circle(Show125CircleSimple): CONFIG = { @@ -3217,7 +3217,7 @@ class SummarizeCountingRule(Show125Circle): stroke_width = 4, stroke_color = PINK )) - self.dither(2) + self.wait(2) def add_full_screen_rect(self): rect = FullScreenFadeRectangle( @@ -3269,14 +3269,14 @@ class SummarizeCountingRule(Show125Circle): self.play(FadeIn(factorization)) - self.dither() + self.wait() self.play( five.highlight, GREEN, thirteen.highlight, GREEN, FadeIn(five_brace), FadeIn(thirteen_brace), ) - self.dither() + self.wait() for choices, power in (five_choices, five_power), (thirteen_choices, thirteen_power): self.play( Write(VGroup(choices[0], *choices[2:])), @@ -3284,19 +3284,19 @@ class SummarizeCountingRule(Show125Circle): power.copy(), choices[1] ) ) - self.dither() + self.wait() self.play( three.highlight, RED, FadeIn(three_brace) ) - self.dither() + self.wait() self.play( Write(VGroup(three_choices[0], three_choices[2])), ReplacementTransform( three_power.copy(), three_choices[1] ) ) - self.dither() + self.wait() movers = three_power, three_choices for mob in movers: @@ -3308,12 +3308,12 @@ class SummarizeCountingRule(Show125Circle): ), Transform(three_choices, alt_three_choices) ) - self.dither() + self.wait() self.play( *[mob.restore for mob in movers], path_arc = -np.pi ) - self.dither() + self.wait() equals_four = TexMobject("=", "4") four = equals_four.get_part_by_tex("4") @@ -3343,7 +3343,7 @@ class SummarizeCountingRule(Show125Circle): FadeIn(equals_four) ) self.play(*map(FadeIn, [final_choice_words, final_choice_arrow])) - self.dither() + self.wait() def ask_about_two(self): randy = Randolph(color = BLUE_C) @@ -3359,14 +3359,14 @@ class SummarizeCountingRule(Show125Circle): look_at_arg = self.count_words )) self.play(Blink(randy)) - self.dither() + self.wait() class ThisIsTheHardestPart(TeacherStudentsScene): def construct(self): self.change_student_modes("horrified", "confused", "pleading") self.teacher_says("This is the \\\\ hardest part") self.change_student_modes("thinking", "happy", "pondering") - self.dither(2) + self.wait(2) class RecipeFor10(IntroduceRecipe): CONFIG = { @@ -3402,7 +3402,7 @@ class RecipeFor10(IntroduceRecipe): ShowCreation(arrow), Write(times_i, run_time = 1) ) - self.dither() + self.wait() self.play(curr_product.to_edge, LEFT) self.swap_factors_at_index(0) new_arrow = Arrow( @@ -3413,7 +3413,7 @@ class RecipeFor10(IntroduceRecipe): Transform(arrow, new_arrow), MaintainPositionRelativeTo(times_i, arrow) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [arrow, times_i, curr_product])) class FactorsOfTwoNeitherHelpNorHurt(TeacherStudentsScene): @@ -3424,7 +3424,7 @@ class FactorsOfTwoNeitherHelpNorHurt(TeacherStudentsScene): words.highlight_by_tex("2", YELLOW) self.teacher_says(words) self.change_student_modes(*["pondering"]*3) - self.dither(3) + self.wait(3) class EffectOfPowersOfTwo(LatticePointScene): CONFIG = { @@ -3454,10 +3454,10 @@ class EffectOfPowersOfTwo(LatticePointScene): stroke_width = 4, stroke_color = PINK )) - self.dither() + self.wait() for new_group in groups[1:]: self.play(Transform(group, new_group)) - self.dither(2) + self.wait(2) class NumberTheoryAtItsBest(TeacherStudentsScene): def construct(self): @@ -3467,7 +3467,7 @@ class NumberTheoryAtItsBest(TeacherStudentsScene): run_time = 2, ) self.change_student_modes(*["hooray"]*3) - self.dither(3) + self.wait(3) class IntroduceChi(FactorizationPattern): CONFIG = { @@ -3521,7 +3521,7 @@ class IntroduceChi(FactorizationPattern): chi_expression = self.chi_expressions[index] self.introduce_dots_arrows_and_labels(dots, arrows, labels) - self.dither() + self.wait() self.play( Write(VGroup(*[ part @@ -3534,7 +3534,7 @@ class IntroduceChi(FactorizationPattern): labels, chi_expression.inputs ) ]) - self.dither() + self.wait() def fade_out_labels(self): self.play(*map(FadeOut, [ @@ -3583,7 +3583,7 @@ class IntroduceChi(FactorizationPattern): run_time = 6 )) - self.dither() + self.wait() self.play(*map(FadeOut, [chis, arrows, numbers])) def write_multiplicative_label(self): @@ -3629,10 +3629,10 @@ class IntroduceChi(FactorizationPattern): FadeIn(expression), self.morty.change, "pondering", expression ) - self.dither(2) + self.wait(2) for new_expression in expressions[1:]: self.play(Transform(expression, new_expression)) - self.dither(2) + self.wait(2) @@ -3749,7 +3749,7 @@ class WriteCountingRuleWithChi(SummarizeCountingRule): FadeIn(factorization), self.count_words.next_to, count, LEFT ) - self.dither() + self.wait() self.play(*[ ReplacementTransform( VGroup(factorization.get_part_by_tex( @@ -3759,7 +3759,7 @@ class WriteCountingRuleWithChi(SummarizeCountingRule): ) for tex, part in zip(["=", "2", "3", "5"], count) ]) - self.dither() + self.wait() self.factorization = factorization self.count = count @@ -3795,12 +3795,12 @@ class WriteCountingRuleWithChi(SummarizeCountingRule): ) for c_part, e_part in zip(count_copy, expression) ]) - self.dither() + self.wait() self.play(ReplacementTransform( count_copy, expression, run_time = 2 )) - self.dither() + self.wait() self.chi_expression = expression @@ -3836,9 +3836,9 @@ class WriteCountingRuleWithChi(SummarizeCountingRule): FadeIn(evaluation_rect), ReplacementTransform(chi_sum.copy(), evaluation), ) - self.dither(2) + self.wait(2) self.play(Indicate(count, color = PINK)) - self.dither() + self.wait() if base.get_tex_string() is "3": new_exp = TexMobject("3") new_exp.replace(exp) @@ -3871,7 +3871,7 @@ class WriteCountingRuleWithChi(SummarizeCountingRule): ) self.play(Transform(count_num, new_count)) self.play(Indicate(count_num, color = PINK)) - self.dither() + self.wait() self.play(*[mob.restore for mob in to_save]) self.play( @@ -3887,13 +3887,13 @@ class WriteCountingRuleWithChi(SummarizeCountingRule): self.revert_to_original_skipping_status() self.play(ShowCreation(rect)) - self.dither(3) + self.wait(3) class WeAreGettingClose(TeacherStudentsScene): def construct(self): self.teacher_says("We're getting close...") self.change_student_modes(*["hooray"]*3) - self.dither(2) + self.wait(2) class ExpandCountWith45(SummarizeCountingRule): CONFIG = { @@ -3959,7 +3959,7 @@ class ExpandCountWith45(SummarizeCountingRule): FadeIn(factorization), self.count_words.next_to, expression, LEFT ) - self.dither() + self.wait() self.play(*[ ReplacementTransform( VGroup(factorization.get_part_by_tex( @@ -3970,7 +3970,7 @@ class ExpandCountWith45(SummarizeCountingRule): for tex, part in zip(["=", "3", "5"], expression) ]) self.play(FadeIn(braces)) - self.dither() + self.wait() self.chi_expression = expression self.factorization = factorization @@ -4027,11 +4027,11 @@ class ExpandCountWith45(SummarizeCountingRule): ] ) for movers in mover_groups: - self.dither() + self.wait() self.play(movers.next_to, rect, DOWN) self.play(*map(MoveToTarget, movers)) self.play(Write(plusses)) - self.dither() + self.wait() self.expansion = expansion self.prime_pairs = prime_pairs @@ -4083,7 +4083,7 @@ class ExpandCountWith45(SummarizeCountingRule): )) self.remove(prime_pairs) product_mobs.highlight(YELLOW) - self.dither(2) + self.wait(2) self.play(LaggedStart( ApplyMethod, product_mobs, @@ -4095,7 +4095,7 @@ class ExpandCountWith45(SummarizeCountingRule): run_time = 2, submobject_mode = "lagged_start", )) - self.dither(2) + self.wait(2) class CountLatticePointsInBigCircle(LatticePointScene): CONFIG = { @@ -4132,7 +4132,7 @@ class CountLatticePointsInBigCircle(LatticePointScene): self.play(*map(FadeIn, [circle, radius, R_group])) self.add_foreground_mobject(R_group) self.draw_lattice_points() - self.dither() + self.wait() self.play( FadeOut(R_rect), FadeIn(pi_R_squared_rect), @@ -4144,7 +4144,7 @@ class CountLatticePointsInBigCircle(LatticePointScene): ) self.remove(R_group) self.add_foreground_mobject(pi_R_squared_group) - self.dither() + self.wait() self.circle = circle self.radius = radius @@ -4180,7 +4180,7 @@ class CountLatticePointsInBigCircle(LatticePointScene): lag_ratio = 0.1, ), ) - self.dither() + self.wait() self.rings = rings @@ -4209,7 +4209,7 @@ class CountLatticePointsInBigCircle(LatticePointScene): self.play(*map(FadeOut, [circle, arrow])) self.play(FadeOut(center_dot)) self.lattice_points.remove(center_dot) - self.dither() + self.wait() self.play(*[ ApplyMethod(m.scale, 0.5) for m in [ @@ -4236,7 +4236,7 @@ class CountLatticePointsInBigCircle(LatticePointScene): ), run_time = 4, ) - self.dither(2) + self.wait(2) ##### @@ -4294,7 +4294,7 @@ class AddUpGrid(Scene): ) self.play(LaggedStart(ShowCreation, row_lines)) - self.dither() + self.wait() self.row_lines = row_lines @@ -4338,7 +4338,7 @@ class AddUpGrid(Scene): run_time = 5, rate_func = lambda t : t, )) - self.dither() + self.wait() digest_locals(self, [ "chi_sums", "chi_mobs", "plusses", @@ -4391,14 +4391,14 @@ class AddUpGrid(Scene): FadeIn(composite_rects), randy.look_at, composite_rects.get_bottom() ) - self.dither(2) + self.wait(2) self.play( FadeOut(composite_rects), FadeIn(prime_rects), randy.look_at, prime_rects.get_top(), ) self.play(Blink(randy)) - self.dither() + self.wait() self.play(*map(FadeOut, [prime_rects, randy])) def organize_into_columns(self): @@ -4420,7 +4420,7 @@ class AddUpGrid(Scene): map(MoveToTarget, self.chi_mobs), map(MoveToTarget, self.plusses), ), run_time = 2) - self.dither() + self.wait() def add_count_words(self): rect = Rectangle( @@ -4442,7 +4442,7 @@ class AddUpGrid(Scene): words.add(approx) self.play(*map(FadeIn, [rect, words])) - self.dither() + self.wait() self.count_rect = rect self.count_words = words @@ -4477,7 +4477,7 @@ class AddUpGrid(Scene): rect.set_fill(YELLOW, 0.3) self.play(FadeIn(rect)) - self.dither() + self.wait() self.play( ReplacementTransform( column.copy(), @@ -4487,7 +4487,7 @@ class AddUpGrid(Scene): Write(term[0]), Write(term[2]), ) - self.dither() + self.wait() if term is full_sum[2]: vect = sum([ self.count_rect.get_left()[0], @@ -4551,12 +4551,12 @@ class AddUpGrid(Scene): ), run_time = 2) self.remove(R_movers) self.add(R_squared) - self.dither() + self.wait() self.play( MoveToTarget(self.corner_four, run_time = 2), FadeOut(self.corner_four.rect) ) - self.dither(2) + self.wait(2) self.remove(self.full_sum, self.corner_four) self.add(new_sum) @@ -4587,7 +4587,7 @@ class AddUpGrid(Scene): ] ) self.play(Write(alt_rhs)) - self.dither(2) + self.wait(2) self.alt_rhs = alt_rhs @@ -4619,9 +4619,9 @@ class AddUpGrid(Scene): ) self.play(Write(area_rhs)) - self.dither() + self.wait() self.play(FadeIn(brace)) - self.dither(2) + self.wait(2) self.play(FadeOut(brace)) self.play(*[ ReplacementTransform(m.copy(), pi_sum_part) @@ -4640,10 +4640,10 @@ class AddUpGrid(Scene): ApplyMethod(pi.change, "hooray", self.alt_rhs) for pi in creatures ]) - self.dither() + self.wait() for i in 0, 2, 3: self.play(Blink(creatures[i])) - self.dither() + self.wait() class IntersectionOfTwoFields(TeacherStudentsScene): def construct(self): @@ -4696,7 +4696,7 @@ class IntersectionOfTwoFields(TeacherStudentsScene): DrawBorderThenFill(circle, run_time = 2), self.teacher.change_mode, "raise_right_hand" ) - self.dither() + self.wait() for circle in circles: for word in circle.words: self.play( @@ -4707,7 +4707,7 @@ class IntersectionOfTwoFields(TeacherStudentsScene): for pi in self.get_students() ] ) - self.dither() + self.wait() self.play( Write(mid_words), self.teacher.change, "raise_right_hand" @@ -4716,7 +4716,7 @@ class IntersectionOfTwoFields(TeacherStudentsScene): *["thinking"]*3, look_at_arg = mid_words ) - self.dither(3) + self.wait(3) class LeibnizPatreonThanks(PatreonThanks): CONFIG = { @@ -4788,19 +4788,19 @@ class Sponsorship(PiCreatureScene): morty.change_mode, "raise_right_hand", LaggedStart(DrawBorderThenFill, logo, run_time = 3) ) - self.dither() + self.wait() self.play( ShowCreation(rect), logo.scale, 0.8, logo.to_corner, UP+RIGHT, morty.change, "happy" ) - self.dither() + self.wait() self.play(Write(url)) - self.dither(3) + self.wait(3) for mode in "confused", "pondering", "happy": self.play(morty.change_mode, mode) - self.dither(3) + self.wait(3) class Thumbnail(Scene): def construct(self): diff --git a/old_projects/matrix_as_transform_2d.py b/old_projects/matrix_as_transform_2d.py index 18edb899..4dd89a50 100644 --- a/old_projects/matrix_as_transform_2d.py +++ b/old_projects/matrix_as_transform_2d.py @@ -63,9 +63,9 @@ class ShowMultiplication(NumberLineScene): NumberLineScene.construct(self, **config) if show_original_line: self.copy_original_line() - self.dither() + self.wait() self.show_multiplication(num, run_time = 1.5) - self.dither() + self.wait() def copy_original_line(self): copied_line = deepcopy(self.number_line) @@ -79,7 +79,7 @@ class ShowMultiplication(NumberLineScene): for mob in copied_num_mobs ] ) - self.dither() + self.wait() class ExamplesOfOneDimensionalLinearTransforms(ShowMultiplication): args_list = [] @@ -108,7 +108,7 @@ class ExamplesOfNonlinearOneDimensionalTransforms(NumberLineScene): ] for func, explanation in pairs: self.run_function(func, explanation) - self.dither(3) + self.wait(3) def run_function(self, function, explanation): self.clear() @@ -149,9 +149,9 @@ class ShowTwoThenThree(ShowMultiplication): NumberLineScene.construct(self, **config) self.copy_original_line() self.show_multiplication(2) - self.dither() + self.wait() self.show_multiplication(3) - self.dither() + self.wait() ######################################################## @@ -234,7 +234,7 @@ class ShowMatrixTransform(TransformScene2D): mobject.points[:, :2] = np.dot(mobject.points[:, :2], np.transpose(matrix)) return mobject - self.dither() + self.wait() kwargs = { "run_time" : 2.0, "path_func" : self.get_path_func(matrix) @@ -255,7 +255,7 @@ class ShowMatrixTransform(TransformScene2D): new_arrow.add_tip() anims.append(Transform(arrow, new_arrow, **kwargs)) self.play(*anims) - self.dither() + self.wait() def get_density_factor(self, matrix): max_norm = max([ @@ -328,7 +328,7 @@ class ExamplesOfNonlinearTwoDimensionalTransformations(Scene): self.add(number_plane, *numbers) self.add(self.blackness, self.nonlinear, words) - self.dither() + self.wait() self.play( ApplyPointwiseFunction(function, number_plane), *[ @@ -344,7 +344,7 @@ class ExamplesOfNonlinearTwoDimensionalTransformations(Scene): ], run_time = 2.0 ) - self.dither(3) + self.wait(3) def get_blackness(self): vertices = [ @@ -407,13 +407,13 @@ class TrickyExamplesOfNonlinearTwoDimensionalTransformations(Scene): def run_function(self, function, plane, phrase, remove_plane = True): number_plane = deepcopy(plane) self.add(number_plane, self.blackness, phrase) - self.dither() + self.wait() self.play( ApplyPointwiseFunction(function, number_plane, run_time = 2.0), Animation(self.blackness), Animation(phrase), ) - self.dither(3) + self.wait(3) if remove_plane: self.remove(number_plane) @@ -472,7 +472,7 @@ class ShowMatrixTransformWithDot(TransformScene2D): self.play(ApplyMethod(x_arrow_copy.rotate, np.pi)) self.play(ShowCreation(y_arrow_copy)) - self.dither() + self.wait() self.remove(x_arrow_copy, y_arrow_copy) kwargs = { "run_time" : 2.0, @@ -497,13 +497,13 @@ class ShowMatrixTransformWithDot(TransformScene2D): new_arrow.add_tip() anims.append(Transform(arrow, new_arrow, **kwargs)) self.play(*anims) - self.dither() + self.wait() x_arrow_copy = deepcopy(self.x_arrow) y_arrow_copy = Arrow(LEFT+2*UP, 5*RIGHT+2*UP, color = LIGHT_RED, **ARROW_CONFIG) self.play(ApplyMethod(x_arrow_copy.rotate, np.pi)) self.play(ShowCreation(y_arrow_copy)) - self.dither(3) + self.wait(3) self.remove(x_arrow_copy, y_arrow_copy) def get_density_factor(self, matrix): @@ -534,10 +534,10 @@ class Show90DegreeRotation(TransformScene2D): self.add_background() self.add_x_y_arrows() - self.dither() + self.wait() self.play(*[ RotationAsTransform(mob, run_time = 2.0) for mob in self.number_plane, self.x_arrow, self.y_arrow ]) - self.dither() + self.wait() diff --git a/old_projects/moser_intro.py b/old_projects/moser_intro.py index bf690e82..b2da10fa 100644 --- a/old_projects/moser_intro.py +++ b/old_projects/moser_intro.py @@ -27,7 +27,7 @@ def logo_to_circle(): ) big_circle = Circle(density = CIRCLE_DENSITY).scale(RADIUS) sc.add(small_circle) - sc.dither() + sc.wait() sc.animate(Transform(small_circle, big_circle)) return sc @@ -53,7 +53,7 @@ def count_sections(*radians): ]) sc.animate(Transform(deepcopy(dots[x]), new_lines, run_time = 2.0)) sc.add(new_lines) - sc.dither() + sc.wait() regions = plane_partition_from_points(*points[:x+1]) for reg in regions: reg.intersect(interior) @@ -67,11 +67,11 @@ def count_sections(*radians): sc.add(number) sc.remove(last_num) last_num = number - sc.dither(rt) + sc.wait(rt) sc.reset_background() sc.remove(last_num) sc.animate(Transform(last_num, deepcopy(last_num).center())) - sc.dither() + sc.wait() sc.remove(last_num) return sc @@ -99,7 +99,7 @@ def summarize_pattern(*radians): sc.remove(last_num) last_num = num sc.add(num, dots[x], new_lines) - sc.dither() + sc.wait() return sc def connect_points(*radians): @@ -121,7 +121,7 @@ def connect_points(*radians): all_lines.append(lines) sc.animate(*anims) sc.add(*all_lines) - sc.dither() + sc.wait() return sc def interesting_problems(): @@ -143,7 +143,7 @@ def interesting_problems(): sc.add(face, tb) sc.animate(ShowCreation(fermat, run_time = 1)) sc.add(fermat) - sc.dither() + sc.wait() sc.animate( Transform( deepcopy(fermat).repeat(len(locales)), @@ -152,7 +152,7 @@ def interesting_problems(): FadeIn(face_copies, run_time = 1.0) ) sc.animate(FadeIn(tb_copies)) - sc.dither() + sc.wait() sc.animate( Transform(tb, sb), Transform(tb_copies, sb_copies) @@ -172,10 +172,10 @@ def response_invitation(): ]) sc.add(video_icon) - sc.dither() + sc.wait() sc.animate(Transform(deepcopy(video_icon).repeat(3), mini_videos)) sc.add(mini_videos) - sc.dither() + sc.wait() sc.animate(ShowCreation(comments, run_time = 1.0)) return sc @@ -209,7 +209,7 @@ def different_points(radians1, radians2): for line1, line2 in zip(lines1, lines2) ] ) - sc.dither() + sc.wait() return sc def next_few_videos(*radians): @@ -235,7 +235,7 @@ def next_few_videos(*radians): frame.shift((-5, 0, 0)) sc.add(thumbnail) - sc.dither() + sc.wait() sc.animate( Transform(big_frame, frame), Transform( @@ -244,7 +244,7 @@ def next_few_videos(*radians): ) ) sc.add(frame, thumbnail) - sc.dither() + sc.wait() last = frame for x in [-2, 1, 4]: vi = VideoIcon().shift((x, 0, 0)) diff --git a/old_projects/moser_main.py b/old_projects/moser_main.py index 26800ea0..7a805f37 100644 --- a/old_projects/moser_main.py +++ b/old_projects/moser_main.py @@ -161,7 +161,7 @@ class MoserPattern(CircleScene): TexMobject(str(n)).shift(num.get_center()) ] self.add(*tex_stuffs) - self.dither(0.5) + self.wait(0.5) self.remove(*tex_stuffs) def hpsq_taylored_alpha(t): @@ -232,7 +232,7 @@ class HardProblemsSimplerQuestions(Scene): ]) self.remove(*self.mobjects) self.add(fermat["n"], fermat2, fermat3) - self.dither() + self.wait() circle_grid = Mobject( Circle(), @@ -263,7 +263,7 @@ class HardProblemsSimplerQuestions(Scene): CounterclockwiseTransform(start_line, end_line), ShowCreation(dots) ) - self.dither() + self.wait() all_mobjects = Mobject(*self.mobjects) self.remove(*self.mobjects) self.play( @@ -300,12 +300,12 @@ class CountLines(CircleScene): ) ] self.add(text) - self.dither() + self.wait() self.play(*[ Transform(line1, line2, run_time = 2) for line1, line2 in zip(self.lines, new_lines) ]) - self.dither() + self.wait() self.remove(text) self.count(new_lines) anims = [FadeIn(formula)] @@ -339,7 +339,7 @@ class CountIntersectionPoints(CircleScene): text.scale(scale_factor).shift(text_center) self.add(text) self.count(intersection_dots, mode="show", num_offset = ORIGIN) - self.dither() + self.wait() anims = [] for mob in self.mobjects: if mob == self.number: #put in during count @@ -380,7 +380,7 @@ class NonGeneralPosition(CircleScene): self.highlight_region(center_region, "green") self.add(text, arrow) - self.dither(2) + self.wait(2) self.remove(text, arrow) self.reset_background() self.play(*[ @@ -422,7 +422,7 @@ class GeneralPositionRule(Scene): self.add(words_mob) if words == "Okay": words_mob.highlight("green") - self.dither(2) + self.wait(2) else: words_mob.highlight() intersecting_lines = [ @@ -440,7 +440,7 @@ class GeneralPositionRule(Scene): words_mob )) first_time = False - self.dither() + self.wait() self.remove(*self.mobjects) @@ -464,7 +464,7 @@ class LineCorrespondsWithPair(CircleScene): self.lines.remove(line) self.dots.remove(dot0) self.dots.remove(dot1) - self.dither() + self.wait() self.play(*[ ApplyMethod(mob.fade, 0.2) for mob in self.lines + self.dots @@ -535,7 +535,7 @@ class IllustrateNChooseK(Scene): ) self.add(*nrange_mobs) - self.dither() + self.wait() run_time = 6.0 frame_time = run_time / len(tuples) for tup, count in zip(tuples, it.count()): @@ -546,7 +546,7 @@ class IllustrateNChooseK(Scene): tuple_copy.highlight() self.add(tuple_copy) self.add(tuple_mobs[count]) - self.dither(frame_time) + self.wait(frame_time) self.remove(count_mob) self.remove(tuple_copy) self.add(count_mob) @@ -605,11 +605,11 @@ class IntersectionPointCorrespondances(CircleScene): self.play(Highlight(intersection_dot)) self.remove(intersection_dot_arrow) self.play(*fade_outs) - self.dither() + self.wait() self.add(line_statement) self.play(*line_highlights) self.remove(line_statement) - self.dither() + self.wait() self.add(dots_statement, *dot_pointers) self.play(*dot_highlights) self.remove(dots_statement, *dot_pointers) @@ -664,7 +664,7 @@ class QuadrupletsToIntersections(CircleScene): dot_quad = Mobject(*dot_quad) dot_quad.highlight() self.add(dot_quad) - self.dither(frame_time / 3) + self.wait(frame_time / 3) self.play(Transform( dot_quad, intersection_dot, @@ -689,7 +689,7 @@ class GraphsAndEulersFormulaJoke(Scene): self.play(CounterclockwiseTransform( deepcopy(graph), eulers )) - self.dither() + self.wait() self.remove(*self.mobjects) self.add(eulers) self.play(CounterclockwiseTransform( @@ -714,7 +714,7 @@ class DefiningGraph(GraphScene): self.remove(all_dots) self.add(*dots) self.play(FadeIn(vertices_word)) - self.dither() + self.wait() self.remove(vertices_word) self.play(*[ ShowCreation(line) for line in lines @@ -773,7 +773,7 @@ class DoubledEdges(GraphScene): ] outward_curved_lines.append(outward) self.play(*anims) - self.dither() + self.wait() self.remove(*outward_curved_lines) class EulersFormula(GraphScene): @@ -822,7 +822,7 @@ class EulersFormula(GraphScene): num_offset = new_form[letter].get_center(), run_time = frame_time*len(items) ) - self.dither() + self.wait() if item_type == "mobject": self.remove(*items) self.add(new_form[symbol]) @@ -849,10 +849,10 @@ class CannotDirectlyApplyEulerToMoser(CircleScene): self.play(*[ ShowCreation(dot) for dot in yellow_dots ], run_time = 1.0) - self.dither() + self.wait() self.remove(*yellow_dots) self.play(ShowCreation(yellow_lines)) - self.dither() + self.wait() self.remove(yellow_lines) cannot_intersect = TextMobject(r""" Euler's formula does not apply to \\ @@ -863,7 +863,7 @@ class CannotDirectlyApplyEulerToMoser(CircleScene): for mob in self.mobjects: mob.fade(0.3) self.add(cannot_intersect) - self.dither() + self.wait() self.remove(cannot_intersect) for mob in self.mobjects: mob.fade(1/0.3) @@ -921,7 +921,7 @@ class ShowMoserGraphLines(CircleScene): ]) self.add(plus_2_n_choose_4) self.play(ShowCreation(yellow_lines)) - self.dither() + self.wait() self.remove(yellow_lines) self.chop_circle_at_points() self.play(*[ @@ -1058,13 +1058,13 @@ class ApplyEulerToMoser(CircleScene): CounterclockwiseTransform(d[1], d[2], run_time = 2.0) for d in [V, minus, E, plus, F, equals, two] ]) - self.dither() + self.wait() F[1].highlight() self.add(*self.lines + self.circle_pieces) for region in self.regions: self.highlight_region(region) self.highlight_region(self.exterior, "blue") - self.dither() + self.wait() self.reset_background() F[1].highlight("white") E[1].highlight() @@ -1083,7 +1083,7 @@ class ApplyEulerToMoser(CircleScene): ) for cp, scp in zip(self.circle_pieces, self.smaller_circle_pieces) ]) - self.dither() + self.wait() E[1].highlight("white") V[1].highlight() self.add(*self.dots + self.intersection_dots) @@ -1101,13 +1101,13 @@ class ApplyEulerToMoser(CircleScene): ) for line in self.lines + self.circle_pieces ]) - self.dither() + self.wait() all_mobs = [mob for mob in self.mobjects] self.remove(*all_mobs) self.add(*[d[1] for d in [V, minus, E, plus, F, equals, two]]) V[1].highlight("white") two[1].highlight() - self.dither() + self.wait() self.add(*all_mobs) self.remove(*[d[1] for d in [V, minus, E, plus, F, equals, two]]) self.play( @@ -1117,7 +1117,7 @@ class ApplyEulerToMoser(CircleScene): for d in [F, equals, E, minus, plus, two] ] ) - self.dither() + self.wait() self.remove(*self.mobjects) self.play( Transform(E[3], Mobject( @@ -1138,7 +1138,7 @@ class ApplyEulerToMoser(CircleScene): ], run_time = 2.0 ) - self.dither() + self.wait() self.remove(*self.mobjects) self.play( Transform( @@ -1151,7 +1151,7 @@ class ApplyEulerToMoser(CircleScene): nc41, minus1, nc4, plus, two] ] ) - self.dither() + self.wait() self.remove(*self.mobjects) self.play( Transform(nc41[5], nc4[6]), @@ -1161,7 +1161,7 @@ class ApplyEulerToMoser(CircleScene): for d in [F, equals, nc2, plus1, nc4, plus, two] ] ) - self.dither() + self.wait() self.remove(*self.mobjects) self.play( CounterclockwiseTransform(two[6], two[7]), @@ -1171,13 +1171,13 @@ class ApplyEulerToMoser(CircleScene): for d in [F, equals, nc2, plus1, nc4] ] ) - self.dither() + self.wait() self.add(*self.lines + self.circle_pieces) for region in self.regions: self.highlight_region(region) - self.dither() + self.wait() self.highlight_region(self.exterior, "blue") - self.dither() + self.wait() self.highlight_region(self.exterior, "black") self.remove(two[6]) two = two[7] @@ -1210,7 +1210,7 @@ class FormulaRelatesToPowersOfTwo(Scene): self.play(*[ FadeIn(s) for s in sums ]) - self.dither() + self.wait() self.play(*[ Transform(deepcopy(s), result) for s, result in zip(sums, results) @@ -1222,7 +1222,7 @@ class FormulaRelatesToPowersOfTwo(Scene): ).highlight() for i, result in zip(pof2_range, results) ] - self.dither() + self.wait() self.remove(*self.mobjects) self.add(*forms + sums + results) self.play(*[ @@ -1255,18 +1255,18 @@ class PascalRuleExample(PascalsTriangleScene): def __init__(self, nrows, *args, **kwargs): assert(nrows > 1) PascalsTriangleScene.__init__(self, nrows, *args, **kwargs) - self.dither() + self.wait() n = randint(2, nrows-1) k = randint(1, n-1) self.coords_to_mobs[n][k].highlight("green") - self.dither() + self.wait() plus = TexMobject("+").scale(0.5) nums_above = [self.coords_to_mobs[n-1][k-1], self.coords_to_mobs[n-1][k]] plus.center().shift(sum(map(Mobject.get_center, nums_above)) / 2) self.add(plus) for mob in nums_above + [plus]: mob.highlight("yellow") - self.dither() + self.wait() class PascalsTriangleWithNChooseK(PascalsTriangleScene): def __init__(self, *args, **kwargs): @@ -1274,7 +1274,7 @@ class PascalsTriangleWithNChooseK(PascalsTriangleScene): self.generate_n_choose_k_mobs() mob_dicts = (self.coords_to_mobs, self.coords_to_n_choose_k) for i in [0, 1]: - self.dither() + self.wait() self.remove(*self.mobjects) self.play(*[ CounterclockwiseTransform( @@ -1296,7 +1296,7 @@ class PascalsTriangleNChooseKExample(PascalsTriangleScene): def __init__(self, nrows, n, k, *args, **kwargs): PascalsTriangleScene.__init__(self, nrows, *args, **kwargs) - dither_time = 0.5 + wait_time = 0.5 triangle_terms = [self.coords_to_mobs[a][b] for a, b in self.coords] formula_terms = left, n_mob, k_mob, right = TexMobject([ r"\left(", str(n), r"\atop %d"%k, r"\right)" @@ -1304,7 +1304,7 @@ class PascalsTriangleNChooseKExample(PascalsTriangleScene): formula_center = (SPACE_WIDTH - 1, SPACE_HEIGHT - 1, 0) self.remove(*triangle_terms) self.add(*formula_terms) - self.dither() + self.wait() self.play(* [ ShowCreation(mob) for mob in triangle_terms @@ -1323,19 +1323,19 @@ class PascalsTriangleNChooseKExample(PascalsTriangleScene): self.add(a_mob) for mob in row: mob.highlight("green") - self.dither(dither_time) + self.wait(wait_time) if a < n: for mob in row: mob.highlight("white") self.remove(a_mob) - self.dither() + self.wait() for b in range(k+1): b_mob = TexMobject(str(b)) b_mob.shift(k_mob.get_center()) b_mob.highlight("yellow") self.add(b_mob) self.coords_to_mobs[n][b].highlight("yellow") - self.dither(dither_time) + self.wait(wait_time) if b < k: self.coords_to_mobs[n][b].highlight("green") self.remove(b_mob) @@ -1344,7 +1344,7 @@ class PascalsTriangleNChooseKExample(PascalsTriangleScene): for mob in triangle_terms if mob != self.coords_to_mobs[n][k] ]) - self.dither() + self.wait() class PascalsTriangleSumRows(PascalsTriangleScene): def __init__(self, *args, **kwargs): @@ -1395,7 +1395,7 @@ class PascalsTriangleSumRows(PascalsTriangleScene): FadeIn(equalses[n]), run_time = run_time ) - self.dither() + self.wait() self.remove(*to_remove) self.add(*powers_of_two) for n in range(self.nrows): @@ -1437,7 +1437,7 @@ class MoserSolutionInPascal(PascalsTriangleScene): ) target_terms.append(new_term) self.add(*terms) - self.dither() + self.wait() self.play(* [ FadeIn(self.coords_to_n_choose_k[n0][k0]) @@ -1448,7 +1448,7 @@ class MoserSolutionInPascal(PascalsTriangleScene): for term, target_term in zip(terms, target_terms) ] ) - self.dither() + self.wait() term_range = range(0, min(4, n)+1, 2) target_terms = dict([ (k, deepcopy(self.coords_to_mobs[n][k]).highlight(term_color)) @@ -1467,7 +1467,7 @@ class MoserSolutionInPascal(PascalsTriangleScene): for k in term_range ] ) - self.dither() + self.wait() for k in term_range: if k == 0: above_terms = [self.coords_to_n_choose_k[n-1][k]] @@ -1484,7 +1484,7 @@ class MoserSolutionInPascal(PascalsTriangleScene): Mobject(*above_terms).highlight(term_color) )) self.remove(*above_terms) - self.dither() + self.wait() terms_sum = TexMobject(str(moser_function(n))) terms_sum.shift((SPACE_WIDTH-1, terms[0].get_center()[1], 0)) terms_sum.highlight(term_color) @@ -1552,7 +1552,7 @@ class ExplainNChoose2Formula(Scene): a_mob = nums.pop(a-1) nums_compound = Mobject(*nums) self.add(a_mob, nums_compound) - self.dither() + self.wait() right_shift = b_mob.get_center() - a_mob.get_center() right_shift[1] = 0 self.play( @@ -1687,13 +1687,13 @@ class IntersectionChoppingExamples(Scene): lines = [Line(*pair).scale(2) for pair in pairs] self.add(TexMobject(exp).shift((0, SPACE_HEIGHT-1, 0))) self.add(*lines) - self.dither() + self.wait() self.play(*[ Transform(line, deepcopy(line).scale(1.2).scale_in_place(1/1.2)) for line in lines ]) self.count(lines, run_time = 3.0, num_offset = ORIGIN) - self.dither() + self.wait() self.remove(*self.mobjects) diff --git a/old_projects/mug.py b/old_projects/mug.py index 0891eddb..2ba68d08 100644 --- a/old_projects/mug.py +++ b/old_projects/mug.py @@ -57,9 +57,9 @@ class HappyHolidays(TeacherStudentsScene): look_at_arg = SPACE_HEIGHT*UP, ) self.look_at(self.teacher.get_corner(UP+LEFT)) - self.dither(2) + self.wait(2) self.play(self.teacher.change, "happy") - self.dither(2) + self.wait(2) def get_hat(self, pi): hat = SVGMobject( @@ -239,7 +239,7 @@ class PauseIt(PiCreatureScene): self.pi_creature_says( "Pause it!", target_mode = "surprised" ) - self.dither(2) + self.wait(2) class AboutToyPuzzles(UtilitiesPuzzleScene, TeacherStudentsScene, ThreeDScene): def construct(self): @@ -276,7 +276,7 @@ class AboutToyPuzzles(UtilitiesPuzzleScene, TeacherStudentsScene, ThreeDScene): Write(no_crossing_words[0]), GrowArrow(no_crossing_words[1]), ) - self.dither() + self.wait() self.objects.add_to_back(lines, no_crossing_words) @@ -325,12 +325,12 @@ class AboutToyPuzzles(UtilitiesPuzzleScene, TeacherStudentsScene, ThreeDScene): Write(eulers), FadeIn(cube) ) - self.dither(5) + self.wait(5) self.play( GrowArrow(arrow_from_eulers), Write(tda) ) - self.dither(2) + self.wait(2) self.set_variables_as_attrs( eulers, cube, tda, @@ -362,7 +362,7 @@ class AboutToyPuzzles(UtilitiesPuzzleScene, TeacherStudentsScene, ThreeDScene): self.change_student_modes( *["pondering"]*3, look_at_arg = everything ) - self.dither(5) + self.wait(5) class ThisPuzzleIsHard(UtilitiesPuzzleScene, PiCreatureScene): def construct(self): @@ -525,7 +525,7 @@ class ThisPuzzleIsHard(UtilitiesPuzzleScene, PiCreatureScene): run_time = 3, submobject_mode = "lagged_start" )) - self.dither() + self.wait() ###### @@ -584,7 +584,7 @@ class IntroduceGraph(PiCreatureScene): FadeIn(vertex_arrows), FadeIn(vertices_word), ) - self.dither() + self.wait() self.play(LaggedStart( ApplyMethod, lines, lambda l : (l.rotate_in_place, np.pi/12), @@ -594,7 +594,7 @@ class IntroduceGraph(PiCreatureScene): FadeIn(edge_word), GrowArrow(edge_arrow), ) - self.dither(2) + self.wait(2) line = lines[2] self.play( line.set_points_smoothly, [ @@ -606,9 +606,9 @@ class IntroduceGraph(PiCreatureScene): ], VGroup(edge_word, edge_arrow).shift, MED_LARGE_BUFF*LEFT, ) - self.dither() + self.wait() self.play(ReplacementTransform(graph_word, planar_graph_word)) - self.dither(2) + self.wait(2) ### @@ -653,7 +653,7 @@ class IsK33Planar(UtilitiesPuzzleScene): run_time = 3, submobject_mode = "lagged_start" )) - self.dither(2) + self.wait(2) class TwoKindsOfViewers(PiCreatureScene, UtilitiesPuzzleScene): def construct(self): @@ -676,7 +676,7 @@ class TwoKindsOfViewers(PiCreatureScene, UtilitiesPuzzleScene): non_eulers = VGroup(*filter(lambda m : m is not eulers, words)) self.add(words) - self.dither() + self.wait() self.play( pi1.shift, 2*LEFT, pi2.shift, 2*RIGHT, @@ -697,14 +697,14 @@ class TwoKindsOfViewers(PiCreatureScene, UtilitiesPuzzleScene): FadeIn(dont), pi2.change, "maybe", eulers, ) - self.dither() + self.wait() self.pi_creature_thinks( pi1, "", bubble_kwargs = {"width" : 3, "height" : 2}, target_mode = "thinking" ) self.play(pi2.change, "confused", eulers) - self.dither() + self.wait() ### Out of thin air self.play(*map(FadeOut, [ @@ -717,14 +717,14 @@ class TwoKindsOfViewers(PiCreatureScene, UtilitiesPuzzleScene): GrowArrow(arrow), LaggedStart(DrawBorderThenFill, VGroup(*it.chain(*objects))) ) - self.dither() + self.wait() self.play( objects.move_to, eulers, RIGHT, eulers.move_to, objects, LEFT, path_arc = np.pi, run_time = 1.5, ) - self.dither(2) + self.wait(2) ### @@ -749,14 +749,14 @@ class IntroduceRegions(UtilitiesPuzzleScene): run_time = 3, )) self.add_foreground_mobjects(lines, objects) - self.dither() + self.wait() for region in front_regions: self.play(FadeIn(region)) self.play( FadeIn(back_region), Animation(front_regions), ) - self.dither() + self.wait() self.play(FadeOut(regions)) ##Paint bucket @@ -792,7 +792,7 @@ class IntroduceRegions(UtilitiesPuzzleScene): self.add_foreground_mobjects(front_regions, lines, objects) click(back_region) self.remove_foreground_mobjects(front_regions) - self.dither() + self.wait() self.play( FadeOut(back_region), FadeOut(front_regions[0]), @@ -822,7 +822,7 @@ class IntroduceRegions(UtilitiesPuzzleScene): for point_set in point_sets ]) - self.dither() + self.wait() for line in escape_lines: self.play(ShowCreation(line, rate_func = lambda t : 0.8*smooth(t) @@ -868,7 +868,7 @@ class FromLastVideo(Scene): self.add(title) self.play(ShowCreation(rect)) - self.dither(2) + self.wait(2) class AskAboutRegions(IntroduceRegions): def construct(self): @@ -897,7 +897,7 @@ class AskAboutRegions(IntroduceRegions): self.add(front_regions) self.add_foreground_mobjects(lines, objects) - self.dither() + self.wait() self.play(MoveToTarget(front_regions)) self.play(LaggedStart( ApplyMethod, front_regions, @@ -907,7 +907,7 @@ class AskAboutRegions(IntroduceRegions): run_time = 1 )) self.play(front_regions.restore) - self.dither() + self.wait() #Show missing lines for line in missing_lines: @@ -940,10 +940,10 @@ class AskAboutRegions(IntroduceRegions): anims.append(ApplyMethod(last_region.restore)) anims.append(Animation(front_regions)) self.play(*anims, run_time = 0.25) - self.dither(0.5) + self.wait(0.5) last_region = region self.play(last_region.restore) - self.dither() + self.wait() self.play(FadeOut(count)) #Count edges per region @@ -987,7 +987,7 @@ class AskAboutRegions(IntroduceRegions): FadeOut(last_region), FadeOut(last_line_group), ) - self.dither() + self.wait() class NewRegionClosedOnlyForNodesWithEdges(UtilitiesPuzzleScene): def construct(self): @@ -1022,16 +1022,16 @@ class NewRegionClosedOnlyForNodesWithEdges(UtilitiesPuzzleScene): self.play(ShowCreation(line)) lines[-1].pointwise_become_partial(lines[-1], 0, 0.92) lines[-1].save_state() - self.dither() + self.wait() self.play(ShowCreation(lines[-1])) self.add(region, lines, objects) - self.dither() + self.wait() self.remove(region) self.play(ShowCreation(lines[-1], rate_func = lambda t : smooth(1-2*t*(1-t)) )) self.add(region, lines, objects) - self.dither() + self.wait() self.remove(region) self.play( ShowCreation(lines[-1], @@ -1044,7 +1044,7 @@ class NewRegionClosedOnlyForNodesWithEdges(UtilitiesPuzzleScene): self.play(ShowCreationThenDestruction(lit_line)) self.play(lines[-1].restore) self.add(region, lines, objects) - self.dither(2) + self.wait(2) class LightUpNodes(IntroduceRegions): CONFIG = { @@ -1127,7 +1127,7 @@ class LightUpNodes(IntroduceRegions): FadeIn(dim_word), LaggedStart(GrowArrow, dim_arrows) ) - self.dither() + self.wait() self.play(*map(FadeOut, [ lit_word, lit_arrow, dim_word, dim_arrows ])) @@ -1149,7 +1149,7 @@ class LightUpNodes(IntroduceRegions): self.get_lit_vertex_animations(houses[0]), self.get_count_change_animations(1, 0, 0) )) - self.dither() + self.wait() for line, vertex in (lines[1], houses[1]), (lines[4], utilities[1]): self.play( ShowCreation(line), @@ -1159,7 +1159,7 @@ class LightUpNodes(IntroduceRegions): self.get_lit_vertex_animations(vertex), self.get_count_change_animations(1, 0, 0), )) - self.dither() + self.wait() self.play( ShowCreation(lines[3], run_time = 2), *self.get_count_change_animations(0, 1, 0) @@ -1170,7 +1170,7 @@ class LightUpNodes(IntroduceRegions): FadeIn(region), *self.get_count_change_animations(0, 0, 1) ) - self.dither() + self.wait() #Next region, lines 2, 7, 8 region = regions[3] @@ -1185,7 +1185,7 @@ class LightUpNodes(IntroduceRegions): ), self.get_count_change_animations(1, 1, 0) )) - self.dither() + self.wait() self.play( ShowCreation(lines[7]), *self.get_count_change_animations(0, 1, 1) @@ -1193,7 +1193,7 @@ class LightUpNodes(IntroduceRegions): self.add_foreground_mobjects(line_groups[2]) self.add_foreground_mobjects(objects) self.play(FadeIn(region)) - self.dither() + self.wait() #### @@ -1305,7 +1305,7 @@ class ShowRule(TeacherStudentsScene): *["confused"]*3, look_at_arg = rule ) - self.dither(2) + self.wait(2) self.play( Write(nine_total), self.teacher.change, "happy", @@ -1314,7 +1314,7 @@ class ShowRule(TeacherStudentsScene): *["thinking"]*3, look_at_arg = rule ) - self.dither(3) + self.wait(3) class ConcludeFiveRegions(LightUpNodes): def construct(self): @@ -1351,7 +1351,7 @@ class ConcludeFiveRegions(LightUpNodes): Indicate(self.f_count), *map(Animation, self.mobjects) ) - self.dither() + self.wait() def show_nine_lines_to_start(self): line_sets = self.get_straight_lines() @@ -1370,7 +1370,7 @@ class ConcludeFiveRegions(LightUpNodes): for lines in line_sets: self.play(LaggedStart(ShowCreation, lines, run_time = 1)) self.play(MoveToTarget(lines)) - self.dither() + self.wait() ghost_lines = line_sets.copy() ghost_lines.fade(0.9) @@ -1406,10 +1406,10 @@ class ConcludeFiveRegions(LightUpNodes): side_lines_rect.highlight(WHITE) self.play(ShowCreation(side_lines_rect)) - self.dither() + self.wait() self.play(ReplacementTransform(side_lines_rect, f_rect)) self.play(FadeOut(f_rect)) - self.dither() + self.wait() def conclude_about_five_regions(self): lines = self.lines @@ -1429,7 +1429,7 @@ class ConcludeFiveRegions(LightUpNodes): Animation(objects), *self.get_count_change_animations(0, 1, 1) ) - self.dither() + self.wait() #Conclude words = TextMobject("Last line must \\\\ introduce 5th region") @@ -1445,7 +1445,7 @@ class ConcludeFiveRegions(LightUpNodes): self.play(FadeIn(randy)) self.play(randy.change, "pondering") self.play(Blink(randy)) - self.dither(2) + self.wait(2) class WhatsWrongWithFive(TeacherStudentsScene): def construct(self): @@ -1453,7 +1453,7 @@ class WhatsWrongWithFive(TeacherStudentsScene): "What's wrong with \\\\ 5 regions?", target_mode = "maybe" ) - self.dither(2) + self.wait(2) class CyclesHaveAtLeastFour(UtilitiesPuzzleScene): def construct(self): @@ -1515,11 +1515,11 @@ class CyclesHaveAtLeastFour(UtilitiesPuzzleScene): FadeIn(new_count), ] self.play(*anims) - self.dither() + self.wait() last_word = word last_arrow = arrow count = new_count - self.dither(2) + self.wait(2) class FiveRegionsFourEdgesEachGraph(Scene): CONFIG = { @@ -1577,7 +1577,7 @@ class FiveRegionsFourEdgesEachGraph(Scene): LaggedStart(ShowCreation, all_edges), LaggedStart(GrowFromCenter, all_vertices), ) - self.dither() + self.wait() self.add_foreground_mobjects(words) self.set_variables_as_attrs(words, squares) @@ -1652,7 +1652,7 @@ class FiveRegionsFourEdgesEachGraph(Scene): replace_mobject_with_target_in_scene = True, ), ) - self.dither(2) + self.wait(2) self.set_variables_as_attrs( regions, all_edges, back_region, @@ -1697,7 +1697,7 @@ class FiveRegionsFourEdgesEachGraph(Scene): ) count = new_count last_region = VGroup(region, region.edges) - self.dither() + self.wait() self.add_foreground_mobjects(count) self.play( FadeOut(last_region), @@ -1731,7 +1731,7 @@ class FiveRegionsFourEdgesEachGraph(Scene): self.add_foreground_mobjects(edge) self.play(FadeIn(r1), run_time = 0.5) self.play(FadeIn(r2), Animation(r1), run_time = 0.5) - self.dither(0.5) + self.wait(0.5) self.play(*map(FadeOut, [r2, r1, edge]), run_time = 0.5) self.remove_foreground_mobjects(edge) @@ -1757,7 +1757,7 @@ class FiveRegionsFourEdgesEachGraph(Scene): GrowFromCenter(brace), Write(words) ) - self.dither() + self.wait() for edge in edges: new_count = Integer(count.number + 1) new_count.replace(count, dim_to_match = 1) @@ -1768,7 +1768,7 @@ class FiveRegionsFourEdgesEachGraph(Scene): run_time = 0.5 ) count = new_count - self.dither() + self.wait() class EulersFormulaForGeneralPlanarGraph(LightUpNodes, ThreeDScene): CONFIG = { @@ -1824,7 +1824,7 @@ class EulersFormulaForGeneralPlanarGraph(LightUpNodes, ThreeDScene): ] self.add_foreground_mobjects(vertices[0]) - self.dither() + self.wait() for edge, obj in pairs: anims = [ShowCreation(edge)] if obj in vertices: @@ -1838,7 +1838,7 @@ class EulersFormulaForGeneralPlanarGraph(LightUpNodes, ThreeDScene): anims += self.get_count_change_animations(0, 1, 1) self.play(*anims) self.add_foreground_mobjects(edge) - self.dither() + self.wait() self.set_variables_as_attrs(edges, vertices, regions) @@ -1873,11 +1873,11 @@ class EulersFormulaForGeneralPlanarGraph(LightUpNodes, ThreeDScene): MoveToTarget(group), Write(group.symbols) ) - self.dither() + self.wait() self.play(Write(twos)) - self.dither() + self.wait() self.play(Write(words)) - self.dither() + self.wait() self.top_formula = VGroup(count_titles, count_titles.symbols, twos[0]) self.bottom_formula = VGroup(counts, counts.symbols, twos[1]) @@ -1916,12 +1916,12 @@ class EulersFormulaForGeneralPlanarGraph(LightUpNodes, ThreeDScene): self.play(ReplacementTransform(regions, cube, run_time = 2)) cube.sort_submobjects(lambda p : -p[2]) self.add(AmbientRotation(cube, axis = UP, in_place = False)) - self.dither(3) + self.wait(3) self.play( FadeOut(self.top_formula), FadeIn(new_formula) ) - self.dither(10) + self.wait(10) ### @@ -1951,12 +1951,12 @@ class YouGaveFriendsAnImpossiblePuzzle(TeacherStudentsScene): "angry", "sassy", "angry", added_anims = [self.teacher.change, "happy"] ) - self.dither(2) + self.wait(2) class FunnyStory(TeacherStudentsScene): def construct(self): self.teacher_says("Funny story", target_mode = "hooray") - self.dither() + self.wait() self.change_student_modes( *["happy"]*3, added_anims = [RemovePiCreatureBubble( @@ -1965,7 +1965,7 @@ class FunnyStory(TeacherStudentsScene): )], look_at_arg = UP+2*RIGHT ) - self.dither(5) + self.wait(5) class QuestionWrapper(Scene): def construct(self): @@ -1979,34 +1979,34 @@ class QuestionWrapper(Scene): screen_rect.next_to(question, DOWN) self.play(ShowCreation(screen_rect)) - self.dither() + self.wait() for word in question: self.play(LaggedStart( FadeIn, word, run_time = 0.05*len(word) )) - self.dither(0.05) - self.dither() + self.wait(0.05) + self.wait() class Homework(TeacherStudentsScene): def construct(self): self.teacher_says("Consider this \\\\ homework") self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) self.student_says( "$V-E+F=0$ on \\\\ a torus!", target_mode = "hooray" ) - self.dither() + self.wait() self.teacher_says("Not good enough!", target_mode = "surprised") self.change_student_modes(*["confused"]*3) - self.dither(2) + self.wait(2) class WantToLearnMore(Scene): def construct(self): text = TextMobject("Want to learn more?") self.play(Write(text)) - self.dither() + self.wait() class PatreonThanks(PatreonEndScreen): CONFIG = { diff --git a/old_projects/music_and_measure.py b/old_projects/music_and_measure.py index d8622539..83b26abf 100644 --- a/old_projects/music_and_measure.py +++ b/old_projects/music_and_measure.py @@ -173,7 +173,7 @@ class IntervalScene(NumberLineScene): shrink = not remove_as_you_go for fraction, count in zip(rationals(), range(num_fractions)): frac_mob, tick = self.add_fraction(fraction, shrink) - self.dither(pause_time) + self.wait(pause_time) if remove_as_you_go: self.remove(frac_mob, tick) @@ -278,23 +278,23 @@ class TwoChallenges(Scene): self.add(two_challenges) - self.dither() + self.wait() self.add(one, notes) - self.dither() + self.wait() self.add(two, measure) - self.dither() + self.wait() self.play(ShowCreation(arrow_to_int)) self.add(integration) - self.dither() + self.wait() self.play(ShowCreation(arrow_to_prob)) self.add(probability) - self.dither() + self.wait() class MeasureTheoryToHarmony(IntervalScene): def construct(self): IntervalScene.construct(self) self.cover_fractions() - self.dither() + self.wait() all_mobs = Mobject(*self.mobjects) all_mobs.sort_points() self.clear() @@ -305,7 +305,7 @@ class MeasureTheoryToHarmony(IntervalScene): self.play(Vibrate(rate_func = smooth)) self.clear() self.add(line) - self.dither() + self.wait() class ChallengeOne(Scene): @@ -334,7 +334,7 @@ class ChallengeOne(Scene): r_constraint = TexMobject("(1 2 and log2-np.round(log2) == 0 and n < self.n_layers: - self.dither() + self.wait() self.rescale() run_time /= 1.3 last_dot_layer = dot_layer @@ -432,9 +432,9 @@ class PatreonLogo(Scene): words.scale(2) words.to_edge(DOWN) self.play(Write(words1)) - self.dither(2) + self.wait(2) self.play(Transform(words1, words2)) - self.dither(2) + self.wait(2) class PatreonLogin(Scene): pass @@ -485,13 +485,13 @@ class PythagoreanTransformation(Scene): self.play(ShowCreation(tri1, run_time = 2)) self.play(*map(Write, [a, b, c])) - self.dither() + self.wait() self.play( FadeIn(c_square), Animation(c) ) self.play(Transform(c, c_square_tex)) - self.dither(2) + self.wait(2) mover = tri1.copy() for copy in copies: self.play(Transform( @@ -501,7 +501,7 @@ class PythagoreanTransformation(Scene): self.add(copy) self.remove(mover) self.add(big_square, *[tri1]+copies) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [a, b, c, c_square])) self.play( tri3.shift, @@ -510,12 +510,12 @@ class PythagoreanTransformation(Scene): ) self.play(tri2.shift, 2*RIGHT) self.play(tri4.shift, 3*UP) - self.dither() + self.wait() self.play(FadeIn(a_square)) self.play(FadeIn(b_square)) self.play(Write(a_square_tex)) self.play(Write(b_square_tex)) - self.dither(2) + self.wait(2) class KindWordsOnEoLA(TeacherStudentsScene): def construct(self): @@ -564,7 +564,7 @@ class MakeALotOfPiCreaturesHappy(Scene): self.add(pis) pis.generate_target() - self.dither() + self.wait() for pi, color in zip(pis.target, colors): pi.change_mode("hooray") # pi.scale_in_place(1) @@ -636,7 +636,7 @@ class IntegrationByParts(Scene): self.draw_curve(curve) self.play(ShowCreation(rect)) self.play(*map(Write, [down_brace, left_brace, f_T, g_T])) - self.dither() + self.wait() self.play(FadeIn(upper_right)) self.play( ShowCreation( @@ -648,7 +648,7 @@ class IntegrationByParts(Scene): Animation(rect) ) self.play(Write(equation[0])) - self.dither() + self.wait() self.play(FadeIn(lower_left)) self.play( ShowCreation( @@ -660,9 +660,9 @@ class IntegrationByParts(Scene): Animation(rect) ) self.play(Write(equation[1])) - self.dither() + self.wait() self.play(Write(equation[2])) - self.dither() + self.wait() def draw_curve(self, curve): lp, lnum, comma, rnum, rp = coords = TexMobject( @@ -682,7 +682,7 @@ class IntegrationByParts(Scene): run_time = 5, rate_func = None ) - self.dither() + self.wait() self.play(*map(FadeOut, [coords, dot])) class EndScreen(TeacherStudentsScene): diff --git a/old_projects/putnam.py b/old_projects/putnam.py index 2259cf6c..809c821a 100644 --- a/old_projects/putnam.py +++ b/old_projects/putnam.py @@ -133,19 +133,19 @@ class IntroducePutnam(Scene): ReplacementTransform(six_hours.copy(), three_hours_copy), *map(ShowCreation, rects) ) - self.dither() + self.wait() self.play(LaggedStart( DrawBorderThenFill, out_of_tens, run_time = 3, stroke_color = YELLOW )) - self.dither() + self.wait() self.play(ReplacementTransform( out_of_tens.copy(), VGroup(out_of_120), submobject_mode = "lagged_start", run_time = 2, )) - self.dither() + self.wait() self.play( title.next_to, median_words.copy(), LEFT, LARGE_BUFF, MoveToTarget(out_of_120), @@ -154,7 +154,7 @@ class IntroducePutnam(Scene): self.play(Write(median)) for difficulty in difficulties: self.play(FadeIn(difficulty)) - self.dither() + self.wait() class NatureOf5sAnd6s(TeacherStudentsScene): CONFIG = { @@ -173,7 +173,7 @@ class NatureOf5sAnd6s(TeacherStudentsScene): look_at_arg = test ) ) - self.dither() + self.wait() mover = VGroup( test.questions[-1].copy(), @@ -196,7 +196,7 @@ class NatureOf5sAnd6s(TeacherStudentsScene): self.change_student_modes(*["pondering"]*3) self.play(Transform(mover[1], new_words)) self.look_at((SPACE_WIDTH*RIGHT + SPACE_HEIGHT*UP)/2) - self.dither(4) + self.wait(4) ### @@ -225,7 +225,7 @@ class OtherVideoClips(Scene): self.play(ReplacementTransform(last_title, title)) else: self.play(FadeIn(title)) - self.dither(3) + self.wait(3) last_title = title class IntroduceTetrahedron(ExternallyAnimatedScene): @@ -246,13 +246,13 @@ class IntroduceTetrahedronSupplement(Scene): num.replace(title[0], dim_to_match = 1) num.highlight(YELLOW) self.add(num) - self.dither(0.7) + self.wait(0.7) self.remove(num) self.add(title[0]) self.play(FadeIn(title[1], submobject_mode = "lagged_start")) - self.dither(2) + self.wait(2) self.play(Write(question)) - self.dither(2) + self.wait(2) class IntroduceTetrahedronFootnote(Scene): def construct(self): @@ -262,7 +262,7 @@ class IntroduceTetrahedronFootnote(Scene): """) words.to_corner(UP+LEFT) self.add(words) - self.dither(2) + self.wait(2) class HowDoYouStart(TeacherStudentsScene): def construct(self): @@ -271,10 +271,10 @@ class HowDoYouStart(TeacherStudentsScene): target_mode = "raise_left_hand" ) self.change_student_modes("confused", "raise_left_hand", "erm") - self.dither() + self.wait() self.teacher_says("Try a simpler case.") self.change_student_modes(*["thinking"]*3) - self.dither(2) + self.wait(2) class TwoDCase(Scene): CONFIG = { @@ -328,7 +328,7 @@ class TwoDCase(Scene): rate_func = lambda t : smooth(1-t), remover = True )) - self.dither() + self.wait() self.set_variables_as_attrs(circle, center_dot) @@ -357,17 +357,17 @@ class TwoDCase(Scene): self.play(LaggedStart(DrawBorderThenFill, point_mobs)) self.play(FadeIn(triangle)) - self.dither() + self.wait() self.play(LaggedStart(Write, point_labels)) - self.dither() + self.wait() self.play(Write(question)) for x in range(self.n_initial_random_choices): self.change_point_mobs_randomly() - self.dither() + self.wait() angles = self.get_point_mob_angles() target_angles = [5*np.pi/8, 7*np.pi/8, 0] self.change_point_mobs([ta - a for a, ta in zip(angles, target_angles)]) - self.dither() + self.wait() def simplify_further(self): morty = Mortimer().flip() @@ -390,7 +390,7 @@ class TwoDCase(Scene): Write(bubble.content) ) self.play(Blink(morty)) - self.dither() + self.wait() self.play( morty.change, "happy", morty.fade, 1, @@ -424,7 +424,7 @@ class TwoDCase(Scene): d_thetas = 2*np.pi*np.random.random(self.n_p3_random_moves) for d_theta in d_thetas: self.change_point_mobs([0, 0, d_theta]) - self.dither() + self.wait() self.set_variables_as_attrs(push_pins) @@ -451,7 +451,7 @@ class TwoDCase(Scene): ) self.change_point_mobs([0, 0, np.pi/4 - angles[1]]) self.change_point_mobs([0, 0, 0.99*np.pi], run_time = 4) - self.dither() + self.wait() self.set_variables_as_attrs(all_arcs, arc, arc_lines) @@ -467,21 +467,21 @@ class TwoDCase(Scene): self.play(ShowCreation(line)) self.play(FadeIn(all_arcs), Animation(point_mobs)) self.remove(self.circle) - self.dither() + self.wait() self.play( all_arcs.space_out_submobjects, 1.5, Animation(point_mobs), rate_func = there_and_back, run_time = 1.5, ) - self.dither() + self.wait() self.change_point_mobs( [0, 0, np.mean(angles[:2])+np.pi-angles[2]] ) - self.dither() + self.wait() for x in range(3): self.change_point_mobs([0, 0, np.pi/2]) - self.dither() + self.wait() def ask_about_probability_p3_lands_in_this_arc(self): arc = self.arc @@ -518,7 +518,7 @@ class TwoDCase(Scene): [0, 0, 1.35*np.pi - angles[2]], run_time = 0, ) - self.dither() + self.wait() question.add(equals) self.arc_prob_question = question @@ -559,7 +559,7 @@ class TwoDCase(Scene): proportion_update = ChangingDecimal(proportion, proportion_update_func) self.play(ShowCreation(elbow), FadeIn(ninety_degrees)) - self.dither() + self.wait() self.play( ApplyMethod( arc.rotate_in_place, np.pi/12, @@ -567,7 +567,7 @@ class TwoDCase(Scene): ) ) self.play(LaggedStart(FadeIn, proportion, run_time = 1)) - self.dither() + self.wait() #Non right angles angle_pairs = [ @@ -582,7 +582,7 @@ class TwoDCase(Scene): VGroup(elbow, ninety_degrees).fade, 1, ) self.remove(elbow, ninety_degrees) - self.dither() + self.wait() self.set_variables_as_attrs(proportion, proportion_update) @@ -602,7 +602,7 @@ class TwoDCase(Scene): self.change_point_mobs_to_angles( [1.2*np.pi, 0.3*np.pi] ) - self.dither() + self.wait() self.set_variables_as_attrs(brace, average) @@ -637,11 +637,11 @@ class TwoDCase(Scene): Animation(point_mobs) ) self.update_animations.append(self.triangle_update) - self.have_p3_jump_around_randomly(8, dither_time = 0.25) + self.have_p3_jump_around_randomly(8, wait_time = 0.25) self.play(ReplacementTransform( self.proportion.copy(), VGroup(one_fourth) )) - self.have_p3_jump_around_randomly(32, dither_time = 0.25) + self.have_p3_jump_around_randomly(32, wait_time = 0.25) ##### @@ -801,13 +801,13 @@ class TwoDCase(Scene): points = [pm.get_center() - self.center for pm in point_mobs] return np.array(map(angle_of_vector, points)) - def have_p3_jump_around_randomly(self, n_jumps, dither_time = 0.75, run_time = 0): + def have_p3_jump_around_randomly(self, n_jumps, wait_time = 0.75, run_time = 0): for x in range(n_jumps): self.change_point_mobs( [0, 0, 2*np.pi*random.random()], run_time = run_time ) - self.dither(dither_time) + self.wait(wait_time) class FixThreePointsOnSphere(ExternallyAnimatedScene): pass @@ -828,18 +828,18 @@ class AverageSizeOfSphericalTriangleSectionSupplement(Scene): words.scale_to_fit_width(2*SPACE_WIDTH - 1) words.to_edge(DOWN) self.play(Write(words)) - self.dither(3) + self.wait(3) class TryASurfaceIntegral(TeacherStudentsScene): def construct(self): self.student_says("Can you do \\\\ a surface integral?") self.change_student_modes("confused", "raise_left_hand", "confused") - self.dither() + self.wait() self.teacher_says( "I mean...you can \\emph{try}", target_mode = "sassy", ) - self.dither(2) + self.wait(2) class RevisitTwoDCase(TwoDCase): CONFIG = { @@ -902,7 +902,7 @@ class RevisitTwoDCase(TwoDCase): positions = [ORIGIN, RIGHT, LEFT] frac.next_to(self.circle, RIGHT, 1.5*LARGE_BUFF) - def place_random_triangles(n, dither_time): + def place_random_triangles(n, wait_time): for x in range(n): self.change_point_mobs_randomly(run_time = 0) contain_center = self.points_contain_center( @@ -921,7 +921,7 @@ class RevisitTwoDCase(TwoDCase): decimal.next_to(frac, RIGHT, SMALL_BUFF) self.add(decimal, *nums) - self.dither(dither_time) + self.wait(wait_time) self.remove(decimal, *nums) return VGroup(decimal, *nums) @@ -932,7 +932,7 @@ class RevisitTwoDCase(TwoDCase): place_random_triangles(10, 0.25) nums = place_random_triangles(self.n_random_trials, 0.05) self.add(nums) - self.dither() + self.wait() self.play(*map(FadeOut, [frac, nums, title])) def add_lines_and_comment_on_them(self): @@ -959,13 +959,13 @@ class RevisitTwoDCase(TwoDCase): LaggedStart(FadeIn, arcs, run_time = 1), Animation(self.point_mobs), ) - self.dither() + self.wait() self.add(center_line_shadows) self.play(MoveToTarget(center_lines)) self.play(ShowCreation(rect), Write(words1)) - self.dither(2) + self.wait(2) self.play(ReplacementTransform(words1, words2)) - self.dither(2) + self.wait(2) self.play( center_lines.restore, center_lines.fade, 1, @@ -1034,7 +1034,7 @@ class RevisitTwoDCase(TwoDCase): ShowCreation(cross), point_label_groups.fade, 1, ) - self.dither() + self.wait() #Choose two random lines self.center_lines_update.update(1) @@ -1051,8 +1051,8 @@ class RevisitTwoDCase(TwoDCase): for x in range(6): point_mob.rotate(np.pi, about_point = self.center) self.point_labels_update.update(1) - self.dither(0.5) - self.dither(0.5) + self.wait(0.5) + self.wait(0.5) def choose_p1_and_p2(): for group in point_label_groups[:2]: @@ -1100,9 +1100,9 @@ class RevisitTwoDCase(TwoDCase): p3_group.restore, p3_group.set_fill, YELLOW, 1 ) - self.dither() + self.wait() self.play(Swap(*words[2:4])) - self.dither() + self.wait() #Once the continuous randomness is handled rect = SurroundingRectangle(VGroup(words[1], words[3])) @@ -1114,7 +1114,7 @@ class RevisitTwoDCase(TwoDCase): self.play(ShowCreation(rect)) self.play(GrowFromCenter(brace)) self.play(Write(brace_text)) - self.dither() + self.wait() self.random_procedure_words = words @@ -1148,7 +1148,7 @@ class RevisitTwoDCase(TwoDCase): *self.update_animations, run_time = np.sqrt(2)/4 #Hacky reasons to be irrational ) - self.dither() + self.wait() self.revert_to_original_skipping_status() do_the_rounds() @@ -1157,10 +1157,10 @@ class RevisitTwoDCase(TwoDCase): self.update_animations.remove(arc_update) self.update_animations.remove(second_arc_update) self.play(FadeIn(self.triangle)) - self.dither() + self.wait() self.update_animations.insert(0, self.triangle_update) do_the_rounds() - self.dither() + self.wait() self.change_point_mobs_randomly() for x in range(2): do_the_rounds() @@ -1172,7 +1172,7 @@ class ThisIsWhereItGetsGood(TeacherStudentsScene): target_mode = "hooray" ) self.change_student_modes(*["hooray"]*3) - self.dither(2) + self.wait(2) class ContrastTwoRandomProcesses(TwoDCase): CONFIG = { @@ -1220,7 +1220,7 @@ class ContrastTwoRandomProcesses(TwoDCase): self.show_creation_of_circle_group(left_circles) self.play(Write(vs)) self.show_creation_of_circle_group(right_circles) - self.dither() + self.wait() def show_creation_of_circle_group(self, group): circles = group[:3] @@ -1272,12 +1272,12 @@ class Rewrite3DRandomProcedure(Scene): ) self.play(FadeIn(words[0])) self.play(ShowCreation(cross)) - self.dither() + self.wait() self.play(LaggedStart(FadeIn, words[1])) self.play(LaggedStart(FadeIn, words[2])) - self.dither(2) + self.wait(2) self.play(Write(words[3])) - self.dither(3) + self.wait(3) class AntipodalViewOfThreeDCase(ExternallyAnimatedScene): pass @@ -1293,7 +1293,7 @@ class ThreeDAnswer(Scene): words[1].highlight(BLUE) self.play(Write(words)) - self.dither(2) + self.wait(2) class FormalWriteupScreenCapture(ExternallyAnimatedScene): pass @@ -1311,7 +1311,7 @@ class Formality(TeacherStudentsScene): target_mode = "sassy" ) self.change_student_modes("confused", "sassy", "erm") - self.dither() + self.wait() self.play( Write(words), FadeOut(self.students[1].bubble), @@ -1322,7 +1322,7 @@ class Formality(TeacherStudentsScene): *["pondering"]*3, look_at_arg = words ) - self.dither(8) + self.wait(8) class ProblemSolvingTakeaways(Scene): def construct(self): @@ -1349,10 +1349,10 @@ class ProblemSolvingTakeaways(Scene): points.next_to(group, DOWN, LARGE_BUFF) self.play(Write(title), ShowCreation(underline)) - self.dither() + self.wait() for point in points: self.play(Write(point)) - self.dither(3) + self.wait(3) class BrilliantPuzzle(PiCreatureScene): CONFIG = { @@ -1403,7 +1403,7 @@ class BrilliantPuzzle(PiCreatureScene): lambda m : (m.change, "horrified", m.test) ) ) - self.dither() + self.wait() self.play(LaggedStart( ApplyMethod, students, lambda m : (m.change, "conniving") @@ -1411,13 +1411,13 @@ class BrilliantPuzzle(PiCreatureScene): self.play(LaggedStart(ShowCreation, arrows)) for x in range(2): self.swap_arrows_randomly(arrows) - self.dither() + self.wait() circles = self.circle_students() self.play(Write(question)) for x in range(10): self.swap_arrows_randomly(arrows, FadeOut(circles)) circles = self.circle_students() - self.dither() + self.wait() #### @@ -1505,15 +1505,15 @@ class Promotion(PiCreatureScene): self.pi_creature.change, "raise_right_hand" ) self.play(ShowCreation(rect)) - self.dither(2) + self.wait(2) self.change_mode("thinking") - self.dither() + self.wait() self.look_at(url) - self.dither(10) + self.wait(10) self.change_mode("happy") - self.dither(10) + self.wait(10) self.change_mode("raise_right_hand") - self.dither(10) + self.wait(10) self.remove(rect) self.play( @@ -1522,7 +1522,7 @@ class Promotion(PiCreatureScene): url_rect = SurroundingRectangle(url) self.play(ShowCreation(url_rect)) self.play(FadeOut(url_rect)) - self.dither(3) + self.wait(3) class AddedPromoWords(Scene): def construct(self): @@ -1536,7 +1536,7 @@ class AddedPromoWords(Scene): words.highlight_by_tex("pi", PINK) self.play(Write(words)) - self.dither() + self.wait() class PatreonThanks(PatreonEndScreen): CONFIG = { diff --git a/old_projects/qa_round_two.py b/old_projects/qa_round_two.py index ff75fc34..0aa2774c 100644 --- a/old_projects/qa_round_two.py +++ b/old_projects/qa_round_two.py @@ -71,7 +71,7 @@ class Announcements(PiCreatureScene): self.pi_creature.change, "hooray", underline, ) self.play(self.pi_creature.change, "confused", announcements) - self.dither(2) + self.wait(2) class PowersOfTwo(Scene): @@ -174,17 +174,17 @@ class PiHoldingScreen(PiCreatureScene): ShowCreation(screen), morty.change, "raise_right_hand", screen ) - self.dither(10) + self.wait(10) self.play( morty.change, "hooray", words[0], Write(words[0]) ) - self.dither(10) + self.wait(10) self.play( morty.change, "pondering", words[1], Transform(words[0], words[1]) ) - self.dither(10) + self.wait(10) class QuestionsLink(Scene): def construct(self): @@ -192,7 +192,7 @@ class QuestionsLink(Scene): link.scale_to_fit_width(2*SPACE_WIDTH) link.to_edge(DOWN) self.play(Write(link)) - self.dither() + self.wait() class Thumbnail(Scene): def construct(self): diff --git a/old_projects/tattoo.py b/old_projects/tattoo.py index 6eda1ed7..502cedce 100644 --- a/old_projects/tattoo.py +++ b/old_projects/tattoo.py @@ -131,21 +131,21 @@ class ReactionsToTattoo(PiCreatureScene): ] tattoo_on_math = TextMobject("Tattoo on \\\\ math") tattoo_on_math.to_edge(UP) - self.dither(2) + self.wait(2) for mode in modes: self.play( self.pi_creature.change_mode, mode, self.pi_creature.look, UP+RIGHT ) - self.dither(2) + self.wait(2) self.play( Write(tattoo_on_math), self.pi_creature.change_mode, "hooray", self.pi_creature.look, UP ) - self.dither() + self.wait() self.change_mode("happy") - self.dither(2) + self.wait(2) def create_pi_creature(self): @@ -170,14 +170,14 @@ class IntroduceCSC(TrigRepresentationsScene): brace = Brace(csc_line, LEFT) self.play(Write(Cam_S_C)) - self.dither() + self.wait() self.play(Transform(Cam_S_C, CSC)) - self.dither() + self.wait() self.play(Transform(Cam_S_C, csc)) self.remove(Cam_S_C) self.add(csc) self.play(Write(of_theta)) - self.dither(2) + self.wait(2) csc_of_theta.add_to_back(BackgroundRectangle(csc)) self.play( @@ -194,7 +194,7 @@ class IntroduceCSC(TrigRepresentationsScene): ShowCreation(csc_line), csc.highlight, csc_line.get_color(), ) - self.dither(3) + self.wait(3) class TeachObscureTrigFunctions(TeacherStudentsScene): def construct(self): @@ -210,9 +210,9 @@ class TeachObscureTrigFunctions(TeacherStudentsScene): target_mode = "pleading", added_anims = [content.to_corner, UP+RIGHT] ) - self.dither() + self.wait() self.play(self.get_teacher().change_mode, "pondering") - self.dither(3) + self.wait(3) class CanYouExplainTheTattoo(TeacherStudentsScene): def construct(self): @@ -222,7 +222,7 @@ class CanYouExplainTheTattoo(TeacherStudentsScene): """) self.random_blink() self.play(self.get_teacher().change_mode, "hooray") - self.dither() + self.wait() class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): CONFIG = { @@ -273,12 +273,12 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): ShowCreation(arrow), ShowCreation(dot) ) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(one) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ words, arrow, brace, one ])) @@ -299,7 +299,7 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): GrowFromCenter(cos_brace), Write(cos_text), ) - self.dither() + self.wait() self.change_mode("well") mover = VGroup( @@ -327,7 +327,7 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): self.theta_value = thetas[0] self.change_mode("happy") - self.dither() + self.wait() self.sin_group, self.cos_group = sin_group, cos_group def show_tangent_and_cotangent(self): @@ -356,13 +356,13 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): text.save_state() text.next_to(frac, LEFT) self.play(Write(VGroup(text, frac))) - self.dither() + self.wait() self.change_mode("confused") - self.dither() + self.wait() self.play(*map(FadeOut, [ tan_frac, cot_frac, self.sin_group, self.cos_group ])) - self.dither() + self.wait() self.play( self.theta_group[-1].highlight, YELLOW, @@ -377,7 +377,7 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): GrowFromCenter(brace), text.restore, ) - self.dither() + self.wait() small_lines.add(small_line) self.play(FadeOut(line), Animation(small_lines)) @@ -406,7 +406,7 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): self.theta_value = thetas[0] self.change_mode("happy") - self.dither(2) + self.wait(2) self.tangent_line = self.get_tangent_line() self.add(self.tangent_line) @@ -443,22 +443,22 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): Write(frac), self.pi_creature.change_mode, "erm" ) - self.dither() - self.dither() + self.wait() + self.wait() for group in sec_group, csc_group: line, brace, text, dot = group dot.save_state() dot.move_to(text) dot.set_fill(opacity = 0) self.play(dot.restore) - self.dither() + self.wait() self.play( ShowCreation(line), GrowFromCenter(brace), text.restore, self.pi_creature.change_mode, "pondering" ) - self.dither() + self.wait() mover = VGroup( sec_group, @@ -494,7 +494,7 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): self.theta_value = thetas[0] self.change_mode("confused") - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ sec_group, sec_frac @@ -552,7 +552,7 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): ApplyMethod(tri1.rotate_in_place, np.pi/12, rate_func = wiggle), self.pi_creature.change_mode, "thinking" ) - self.dither() + self.wait() tri1.save_state() self.play(Transform(tri1, tri2, path_arc = np.pi/2)) self.play(Write(arc_theta)) @@ -560,18 +560,18 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): tri1.rotate_in_place, np.pi/12, rate_func = wiggle )) - self.dither(2) + self.wait(2) self.play( Write(question), ShowCreation(arrow), self.pi_creature.change_mode, "confused" ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [question, arrow])) self.play(Write(opp_over_hyp)) - self.dither() + self.wait() csc_subgroup.save_state() self.play( tri1.restore, @@ -582,11 +582,11 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): GrowFromCenter(sin_brace), Write(sin_text) ) - self.dither() + self.wait() self.play(Write(one)) - self.dither() + self.wait() self.play(Write(frac1)) - self.dither() + self.wait() self.play( Transform(tri1, tri2), FadeOut(sin_group) @@ -595,9 +595,9 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): radial_line.rotate_in_place, np.pi/12, rate_func = wiggle ) - self.dither() + self.wait() self.play(csc_subgroup.restore) - self.dither() + self.wait() self.play(Write(frac2)) self.change_mode("happy") self.play(FadeOut(opp_over_hyp)) @@ -629,12 +629,12 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): dem2.move_to, num2, path_arc = np.pi ) - self.dither() + self.wait() self.play( dem2.move_to, frac2[2], VGroup(*frac2[1:3]).set_fill, BLACK, 0 ) - self.dither() + self.wait() def summarize_full_group(self): scale_factor = 1.5 @@ -676,16 +676,16 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene): if func_name in ["sec", "csc", "cot"]: to_fade.add(*self.get_mobjects_from_last_animation()) if func_name is "sec": - self.dither() - self.dither() + self.wait() + self.wait() self.change_mode("surprised") - self.dither(2) + self.wait(2) self.remove(self.tangent_line) self.play( FadeOut(to_fade), self.pi_creature.change_mode, "sassy" ) - self.dither(2) + self.wait(2) def get_line_brace_text(self, func_name = "sin"): line = self.get_trig_line(func_name) @@ -756,7 +756,7 @@ class RenameAllInTermsOfSine(Scene): for mob, shift_val in zip(mobs, shift_vals): mob.shift(shift_val) self.play(Write(mobs)) - self.dither() + self.wait() for mob, rhs_mob in zip(mobs, rhs_mobs): rhs_mob.next_to(mob) rhs_mob.highlight(sin.target_color) @@ -768,7 +768,7 @@ class RenameAllInTermsOfSine(Scene): map(MoveToTarget, mobs), [Write(rhs_mobs)] ])) - self.dither(2) + self.wait(2) anims = [] for mob, rhs_mob in zip(mobs, rhs_mobs)[1:3]: @@ -778,7 +778,7 @@ class RenameAllInTermsOfSine(Scene): mob.highlight, mob.target_color, ] self.play(*anims) - self.dither() + self.wait() new_rhs_mobs = [ TexMobject("=\\frac{1}{\\%s(\\theta)}"%s).highlight(color) @@ -798,7 +798,7 @@ class RenameAllInTermsOfSine(Scene): Transform(rhs, new_rhs) ] self.play(*anims) - self.dither(2) + self.wait(2) class MisMatchOfCoPrefix(TeacherStudentsScene): def construct(self): @@ -865,30 +865,30 @@ class Credit(Scene): ) self.play(Write(url)) self.play(morty.change_mode, "happy") - self.dither(2) + self.wait(2) self.play(Blink(morty)) - self.dither(2) + self.wait(2) self.play( morty.change_mode, "raise_right_hand", morty.look_at, url ) - self.dither(2) + self.wait(2) self.play( morty.change_mode, "happy", morty.look_at, book ) self.play(FadeIn(book)) self.play(ShowCreation(border)) - self.dither(2) + self.wait(2) self.play(Blink(morty)) - self.dither() + self.wait() self.play( morty.change_mode, "thinking", morty.look_at, book ) - self.dither(2) + self.wait(2) self.play(Blink(morty)) - self.dither(4) + self.wait(4) self.play(Blink(morty)) diff --git a/old_projects/tau_poem.py b/old_projects/tau_poem.py index 72f22e01..22dbbaca 100644 --- a/old_projects/tau_poem.py +++ b/old_projects/tau_poem.py @@ -83,7 +83,7 @@ class HappyTauDayWords(Scene): pi = PiCreature().move_to(2*RIGHT + 3*DOWN) pi.highlight("red") self.add(words, tau, pi) - self.dither() + self.wait() self.play(BlinkPiCreature(tau)) self.play(BlinkPiCreature(pi)) @@ -163,7 +163,7 @@ class TauPoem(Scene): self.play(ApplyMethod( self.first_digits.shift, shift_val, run_time = 2.0 )) - self.dither(2) + self.wait(2) self.play_over_time_range(0, 2, Transform( deepcopy(self.first_word), self.number_word, @@ -201,7 +201,7 @@ class TauPoem(Scene): 0.8 ) self.add(two_pi) - self.dither() + self.wait() self.play(CounterclockwiseTransform( two_pi, sphere, rate_func = lambda t : 2*smooth(t/2) @@ -213,7 +213,7 @@ class TauPoem(Scene): )) self.remove(sphere) self.add(tau) - self.dither() + self.wait() def line2(self): tau = TauCreature() @@ -231,13 +231,13 @@ class TauPoem(Scene): for eyes in zip(blinked.eyes, tau.eyes) ]) self.play(ShowCreation(tau.mouth)) - self.dither(2) + self.wait(2) def line3(self): tau = TauCreature().make_sad() pi = PiCreature() self.add(*tau.parts) - self.dither() + self.wait() self.play( Transform(tau.leg, pi.left_leg), ShowCreation(pi.right_leg), @@ -261,7 +261,7 @@ class TauPoem(Scene): def line4(self): pi, bubble = self.pi_speaking("Conventions matter \\\\ not!") self.add(pi) - self.dither() + self.wait() self.play(Transform( Point(bubble.tip).highlight("black"), bubble @@ -298,14 +298,14 @@ class TauPoem(Scene): mob.sort_points(np.linalg.norm) self.add(bubble) - self.dither() + self.wait() self.remove(bubble) bubble_copy = deepcopy(bubble) self.play(CounterclockwiseTransform(bubble_copy, heart)) - self.dither() + self.wait() self.remove(bubble_copy) self.play(CounterclockwiseTransform(heart, bubble)) - self.dither() + self.wait() def line8(self): @@ -314,7 +314,7 @@ class TauPoem(Scene): two = ImageMobject("big2").scale(0.5).shift(1.6*LEFT + 0.1*DOWN) self.add(two, *pi.parts) - self.dither() + self.wait() self.play( Transform(pi.left_leg, tau.leg), Transform( @@ -341,7 +341,7 @@ class TauPoem(Scene): Mobject.highlight(new_pi, "black") self.add(tau) - self.dither() + self.wait() self.play(Transform(point, pi)) self.remove(point) self.add(pi) @@ -418,7 +418,7 @@ class TauPoem(Scene): FadeOut(sine), FadeIn(tau), ) - self.dither() + self.wait() def line13(self): @@ -433,11 +433,11 @@ class TauPoem(Scene): tau.rewire_part_attributes() self.add(*formula) - self.dither() + self.wait() self.play(CounterclockwiseTransform(two_pi, tau)) self.remove(two_pi) self.play(BlinkPiCreature(tau)) - self.dither() + self.wait() def line14(self): pi, bubble = self.pi_speaking( @@ -459,7 +459,7 @@ class TauPoem(Scene): ]).split() self.add(pi, bubble, *formula) - self.dither(2) + self.wait(2) self.play(ApplyMethod(half.highlight, "yellow")) def line16(self): @@ -503,7 +503,7 @@ class TauPoem(Scene): ShowCreation(line, run_time = 1.0) for line in lines ]) - self.dither() + self.wait() def line18(self): tau = TauCreature() @@ -519,7 +519,7 @@ class TauPoem(Scene): blinked_pi = deepcopy(pi).blink() self.add(*pi.parts + tau.parts) - self.dither(0.8) + self.wait(0.8) self.play(*[ Transform(*eyes, run_time = 0.2, rate_func = rush_into) for eyes in [ @@ -567,7 +567,7 @@ class TauPoem(Scene): WalkPiCreature(sad_pi, DOWN+4*LEFT), run_time = 1.0 ) - self.dither() + self.wait() def line19(self): pass diff --git a/old_projects/triangle_of_power/end.py b/old_projects/triangle_of_power/end.py index e0592411..a795ee33 100644 --- a/old_projects/triangle_of_power/end.py +++ b/old_projects/triangle_of_power/end.py @@ -39,7 +39,7 @@ class DontLearnFromSymbols(Scene): self.add(randy) self.play(FadeIn(bubble)) - self.dither() + self.wait() top = bubble.content bubble.add_content(equation) self.play( @@ -49,7 +49,7 @@ class DontLearnFromSymbols(Scene): Write(q_marks), run_time = 1 ) - self.dither(3) + self.wait(3) class NotationReflectsMath(Scene): @@ -68,7 +68,7 @@ class NotationReflectsMath(Scene): Write(better_questions), run_time = 3 ) - self.dither(2) + self.wait(2) class AsymmetriesInTheMath(Scene): def construct(self): @@ -89,11 +89,11 @@ class AsymmetriesInTheMath(Scene): log.highlight(RED) self.play(FadeIn(assyms_of_top)) - self.dither() + self.wait() self.play(FadeIn(assyms_of_math)) - self.dither() + self.wait() self.play(Write(VMobject(rad, log))) - self.dither() + self.wait() class AddedVsOplussed(Scene): def construct(self): @@ -110,7 +110,7 @@ class AddedVsOplussed(Scene): oplus.highlight(BLUE) self.add(top, left_dot, plus, right_times) - self.dither() + self.wait() self.play( Transform( VMobject(left_dot, plus, right_times), @@ -118,7 +118,7 @@ class AddedVsOplussed(Scene): path_arc = np.pi/2 ) ) - self.dither() + self.wait() @@ -135,7 +135,7 @@ class ReciprocalTop(Scene): end_two.highlight(YELLOW) self.add(top, start_two, x) - self.dither() + self.wait() self.play( Transform( VMobject(start_two, x), @@ -143,7 +143,7 @@ class ReciprocalTop(Scene): ), ApplyMethod(top.rotate, np.pi, UP, path_arc = np.pi/7) ) - self.dither() + self.wait() @@ -158,21 +158,21 @@ class NotSymbolicPatterns(Scene): substantive_reasoning.to_edge(RIGHT).shift(DOWN) self.add(randy, symbolic_patterns) - self.dither() + self.wait() self.play(ShowCreation(line)) self.play( Write(substantive_reasoning), ApplyMethod(randy.change_mode, "pondering_looking_left"), run_time = 1 ) - self.dither(2) + self.wait(2) self.play( ApplyMethod(line.shift, 10*DOWN), ApplyMethod(substantive_reasoning.shift, 10*DOWN), ApplyMethod(randy.change_mode, "sad"), run_time = 1 ) - self.dither(2) + self.wait(2) class ChangeWeCanBelieveIn(Scene): def construct(self): @@ -186,7 +186,7 @@ class ChangeWeCanBelieveIn(Scene): FadeOut(change), GrowFromCenter(top) ) - self.dither(3) + self.wait(3) @@ -205,7 +205,7 @@ class TriangleOfPowerIsBetter(Scene): alts.next_to(greater_than, RIGHT) self.play(Write(VMobject(top, greater_than, alts))) - self.dither() + self.wait() class InYourOwnNotes(Scene): @@ -216,9 +216,9 @@ class InYourOwnNotes(Scene): ] for anim in anims: self.add(anim.mobject) - self.dither(2) + self.wait(2) self.play(*anims) - self.dither(2) + self.wait(2) def get_log_anim(self, center): @@ -282,9 +282,9 @@ class Qwerty(Scene): d3.shift(0.95*RIGHT) self.add(qwerty) - self.dither(2) + self.wait(2) self.play(Transform(qwerty, dvorak)) - self.dither(2) + self.wait(2) class ShowLog(Scene): @@ -300,9 +300,9 @@ class ShowLog(Scene): old_eq.to_edge(UP) self.play(FadeIn(equation)) - self.dither(3) + self.wait(3) self.play(FadeIn(old_eq)) - self.dither(2) + self.wait(2) class NoOneWillActuallyDoThis(Scene): @@ -341,7 +341,7 @@ class NoOneWillActuallyDoThis(Scene): ) self.remove(words) self.play(Blink(randy)) - self.dither(2) + self.wait(2) self.play( FadeOut(bubble), FadeIn(morty), @@ -350,9 +350,9 @@ class NoOneWillActuallyDoThis(Scene): ) morty_bubble.add_content(final_words) self.play(Write(final_words)) - self.dither() + self.wait() self.play(Blink(morty)) - self.dither(2) + self.wait(2) self.play(ShowCreation(lil_thought_bubble)) diff --git a/old_projects/triangle_of_power/intro.py b/old_projects/triangle_of_power/intro.py index 2d03ec57..f9768221 100644 --- a/old_projects/triangle_of_power/intro.py +++ b/old_projects/triangle_of_power/intro.py @@ -96,7 +96,7 @@ class Notation(Scene): self.play(Write(notation)) self.play(Write(self.symbols)) - self.dither() + self.wait() self.add(notation, self.symbols) @@ -148,12 +148,12 @@ class Notation(Scene): self.symbols, good_symbols, path_arc = np.pi )) - self.dither(3) + self.wait(3) self.play(Transform( self.symbols, bad_symbols, path_arc = np.pi )) - self.dither() + self.wait() def shift_to_visuals(self): @@ -185,7 +185,7 @@ class Notation(Scene): Write(sum_lines) ) self.play(trig_anim) - self.dither() + self.wait() def get_harmonic_sum_lines(self): result = VMobject() @@ -221,7 +221,7 @@ class ButDots(Scene): but.shift(20*RIGHT) self.play(ApplyMethod(but.shift, 20*LEFT)) self.play(Write(dots, run_time = 5)) - self.dither() + self.wait() class ThreesomeOfNotation(Scene): @@ -243,13 +243,13 @@ class ThreesomeOfNotation(Scene): self.play(Write(log)) self.play(Transform(vars1, vars3, path_arc = -np.pi)) self.play(Write(rad)) - self.dither() + self.wait() words = TextMobject("Artificially unrelated") words.to_corner(UP+RIGHT) words.highlight(YELLOW) self.play(Write(words)) - self.dither() + self.wait() class TwoThreeEightExample(Scene): @@ -280,7 +280,7 @@ class TwoThreeEightExample(Scene): Write(three), run_time = 1 ) - self.dither() + self.wait() exp = TexMobject("2^3") exp.next_to(eq, LEFT) @@ -296,7 +296,7 @@ class TwoThreeEightExample(Scene): ) self.clear() self.add(base_two, exp_three, eq, eight) - self.dither(3) + self.wait(3) rad_three, rad1, rad2, rad_eight, rad_eq, rad_two = \ TexMobject("\\sqrt[3]{8} = 2").split() @@ -311,14 +311,14 @@ class TwoThreeEightExample(Scene): (base_two, rad_two) ] ]) - self.dither() + self.wait() self.play(ApplyMethod( VMobject(rad1, rad2).highlight, RED, rate_func = there_and_back, run_time = 2 )) self.remove(rad1, rad2) - self.dither() + self.wait() l, o, g, log_two, p1, log_eight, p2, log_eq, log_three = \ TexMobject("\\log_2(8) = 3").split() @@ -337,13 +337,13 @@ class TwoThreeEightExample(Scene): (rad_three, log_three) ] ]) - self.dither() + self.wait() self.play(ApplyMethod( VMobject(l, o, g).highlight, RED, rate_func = there_and_back, run_time = 2 )) - self.dither() + self.wait() class WhatTheHell(Scene): def construct(self): @@ -391,10 +391,10 @@ class WhatTheHell(Scene): ShowCreationPerSubmobject(arrow2) ) self.play(Write(q_marks)) - self.dither() + self.wait() self.remove(randy) self.play(Write(VMobject(*phrases))) - self.dither() + self.wait() class Countermathematical(Scene): def construct(self): @@ -404,9 +404,9 @@ class Countermathematical(Scene): mathematical.shift(intuitive.get_left()-mathematical.get_left()) self.add(counterintuitive) - self.dither() + self.wait() self.play(Transform(intuitive, mathematical)) - self.dither() + self.wait() class PascalsCollision(Scene): @@ -431,14 +431,14 @@ class PascalsCollision(Scene): self.add(pascals_triangle, n_choose_k, formula) self.play(Write(words)) - self.dither() + self.wait() self.play( Transform(pascals_triangle, final_triangle), Transform(n_choose_k, final_triangle), FadeOut(formula), ApplyMethod(to_remove.shift, 5*DOWN) ) - self.dither() + self.wait() class LogarithmProperties(Scene): @@ -470,7 +470,7 @@ class LogarithmProperties(Scene): if i%2 == 0: self.play(Blink(randy)) else: - self.dither() + self.wait() class HaveToShare(Scene): @@ -495,9 +495,9 @@ class HaveToShare(Scene): for word in words: self.play(FadeIn(word)) - self.dither() + self.wait() self.play(Write(share, run_time = 1)) - self.dither() + self.wait() diff --git a/old_projects/triangle_of_power/triangle.py b/old_projects/triangle_of_power/triangle.py index ca53f75a..01387f9d 100644 --- a/old_projects/triangle_of_power/triangle.py +++ b/old_projects/triangle_of_power/triangle.py @@ -192,11 +192,11 @@ class IntroduceNotation(Scene): ] self.play(FadeIn(equation)) - self.dither() + self.wait() self.play(ShowCreation(top)) for num in two, three, eight: self.play(ShowCreation(num), run_time=2) - self.dither() + self.wait() class ShowRule(Scene): args_list = [(0,), (1,), (2,)] @@ -226,7 +226,7 @@ class ShowRule(Scene): self.add(equation, top) - self.dither() + self.wait() self.play( Transform(top, new_top), ShowCreation(equals) @@ -235,14 +235,14 @@ class ShowRule(Scene): circle.shift(new_top.triangle.get_center_of_mass()) new_circle = circle.copy() new_top.put_on_vertex(index, new_circle) - self.dither() + self.wait() self.play(ShowCreation(circle)) - self.dither() + self.wait() self.play( Transform(circle, new_circle), ApplyMethod(new_top.values[index].highlight, circle.color) ) - self.dither() + self.wait() class AllThree(Scene): @@ -267,9 +267,9 @@ class AllThree(Scene): for top, eq in zip(tops, equations): self.play(FadeIn(top), FadeIn(eq)) - self.dither(3) + self.wait(3) # self.play(Write(name)) - self.dither() + self.wait() class SixDifferentInverses(Scene): def construct(self): @@ -282,18 +282,18 @@ class SixDifferentInverses(Scene): general_idea = TexMobject("f(f^{-1}(a)) = a") self.play(Write(VMobject(*rules))) - self.dither() + self.wait() for s, color in (rules[:4], GREEN), (rules[4:], RED): mob = VMobject(*s) self.play(ApplyMethod(mob.highlight, color)) - self.dither() + self.wait() self.play(ApplyMethod(mob.highlight, WHITE)) self.play( ApplyMethod(VMobject(*rules[::2]).to_edge, LEFT), ApplyMethod(VMobject(*rules[1::2]).to_edge, RIGHT), GrowFromCenter(general_idea) ) - self.dither() + self.wait() top_rules = get_top_inverse_rules() for rule, top_rule in zip(rules, top_rules): @@ -303,7 +303,7 @@ class SixDifferentInverses(Scene): self.play(*map(FadeOut, rules)) self.remove(*rules) self.play(*map(GrowFromCenter, top_rules)) - self.dither() + self.wait() self.remove(general_idea) rules = get_inverse_rules() original = None @@ -317,7 +317,7 @@ class SixDifferentInverses(Scene): anims.append(FadeIn(original)) original = top_rule.copy() self.play(*anims) - self.dither() + self.wait() self.animate_top_rule(top_rule) self.remove(rule) @@ -350,7 +350,7 @@ class SixDifferentInverses(Scene): FadeOut(VMobject(*cancel_parts)), Transform(lil_symbol, new_symbol, rate_func = rush_from) ) - self.dither() + self.wait() self.remove(lil_symbol, top_rule, VMobject(*cancel_parts)) @@ -378,8 +378,8 @@ class SixSixSix(Scene): ApplyMethod(bubble.add_content, rule), anim ) - self.dither() - self.dither() + self.wait() + self.wait() words = speech_bubble.content equation = bubble.content speech_bubble.clear() @@ -390,7 +390,7 @@ class SixSixSix(Scene): Transform(equation, words), FadeOut(VMobject(*sixes)) ) - self.dither() + self.wait() class AdditiveProperty(Scene): def construct(self): @@ -411,7 +411,7 @@ class AdditiveProperty(Scene): ApplyMethod(exp_rule.highlight, GREEN), ApplyMethod(log_rule.highlight, RED), ) - self.dither() + self.wait() all_tops = filter( lambda m : isinstance(m, TOP), t_exp_rule.split()+t_log_rule.split() @@ -433,7 +433,7 @@ class AdditiveProperty(Scene): ] start_copy = start.copy() self.play(Write(start_copy)) - self.dither() + self.wait() self.play(Transform( VMobject(a1, x1, a2, y1, eq1, a3, p1, x2, a3.copy(), y2), VMobject(a4, x3, a4.copy(), y3, eq2, a5, p2, x4, a6, y4) @@ -441,7 +441,7 @@ class AdditiveProperty(Scene): self.play(Write(end)) self.clear() self.add(start_copy, end) - self.dither() + self.wait() return start_copy, end def get_new_style_rules(self): @@ -478,9 +478,9 @@ class AdditiveProperty(Scene): Transform(top.copy().highlight(YELLOW), circle) ) self.add(*[anim.mobject for anim in anims]) - self.dither() + self.wait() self.play(*anims) - self.dither() + self.wait() def highlight_appropriate_parts(self, t_exp_rule, t_log_rule): #Horribly hacky @@ -518,7 +518,7 @@ class AdditiveProperty(Scene): copies.scale_in_place, 1.2, rate_func = there_and_back )) - self.dither() + self.wait() self.remove(copies) @@ -533,10 +533,10 @@ class DrawInsideTriangle(Scene): times.highlight(YELLOW) self.add(top) - self.dither() + self.wait() for mob in dot, plus, times: self.play(Write(mob, run_time = 1)) - self.dither() + self.wait() class ConstantOnTop(Scene): def construct(self): @@ -560,7 +560,7 @@ class ConstantOnTop(Scene): Write(x_cubed), run_time = 1 ) - self.dither() + self.wait() self.play(*[ Transform(*pair, path_arc = np.pi) for pair in [ @@ -568,10 +568,10 @@ class ConstantOnTop(Scene): (x_cubed, cube_root_x), ] ]) - self.dither(2) + self.wait(2) for mob in dot, times1, times2: self.play(ShowCreation(mob)) - self.dither() + self.wait() def get_const_top_TOP(*args): top = TOP(*args) @@ -603,7 +603,7 @@ class MultiplyWithConstantTop(Scene): old_style_rad.highlight(RED) self.add(top_exp_equation, old_style_exp) - self.dither(3) + self.wait(3) old_tops = [top1, top2, top3] new_tops = [] @@ -620,7 +620,7 @@ class MultiplyWithConstantTop(Scene): path_arc = np.pi/2 ) ) - self.dither(3) + self.wait(3) class RightStaysConstantQ(Scene): def construct(self): @@ -655,7 +655,7 @@ class RightStaysConstantQ(Scene): self.add(randy, bubble) self.play(ApplyMethod(randy.change_mode, "pondering")) - self.dither(3) + self.wait(3) triangle = bubble.content.triangle eight = bubble.content.values[2] bubble.clear() @@ -672,7 +672,7 @@ class RightStaysConstantQ(Scene): ) self.remove(triangle) self.add(equation) - self.dither(4) + self.wait(4) self.play( Transform( symbols_at_top, symbols_at_lower_right, @@ -680,7 +680,7 @@ class RightStaysConstantQ(Scene): ), Transform(old_style_eq1, old_style_eq2) ) - self.dither(2) + self.wait(2) class AOplusB(Scene): @@ -688,7 +688,7 @@ class AOplusB(Scene): self.add(TexMobject( "a \\oplus b = \\dfrac{1}{\\frac{1}{a} + \\frac{1}{b}}" ).scale(2)) - self.dither() + self.wait() class ConstantLowerRight(Scene): @@ -705,7 +705,7 @@ class ConstantLowerRight(Scene): self.play(ShowCreation(eight)) for mob in dot, oplus, times: self.play(ShowCreation(mob)) - self.dither() + self.wait() top.add(eight) top.add(times, oplus, dot) @@ -739,7 +739,7 @@ class ConstantLowerRight(Scene): self.remove(triple_top_copy) self.add(*tops) self.play(Write(old_style_eq)) - self.dither(3) + self.wait(3) syms = VMobject(x, y, xy) new_syms = VMobject(*[ @@ -765,7 +765,7 @@ class ConstantLowerRight(Scene): Transform(syms, new_syms, path_arc = np.pi/2), Transform(big_oplus, big_times) ) - self.dither(4) + self.wait(4) class TowerExponentFrame(Scene): @@ -787,7 +787,7 @@ class TowerExponentFrame(Scene): top2.shift(3*RIGHT) self.add(words, top1, top2) - self.dither() + self.wait() class ExponentialGrowth(Scene): @@ -812,7 +812,7 @@ class ExponentialGrowth(Scene): self.add(words, top, dot, sim) self.show_frame() - self.dither() + self.wait() @@ -824,14 +824,14 @@ class GoExplore(Scene): by_the_way.shift(20*RIGHT) self.play(Write(explore)) - self.dither(4) + self.wait(4) self.play( ApplyMethod( VMobject(explore, by_the_way).shift, 20*LEFT ) ) - self.dither(3) + self.wait(3) diff --git a/old_projects/triples.py b/old_projects/triples.py index f0a40653..a9bead15 100644 --- a/old_projects/triples.py +++ b/old_projects/triples.py @@ -148,7 +148,7 @@ class IntroduceTriples(TeacherStudentsScene): )) self.play(Write(equation)) self.play(c_square.highlight, C_COLOR) - self.dither() + self.wait() self.play(*map(FadeOut, [full_group, equation])) class CompareToFermatsLastTheorem(TeacherStudentsScene): @@ -191,7 +191,7 @@ class CompareToFermatsLastTheorem(TeacherStudentsScene): for pi in self.get_students() ] ) - self.dither() + self.wait() self.play(Transform(low_expression, expressions[2])) self.play( GrowFromCenter(low_brace), @@ -204,7 +204,7 @@ class CompareToFermatsLastTheorem(TeacherStudentsScene): ) for expression in expressions[4:]: self.play(Transform(low_expression, expression)) - self.dither() + self.wait() class WritePythagoreanTriple(Scene): def construct(self): @@ -212,7 +212,7 @@ class WritePythagoreanTriple(Scene): words.scale_to_fit_width(2*SPACE_WIDTH - LARGE_BUFF) words.to_corner(DOWN+LEFT) self.play(Write(words)) - self.dither(2) + self.wait(2) class ShowManyTriples(Scene): def construct(self): @@ -266,7 +266,7 @@ class ShowManyTriples(Scene): Write(title), run_time = 2, ) - self.dither() + self.wait() self.play(MoveToTarget(title)) for i in range(1, 17): new_triangle = triangles[i] @@ -276,14 +276,14 @@ class ShowManyTriples(Scene): Transform(triangle, new_triangle), FadeIn(new_title) ) - self.dither() + self.wait() self.play(MoveToTarget(new_title)) else: self.play( Transform(triangle, new_triangle), FadeIn(new_title.target) ) - self.dither() + self.wait() self.play(FadeOut(triangle)) self.play(LaggedStart( FadeIn, @@ -294,7 +294,7 @@ class ShowManyTriples(Scene): run_time = 5 )) - self.dither(2) + self.wait(2) class BabylonianTablets(Scene): def construct(self): @@ -331,9 +331,9 @@ class BabylonianTablets(Scene): triples.to_edge(RIGHT) self.add(title) - self.dither() + self.wait() self.play(LaggedStart(FadeIn, triples, run_time = 5)) - self.dither() + self.wait() class AskAboutFavoriteProof(TeacherStudentsScene): def construct(self): @@ -343,7 +343,7 @@ class AskAboutFavoriteProof(TeacherStudentsScene): ) self.change_student_modes("happy", "raise_right_hand", "happy") self.teacher_thinks("", target_mode = "thinking") - self.dither() + self.wait() self.zoom_in_on_thought_bubble() class PythagoreanProof(Scene): @@ -377,10 +377,10 @@ class PythagoreanProof(Scene): self.add(triangle, triangle_copy) self.play(Write(side_labels)) - self.dither() + self.wait() self.play(*map(DrawBorderThenFill, squares)) self.add_labels_to_squares(squares, side_labels) - self.dither() + self.wait() self.play( VGroup(triangle_copy, a_square, b_square).move_to, 4*LEFT+2*DOWN, DOWN, @@ -389,17 +389,17 @@ class PythagoreanProof(Scene): run_time = 2, path_arc = np.pi/2, ) - self.dither() + self.wait() self.add_new_triangles( triangle, self.get_added_triangles_to_c_square(triangle, c_square) ) - self.dither() + self.wait() self.add_new_triangles( triangle_copy, self.get_added_triangles_to_ab_squares(triangle_copy, a_square) ) - self.dither() + self.wait() big_squares = VGroup(*map( self.get_big_square, @@ -419,12 +419,12 @@ class PythagoreanProof(Scene): ShowCreation(double_arrow), *map(FadeOut, squares) ) - self.dither(2) + self.wait(2) self.play(*it.chain( map(FadeIn, squares), map(Animation, big_squares), )) - self.dither(2) + self.wait(2) def add_labels_to_squares(self, squares, side_labels): for label, square in zip(side_labels, squares): @@ -575,17 +575,17 @@ class ReframeOnLattice(PiCreatureScene): all_dots = self.get_all_plane_dots() self.play(Write(dot_tuple_group, run_time = 2)) - self.dither() + self.wait() for new_group in dot_tuple_groups[1:len(initial_examples)]: self.play(Transform(dot_tuple_group, new_group)) - self.dither() + self.wait() self.play(LaggedStart( FadeIn, all_dots, rate_func = there_and_back, run_time = 3, lag_ratio = 0.2, )) - self.dither() + self.wait() self.play(ReplacementTransform( dot_tuple_group, final_group )) @@ -623,14 +623,14 @@ class ReframeOnLattice(PiCreatureScene): self.play(Write(group.line)) self.play(FadeIn(group.triangle), Animation(group.line)) - self.dither(2) + self.wait(2) for new_group in dot_tuple_groups[1:]: self.play( Transform(group, new_group), Transform(group.triangle, new_group.triangle), Transform(group.line, new_group.line), ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [group, group.triangle, group.line])) def resize_plane(self): @@ -673,7 +673,7 @@ class ReframeOnLattice(PiCreatureScene): self.plane = new_plane self.plane.coordinate_labels = coordinate_labels self.add(self.plane, coordinate_labels) - self.dither() + self.wait() def show_root_example(self): x, y = (2, 1) @@ -714,11 +714,11 @@ class ReframeOnLattice(PiCreatureScene): ) ) self.play(Write(tuple_label)) - self.dither() + self.wait() self.play(FadeIn(distance_labels[0])) - self.dither(2) + self.wait(2) self.play(Transform(*distance_labels)) - self.dither(2) + self.wait(2) self.distance_label = distance_labels[0] self.example_dot = dot @@ -747,10 +747,10 @@ class ReframeOnLattice(PiCreatureScene): ) self.play(Write(imag_coords)) - self.dither() + self.wait() self.play(FadeOut(tuple_label)) self.play(FadeIn(new_label)) - self.dither(2) + self.wait(2) self.example_label = new_label self.plane.coordinate_labels.add(*imag_coords) @@ -783,7 +783,7 @@ class ReframeOnLattice(PiCreatureScene): ShowCreation(arrow), Write(square_label) ) - self.dither() + self.wait() self.play(RemovePiCreatureBubble( morty, target_mode = "pondering", look_at_arg = self.example_label @@ -820,7 +820,7 @@ class ReframeOnLattice(PiCreatureScene): ), run_time = 2 ) - self.dither() + self.wait() #From top line to second line index_alignment_lists = [ @@ -836,7 +836,7 @@ class ReframeOnLattice(PiCreatureScene): ) for i, j, k in index_alignment ]) - self.dither(2) + self.wait(2) #From second line to final line index_alignment_lists = [ @@ -851,7 +851,7 @@ class ReframeOnLattice(PiCreatureScene): ) for i, j in index_alignment ]) - self.dither() + self.wait() #Move result to appropriate place result_label = final_line.copy() @@ -866,7 +866,7 @@ class ReframeOnLattice(PiCreatureScene): stroke_width = 4, stroke_color = PINK )) - self.dither(2) + self.wait(2) def walk_through_square_geometrically(self): line = self.example_line @@ -899,14 +899,14 @@ class ReframeOnLattice(PiCreatureScene): self.play(ShowCreation(alt_line)) self.play(ShowCreation(line)) self.remove(alt_line) - self.dither() + self.wait() self.play( ShowCreation(arc), Write(theta) ) - self.dither() + self.wait() self.play(Indicate(distance_label)) - self.dither() + self.wait() #Multiply full plane under everything everything = VGroup(*self.get_top_level_mobjects()) @@ -925,7 +925,7 @@ class ReframeOnLattice(PiCreatureScene): Animation(everything), run_time = 1.5 ) - self.dither() + self.wait() #Multiply number by itself ghost_arc = arc.copy().fade() @@ -940,7 +940,7 @@ class ReframeOnLattice(PiCreatureScene): Transform(arc, double_arc), Transform(theta, two_theta), ) - self.dither() + self.wait() five = distance_label[2] distance_label.remove(five) for mob in five, line, dot: @@ -953,7 +953,7 @@ class ReframeOnLattice(PiCreatureScene): *map(MoveToTarget, [five, line, dot]), run_time = 2 ) - self.dither(2) + self.wait(2) #### @@ -985,7 +985,7 @@ class TimeToGetComplex(TeacherStudentsScene): def construct(self): self.teacher_says("Time to \\\\ get complex") self.change_student_modes("angry", "sassy", "pleading") - self.dither(2) + self.wait(2) class OneMoreExample(Scene): CONFIG = { @@ -1061,9 +1061,9 @@ class OneMoreExample(Scene): DrawBorderThenFill(dot) ) self.play(Write(distance_labels[0])) - self.dither() + self.wait() self.play(ReplacementTransform(*distance_labels)) - self.dither() + self.wait() self.distance_label = distance_labels[1] self.line = line @@ -1110,7 +1110,7 @@ class OneMoreExample(Scene): Transform(VGroup(number), top_line), run_time = 2 ) - self.dither() + self.wait() index_alignment_lists = [ [(0, 0, 0), (0, 1, 1), (1, 1, 2), (1, 5, 9)], @@ -1136,7 +1136,7 @@ class OneMoreExample(Scene): ) for i, j, k in index_alignment ]) - self.dither() + self.wait() self.play( Transform(second_line[3], minus), FadeOut(VGroup(*[ @@ -1146,7 +1146,7 @@ class OneMoreExample(Scene): second_line[5].shift, 0.35*RIGHT, ) self.play(VGroup(*second_line[:4]).shift, 0.55*RIGHT) - self.dither() + self.wait() for index_alignment in index_alignment_lists[2:]: self.play(*[ ReplacementTransform( @@ -1155,9 +1155,9 @@ class OneMoreExample(Scene): ) for i, j, k in index_alignment ]) - self.dither() + self.wait() self.play(FadeIn(final_line)) - self.dither() + self.wait() self.final_line = final_line @@ -1178,7 +1178,7 @@ class OneMoreExample(Scene): Animation(self.final_line), DrawBorderThenFill(dot) ) - self.dither() + self.wait() self.play(*[ ReplacementTransform(m1.copy(), m2) for m1, m2 in [ @@ -1186,7 +1186,7 @@ class OneMoreExample(Scene): (self.distance_label, distance_label) ] ]) - self.dither() + self.wait() def show_triangle(self): triangle = Polygon(*[ @@ -1204,7 +1204,7 @@ class OneMoreExample(Scene): )), run_time = 2 ) - self.dither(2) + self.wait(2) class ThisIsMagic(TeacherStudentsScene): def construct(self): @@ -1212,7 +1212,7 @@ class ThisIsMagic(TeacherStudentsScene): "This is magic", target_mode = "hooray" ) self.play(self.teacher.change, "happy") - self.dither(2) + self.wait(2) class GeneralExample(OneMoreExample): CONFIG = { @@ -1275,7 +1275,7 @@ class GeneralExample(OneMoreExample): ShowCreation(line), DrawBorderThenFill(dot) ) - self.dither() + self.wait() self.play( ShowCreation(arrow), FadeIn(z_to_z_squared), @@ -1293,9 +1293,9 @@ class GeneralExample(OneMoreExample): (label, square_label), ] ]) - self.dither() + self.wait() self.play(Write(result_length_label)) - self.dither() + self.wait() self.example_dot = dot self.example_label = label @@ -1339,9 +1339,9 @@ class BoringExample(GeneralExample): ) self.play(Blink(morty)) self.play(morty.change, "tired") - self.dither(2) + self.wait(2) self.play(Blink(morty)) - self.dither() + self.wait() class FiveTwoExample(GeneralExample): CONFIG = { @@ -1448,13 +1448,13 @@ class WriteGeneralFormula(GeneralExample): self.play(*map(FadeIn, [rect, top_line, second_line])) - self.dither() + self.wait() self.play( real_part.copy().next_to, real_part_line.copy(), DOWN, SMALL_BUFF, ShowCreation(real_part_line) ) - self.dither() + self.wait() self.play( FadeOut(VGroup( self.example_label, self.example_dot, self.example_line, @@ -1464,7 +1464,7 @@ class WriteGeneralFormula(GeneralExample): RIGHT, SMALL_BUFF, ShowCreation(imag_part_line) ) - self.dither() + self.wait() self.corner_rect = rect @@ -1488,9 +1488,9 @@ class WriteGeneralFormula(GeneralExample): triangle.replace(line, stretch = True) self.play(Write(hyp_length)) - self.dither() + self.wait() self.play(FadeIn(triangle)) - self.dither() + self.wait() def show_uv_to_triples(self): rect = self.corner_rect.copy() @@ -1620,7 +1620,7 @@ class VisualizeZSquared(Scene): z_to_z_squared.shift(2*RIGHT) self.play(Write(z_to_z_squared)) - self.dither() + self.wait() self.z_to_z_squared = z_to_z_squared def draw_arrows(self): @@ -1673,14 +1673,14 @@ class VisualizeZSquared(Scene): label.add_background_rectangle() self.play(*map(FadeIn, [z_label, z_dot])) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.play(ReplacementTransform( z_dot.copy(), square_dot, path_arc = angle )) self.play(FadeIn(square_label)) - self.dither() + self.wait() self.play( FadeOut(z_label), FadeOut(square_label), @@ -1689,7 +1689,7 @@ class VisualizeZSquared(Scene): arrows.add(arrow) dots.add(z_dot, square_dot) - self.dither() + self.wait() self.play(*map(FadeOut, [ dots, arrows, self.z_to_z_squared ])) @@ -1723,7 +1723,7 @@ class VisualizeZSquared(Scene): run_time = 3, lag_ratio = 0.2 )) - self.dither() + self.wait() self.dots = dots @@ -1738,7 +1738,7 @@ class VisualizeZSquared(Scene): ), Animation(self.dots), ) - self.dither() + self.wait() self.color_grid = color_grid @@ -1757,9 +1757,9 @@ class VisualizeZSquared(Scene): ], run_time = 3 ) - self.dither(2) + self.wait(2) self.play(self.color_grid.set_stroke, None, 3) - self.dither() + self.wait() scale_factor = self.big_dot_radius/self.dot_radius self.play(LaggedStart( ApplyMethod, self.dots, @@ -1767,7 +1767,7 @@ class VisualizeZSquared(Scene): rate_func = there_and_back, run_time = 3 )) - self.dither() + self.wait() def show_triangles(self): z_list = [ @@ -1780,10 +1780,10 @@ class VisualizeZSquared(Scene): triangle.scale(0.01, about_point = triangle.tip) self.play(triangle.restore, run_time = 2) - self.dither(2) + self.wait(2) for new_triangle in triangles[1:]: self.play(Transform(triangle, new_triangle)) - self.dither(2) + self.wait(2) self.play(FadeOut(triangle)) def zoom_out(self): @@ -1810,7 +1810,7 @@ class VisualizeZSquared(Scene): *map(MoveToTarget, movers), run_time = 3 ) - self.dither(2) + self.wait(2) def show_more_triangles(self): z_list = [ @@ -1822,10 +1822,10 @@ class VisualizeZSquared(Scene): triangle = triangles[0] self.play(FadeOut(triangle)) - self.dither(2) + self.wait(2) for new_triangle in triangles[1:]: self.play(Transform(triangle, new_triangle)) - self.dither(2) + self.wait(2) ### @@ -1895,10 +1895,10 @@ class AskAboutHittingAllPoints(TeacherStudentsScene): "Does this hit \\\\ all pythagorean triples?", target_mode = "raise_left_hand" ) - self.dither() + self.wait() self.teacher_says("No", target_mode = "sad") self.change_student_modes(*["hesitant"]*3) - self.dither() + self.wait() class PointsWeMiss(VisualizeZSquared): CONFIG = { @@ -1973,18 +1973,18 @@ class PointsWeMiss(VisualizeZSquared): self.play(FocusOn(dots[0])) self.play(ShowCreation(dots[0])) self.play(Write(labels[0])) - self.dither() + self.wait() self.play(FadeIn(triangles[0])) - self.dither(2) + self.wait(2) self.play(Write(rhss[0])) - self.dither(2) + self.wait(2) groups = triangles, dots, labels, rhss for i in 1, 2: self.play(*[ Transform(group[0], group[i]) for group in groups ]) - self.dither(3) + self.wait(3) self.play(*[ FadeOut(group[0]) for group in groups @@ -2024,11 +2024,11 @@ class PointsWeMiss(VisualizeZSquared): self.play(ShowCreation(dots[0])) self.play(Write(VGroup(labels[0], rhss[0]))) self.play(FadeIn(triangles[0])) - self.dither(3) + self.wait(3) self.play(*[Transform(*group) for group in groups]) - self.dither(3) + self.wait(3) self.play(*[group[0].restore for group in groups]) - self.dither(2) + self.wait(2) def mention_one_half_rule(self): morty = Mortimer() @@ -2041,7 +2041,7 @@ class PointsWeMiss(VisualizeZSquared): "Never need to scale \\\\ by less than $\\frac{1}{2}$" )) self.play(Blink(morty)) - self.dither(2) + self.wait(2) class PointsWeMissAreMultiplesOfOnesWeHit(TeacherStudentsScene): def construct(self): @@ -2055,7 +2055,7 @@ class PointsWeMissAreMultiplesOfOnesWeHit(TeacherStudentsScene): words.highlight_by_tex("hit", GREEN) self.teacher_says(words) self.change_student_modes(*["pondering"]*3) - self.dither(2) + self.wait(2) class DrawSingleRadialLine(PointsWeMiss): def construct(self): @@ -2083,14 +2083,14 @@ class DrawSingleRadialLine(PointsWeMiss): self.play(GrowFromCenter(dot)) self.play(Indicate(dot)) self.play(ShowCreation(line), Animation(dot)) - self.dither() + self.wait() self.play(LaggedStart( DrawBorderThenFill, added_dots, stroke_color = PINK, stroke_width = 4, run_time = 3 )) - self.dither() + self.wait() class DrawRadialLines(PointsWeMiss): CONFIG = { @@ -2176,14 +2176,14 @@ class DrawRadialLines(PointsWeMiss): dot.highlight, RED ) self.play(ReplacementTransform(dot, line)) - self.dither() + self.wait() self.play(LaggedStart( DrawBorderThenFill, line.new_dots, stroke_width = 4, stroke_color = PINK, run_time = 3, )) - self.dither() + self.wait() def show_all_lines(self): seed_dots = VGroup(*[line.seed_dot for line in self.lines]) @@ -2208,7 +2208,7 @@ class DrawRadialLines(PointsWeMiss): stroke_color = PINK, run_time = 3, )) - self.dither() + self.wait() self.new_dots = new_dots @@ -2224,10 +2224,10 @@ class DrawRadialLines(PointsWeMiss): triangle = triangles[0] self.play(FadeIn(triangle)) - self.dither(2) + self.wait(2) for new_triangle in triangles[1:]: self.play(Transform(triangle, new_triangle)) - self.dither(2) + self.wait(2) class RationalPointsOnUnitCircle(DrawRadialLines): CONFIG = { @@ -2282,10 +2282,10 @@ class RationalPointsOnUnitCircle(DrawRadialLines): self.add(circle, self.coordinate_labels) self.play(FadeIn(group)) - self.dither() + self.wait() for new_group in groups[1:]: self.play(Transform(group, new_group)) - self.dither() + self.wait() self.curr_example_point_group = group self.next_rational_point_example = groups[0] @@ -2325,7 +2325,7 @@ class RationalPointsOnUnitCircle(DrawRadialLines): ) self.play(FadeIn(top_rect), FadeIn(top_line)) - self.dither() + self.wait() self.play(*[ ReplacementTransform(top_rect, second_rect) ] + [ @@ -2350,10 +2350,10 @@ class RationalPointsOnUnitCircle(DrawRadialLines): ) for tex in "(", ")", "over", ]) - self.dither(2) + self.wait(2) self.play(Write(circle_label)) self.play(ShowCreation(circle_arrow)) - self.dither(2) + self.wait(2) self.play(FadeOut(circle_arrow)) self.algebra = VGroup( @@ -2368,7 +2368,7 @@ class RationalPointsOnUnitCircle(DrawRadialLines): self.curr_example_point_group, rational_point_group )) - self.dither(2) + self.wait(2) self.play(*[ ApplyMethod( mob.scale_about_point, @@ -2408,7 +2408,7 @@ class RationalPointsOnUnitCircle(DrawRadialLines): integer_point_group )) self.play(Write(distance_label)) - self.dither(2) + self.wait(2) ### @@ -2493,7 +2493,7 @@ class ProjectPointsOntoUnitCircle(DrawRadialLines): group.scale, scale_factor, run_time = 2 ) - self.dither(2) + self.wait(2) def draw_infinitely_many_lines(self): lines = VGroup(*[ @@ -2506,7 +2506,7 @@ class ProjectPointsOntoUnitCircle(DrawRadialLines): run_time = 3 )) self.play(FadeOut(lines)) - self.dither() + self.wait() class ICanOnlyDrawFinitely(TeacherStudentsScene): def construct(self): @@ -2514,7 +2514,7 @@ class ICanOnlyDrawFinitely(TeacherStudentsScene): "I can only \\\\ draw finitely", run_time = 2 ) - self.dither(2) + self.wait(2) class SupposeMissingPoint(PointsWeMiss): def construct(self): @@ -2550,7 +2550,7 @@ class SupposeMissingPoint(PointsWeMiss): self.add(triangle, line, dot) self.play(Write(words)) - self.dither() + self.wait() self.words = words self.triangle = triangle @@ -2590,18 +2590,18 @@ class SupposeMissingPoint(PointsWeMiss): self.add(dot.copy().fade()) self.add(line.copy().set_stroke(GREY, 1)) self.play(*map(MoveToTarget, [dot, line])) - self.dither() + self.wait() self.play( Write(rational_point_word), ShowCreation(arrow) ) - self.dither(2) + self.wait(2) class ProofTime(TeacherStudentsScene): def construct(self): self.teacher_says("Proof time!", target_mode = "hooray") self.change_student_modes(*["hooray"]*3) - self.dither(2) + self.wait(2) class FinalProof(RationalPointsOnUnitCircle): def construct(self): @@ -2631,7 +2631,7 @@ class FinalProof(RationalPointsOnUnitCircle): Write(label, run_time = 2), DrawBorderThenFill(dot) ) - self.dither() + self.wait() self.example_dot = dot self.example_label = label @@ -2650,7 +2650,7 @@ class FinalProof(RationalPointsOnUnitCircle): Animation(self.example_label) ) self.play(DrawBorderThenFill(neg_one_dot)) - self.dither() + self.wait() self.neg_one_dot = neg_one_dot self.secant_line = line @@ -2672,17 +2672,17 @@ class FinalProof(RationalPointsOnUnitCircle): rise_text.add_background_rectangle() self.play(*map(ShowCreation, [h_line, v_line])) - self.dither() + self.wait() self.play( GrowFromCenter(rise_brace), FadeIn(rise_text) ) - self.dither() + self.wait() self.play( GrowFromCenter(run_brace), FadeIn(run_text) ) - self.dither(3) + self.wait(3) self.play(*map(FadeOut, [ self.example_dot, self.example_label, self.secant_line, @@ -2728,13 +2728,13 @@ class FinalProof(RationalPointsOnUnitCircle): ShowCreation(line), FadeIn(label) ) - self.dither() + self.wait() for new_line, new_label in zip(lines, labels)[1:]: self.play( Transform(line, new_line), Transform(label, new_label), ) - self.dither() + self.wait() self.play(*map(FadeOut, [line, label])) def square_example_point(self): @@ -2807,7 +2807,7 @@ class FinalProof(RationalPointsOnUnitCircle): self.play(ShowCreation(uv_line)) self.play(ShowCreation(uv_arc)) self.play(Write(theta)) - self.dither() + self.wait() self.play( ShowCreation(z_to_z_squared_arrow), FadeIn(z_to_z_squared) @@ -2824,12 +2824,12 @@ class FinalProof(RationalPointsOnUnitCircle): (uv_arc, square_arc), ] ]) - self.dither() + self.wait() self.play( Write(two_theta), ShowCreation(two_theta_arrow) ) - self.dither(2) + self.wait(2) self.play(FadeOut(self.two_theta_group)) self.theta_group = VGroup(uv_arc, theta) @@ -2858,11 +2858,11 @@ class FinalProof(RationalPointsOnUnitCircle): MoveToTarget(line), MoveToTarget(dot), ) - self.dither() + self.wait() self.play(FadeIn(self.two_theta_group)) - self.dither() + self.wait() self.play(FadeOut(self.two_theta_group)) - self.dither(6) ##circle geometry + self.wait(6) ##circle geometry self.rational_point_dot = dot @@ -2884,17 +2884,17 @@ class FinalProof(RationalPointsOnUnitCircle): line_copies.target.next_to(same_slope_words, DOWN) self.play(ShowCreation(line)) - self.dither() + self.wait() self.play( theta_group_copy.shift, line.get_start() - self.uv_line.get_start() ) - self.dither() + self.wait() self.play( Write(same_slope_words), MoveToTarget(line_copies) ) - self.dither() + self.wait() self.same_slope_words = same_slope_words @@ -2914,7 +2914,7 @@ class FinalProof(RationalPointsOnUnitCircle): self.play(ShowCreation(h_line)) self.play(ShowCreation(v_line)) - self.dither() + self.wait() self.play(*[ ReplacementTransform( self.uv_label.get_part_by_tex(tex).copy(), @@ -2926,7 +2926,7 @@ class FinalProof(RationalPointsOnUnitCircle): Write(rhs.get_part_by_tex(tex)) for tex in "=", "over" ]) - self.dither(2) + self.wait(2) self.play( ShowCreation(rect), FadeIn(morty) @@ -2938,7 +2938,7 @@ class FinalProof(RationalPointsOnUnitCircle): look_at_arg = rect )) self.play(Blink(morty)) - self.dither(2) + self.wait(2) class BitOfCircleGeometry(Scene): def construct(self): @@ -2982,11 +2982,11 @@ class BitOfCircleGeometry(Scene): self.play(FadeIn(label)) groups.add(group) - self.dither(2) + self.wait(2) self.play(ReplacementTransform( groups[0].copy(), groups[1] )) - self.dither(2) + self.wait(2) class PatreonThanksTriples(PatreonThanks): CONFIG = { diff --git a/old_projects/waves.py b/old_projects/waves.py index da5dbd62..1315b446 100644 --- a/old_projects/waves.py +++ b/old_projects/waves.py @@ -488,12 +488,12 @@ class WantToLearnQM(TeacherStudentsScene): bubbles.add(bubble) self.students self.students[i].bubble = None - self.dither(2) + self.wait(2) self.teacher_says( "First, lots and lots \\\\ of linear algebra", added_anims = map(FadeOut, bubbles) ) - self.dither() + self.wait() class Goal(PiCreatureScene): def construct(self): @@ -521,13 +521,13 @@ class Goal(PiCreatureScene): ShowCreation(cross), randy.change, "sassy" ) - self.dither() + self.wait() self.play( VGroup(weirdness, cross).shift, DOWN, Write(foundations, run_time = 2), randy.change, "happy" ) - self.dither(2) + self.wait(2) #### @@ -541,7 +541,7 @@ class AskWhatsDifferentInQM(TeacherStudentsScene): "What's different in \\\\ quantum mechanics?" ) self.play(self.teacher.change, "pondering") - self.dither(3) + self.wait(3) class VideoWrapper(Scene): CONFIG = { @@ -555,7 +555,7 @@ class VideoWrapper(Scene): rect.scale_to_fit_height(6) rect.next_to(title, DOWN) self.add(rect) - self.dither() + self.wait() class BellsWrapper(VideoWrapper): CONFIG = { @@ -607,7 +607,7 @@ class IntroduceElectricField(PiCreatureScene): title[0].highlight, BLUE, title[1].highlight, YELLOW, ) - self.dither() + self.wait() self.play( ShrinkToCenter(title[1]), Transform(title[0], electric) @@ -629,7 +629,7 @@ class IntroduceElectricField(PiCreatureScene): self.title.to_edge, UP, morty.change, "happy", ORIGIN, ) - self.dither() + self.wait() self.vector_field = vector_field @@ -661,7 +661,7 @@ class IntroduceElectricField(PiCreatureScene): ShowCreation(vector), Write(force, run_time = 1), ) - self.dither(2) + self.wait(2) self.particle = particle self.force_vector = VGroup(vector, force) @@ -684,7 +684,7 @@ class IntroduceElectricField(PiCreatureScene): self.moving_particles = particles self.add_foreground_mobjects(self.moving_particles, self.pi_creature) self.always_continually_update = True - self.dither(10) + self.wait(10) ### @@ -771,7 +771,7 @@ class IntroduceMagneticField(IntroduceElectricField, ThreeDScene): LaggedStart(ShowCreation, vector_field, run_time = 3), Animation(self.title) ) - self.dither() + self.wait() def introduce_moving_charge(self): point = 3*RIGHT + UP @@ -800,7 +800,7 @@ class IntroduceMagneticField(IntroduceElectricField, ThreeDScene): self.add(velocity) self.play(Write(velocity_word, run_time = 0.5)) # self.play(ShowCreation(M_vect)) - self.dither() + self.wait() self.particle = particle @@ -830,9 +830,9 @@ class IntroduceMagneticField(IntroduceElectricField, ThreeDScene): self.begin_ambient_camera_rotation() self.play(ShowCreation(F_vect)) self.play(Write(F_word)) - self.dither() + self.wait() self.play(Write(F_eq)) - self.dither(8) + self.wait(8) def many_charges(self): charges = VGroup() @@ -845,7 +845,7 @@ class IntroduceMagneticField(IntroduceElectricField, ThreeDScene): self.revert_to_original_skipping_status() self.add_foreground_mobjects(*charges) self.moving_particles = charges - self.dither(5) + self.wait(5) ### @@ -896,11 +896,11 @@ class CurlRelationBetweenFields(ThreeDScene): M_vect.scale(0.01, about_point = M_vect.get_start()) self.play(ShowCreation(E_vects, run_time = 2)) - self.dither() + self.wait() self.move_camera(0.8*np.pi/2, -0.45*np.pi) self.begin_ambient_camera_rotation() self.play(M_vect.restore, run_time = 3, rate_func = None) - self.dither(3) + self.wait(3) self.E_vects = E_vects self.E_circle_center = point @@ -925,14 +925,14 @@ class CurlRelationBetweenFields(ThreeDScene): ShowCreation(M_vects, run_time = 2), *map(FadeOut, self.E_vects[1:]) ) - self.dither() + self.wait() self.play( E_vect.rotate, np.pi, RIGHT, [], new_point, E_vect.scale_about_point, 3, new_point, run_time = 4, rate_func = None, ) - self.dither() + self.wait() self.M_circle_center = new_point M_vects.add(self.M_vect) @@ -958,7 +958,7 @@ class CurlRelationBetweenFields(ThreeDScene): run_time = 5, rate_func = None, ) - self.dither(3) + self.wait(3) class WriteCurlEquations(Scene): def construct(self): @@ -986,10 +986,10 @@ class WriteCurlEquations(Scene): footnote.to_edge(RIGHT) self.play(Write(eq1, run_time = 2)) - self.dither(3) + self.wait(3) self.play(Write(eq2, run_time = 2)) self.play(FadeIn(footnote)) - self.dither(3) + self.wait(3) class IntroduceEMWave(ThreeDScene): CONFIG = { @@ -1018,15 +1018,15 @@ class IntroduceEMWave(ThreeDScene): words.to_edge(UP) words.rotate(np.pi/2, RIGHT) - self.dither(7) + self.wait(7) self.play(Write(words, run_time = 2)) - self.dither(20) + self.wait(20) ##### class SimpleEMWave(IntroduceEMWave): def construct(self): - self.dither(30) + self.wait(30) class ListRelevantWaveIdeas(TeacherStudentsScene): def construct(self): @@ -1054,7 +1054,7 @@ class ListRelevantWaveIdeas(TeacherStudentsScene): Animation(VectorizedPoint(wave_point)), self.teacher.change, "raise_right_hand" ) - self.dither(2) + self.wait(2) self.play( Write(title, run_time = 2), ShowCreation(h_line) @@ -1077,7 +1077,7 @@ class ListRelevantWaveIdeas(TeacherStudentsScene): title[1].next_to, quantum.copy(), RIGHT, 2*SMALL_BUFF, Write(quantum), ) - self.dither(5) + self.wait(5) class DirectWaveOutOfScreen(IntroduceEMWave): CONFIG = { @@ -1102,7 +1102,7 @@ class DirectWaveOutOfScreen(IntroduceEMWave): self.fade_all_but_last_E_vects() def move_into_position(self): - self.dither(2) + self.wait(2) self.continual_update() faded_vectors = VGroup(*[ ov.vector @@ -1125,11 +1125,11 @@ class DirectWaveOutOfScreen(IntroduceEMWave): self.play( self.em_wave.M_vects.set_fill, None, 0 ) - self.dither(2) + self.wait(2) def fade_all_but_last_E_vects(self): self.play(self.faded_vectors.set_fill, None, 0) - self.dither(4) + self.wait(4) class ShowVectorEquation(Scene): CONFIG = { @@ -1156,7 +1156,7 @@ class ShowVectorEquation(Scene): frequency = 0.25, ) self.add(self.oscillating_vector) - self.dither(3) + self.wait(3) def add_plane(self): xy_plane = NumberPlane( @@ -1173,7 +1173,7 @@ class ShowVectorEquation(Scene): Write(xy_plane), Animation(self.vector) ) - self.dither(2) + self.wait(2) self.xy_plane = xy_plane def write_horizontally_polarized(self): @@ -1186,7 +1186,7 @@ class ShowVectorEquation(Scene): words.add_background_rectangle() self.play(Write(words, run_time = 3)) - self.dither() + self.wait() self.horizontally_polarized_words = words @@ -1240,7 +1240,7 @@ class ShowVectorEquation(Scene): y.move_to(self.horizontally_polarized_words) y.set_fill(opacity = 0) self.play(y.restore) - self.dither() + self.wait() self.add(moving_brace, moving_x_without_phi) self.play( FadeIn(moving_brace.mobject), @@ -1249,7 +1249,7 @@ class ShowVectorEquation(Scene): submobject_mode = "lagged_start", run_time = 2, ) - self.dither(3) + self.wait(3) self.play( FadeOut(moving_brace.mobject), FadeOut(moving_x_without_phi.mobject), @@ -1323,14 +1323,14 @@ class ShowVectorEquation(Scene): fx_equals_1 ), ) - self.dither(4 - (self.oscillating_vector.internal_time%4)) + self.wait(4 - (self.oscillating_vector.internal_time%4)) self.remove(self.oscillating_vector) self.add(new_ov) self.play(ShowCreation( high_f_graph, run_time = 4, rate_func = None, )) - self.dither() + self.wait() self.play(FadeOut(new_ov.vector)) self.remove(new_ov) self.add(self.oscillating_vector) @@ -1340,10 +1340,10 @@ class ShowVectorEquation(Scene): FadeOut(new_ov.vector), FadeIn(self.vector) ) - self.dither(4) + self.wait(4) self.play(ShowCreation(cos_arg_rect)) self.play(FadeOut(cos_arg_rect)) - self.dither(5) + self.wait(5) self.corner_group = group self.fx_equals_fourth = fx_equals_fourth @@ -1384,7 +1384,7 @@ class ShowVectorEquation(Scene): Write(words, run_time = 1), ShowCreation(arrow) ) - self.dither(3) + self.wait(3) self.play(*map(FadeOut, [words, arrow])) self.corner_cos.add(corner_phi) @@ -1421,7 +1421,7 @@ class ShowVectorEquation(Scene): GrowFromCenter(h_brace), GrowFromCenter(v_brace), ) - self.dither(2) + self.wait(2) self.play( x.next_to, A, RIGHT, SMALL_BUFF, corner_cos.next_to, corner_A, RIGHT, SMALL_BUFF, @@ -1429,7 +1429,7 @@ class ShowVectorEquation(Scene): ) x.add(A) corner_cos.add(corner_A) - self.dither() + self.wait() factor = 0.5 self.play( v_brace.stretch_in_place, factor, 1, @@ -1441,7 +1441,7 @@ class ShowVectorEquation(Scene): UpdateFromFunc(self.vector, update_vect), graph.stretch_in_place, factor, 1, ) - self.dither(4) + self.wait(4) self.h_brace = h_brace self.v_brace = v_brace @@ -1492,12 +1492,12 @@ class ShowVectorEquation(Scene): LaggedStart(ShowCreation, arrows, lag_ratio = 0.7), run_time = 2, ) - self.dither() + self.wait() for ket, ket_rect, unit_vect in zip(kets, ket_rects, unit_vectors): self.play(ShowCreation(ket_rect)) self.play(FadeOut(ket_rect)) self.play(ReplacementTransform(ket[1][1].copy(), unit_vect)) - self.dither() + self.wait() self.play(FadeOut(unit_vectors)) self.play(*map(FadeOut, [kets_word, arrows])) @@ -1555,7 +1555,7 @@ class ShowVectorEquation(Scene): ]) ) self.play(*map(MoveToTarget, movers)) - self.dither(5) + self.wait(5) class ChangeFromHorizontalToVerticallyPolarized(DirectionOfPolarizationScene): CONFIG = { @@ -1579,9 +1579,9 @@ class ChangeFromHorizontalToVerticallyPolarized(DirectionOfPolarizationScene): self.set_camera_position(0.9*np.pi/2, -0.05*np.pi) def construct(self): - self.dither(3) + self.wait(3) self.change_polarization_direction(np.pi/2) - self.dither(10) + self.wait(10) class SumOfTwoWaves(ChangeFromHorizontalToVerticallyPolarized): CONFIG = { @@ -1623,7 +1623,7 @@ class SumOfTwoWaves(ChangeFromHorizontalToVerticallyPolarized): equals.shift(2.5*UP) self.add(pe) - self.dither(16) + self.wait(16) class ShowTipToTailSum(ShowVectorEquation): def construct(self): @@ -1703,7 +1703,7 @@ class ShowTipToTailSum(ShowVectorEquation): ket_sum.arrange_submobjects(RIGHT) ket_sum.next_to(3*RIGHT + 2*UP, UP, SMALL_BUFF) - self.dither(4) + self.wait(4) self.remove(self.h_oscillating_vector, self.v_oscillating_vector) self.add(self.h_vector, self.v_vector) h_line.update(h_line) @@ -1719,7 +1719,7 @@ class ShowTipToTailSum(ShowVectorEquation): self.h_vector.set_fill, blue_black, self.v_vector.set_fill, blue_black, ) - self.dither() + self.wait() self.add( self.h_oscillating_vector, self.v_oscillating_vector, @@ -1727,7 +1727,7 @@ class ShowTipToTailSum(ShowVectorEquation): ContinualUpdateFromFunc(h_line, h_line.update), ContinualUpdateFromFunc(v_line, v_line.update), ) - self.dither(4) + self.wait(4) self.ket_sum = VGroup(h_ket, plus, v_ket) @@ -1758,17 +1758,17 @@ class ShowTipToTailSum(ShowVectorEquation): Write(superposition_words, run_time = 2), MoveToTarget(ket_sum) ) - self.dither(2) + self.wait(2) self.play( FadeIn(sum_word), superposition_words.shift, MED_LARGE_BUFF*DOWN, ket_sum.shift, MED_LARGE_BUFF*DOWN, ) - self.dither() + self.wait() self.play(ReplacementTransform( sum_word, weighted_sum_word )) - self.dither(2) + self.wait(2) def add_amplitudes(self): h_ket, plus, r_ket = self.ket_sum @@ -1808,7 +1808,7 @@ class ShowTipToTailSum(ShowVectorEquation): for ov, A in (h_ov, h_A), (v_ov, v_A) ] )) - self.dither(4) + self.wait(4) self.A_mobs = A_mobs @@ -1850,7 +1850,7 @@ class ShowTipToTailSum(ShowVectorEquation): ) ) self.play(FadeIn(ellipse)) - self.dither(5) + self.wait(5) self.play( UpdateFromAlphaFunc( h_ov.vector, @@ -1863,7 +1863,7 @@ class ShowTipToTailSum(ShowVectorEquation): ellipse.stretch, 0.25, 0, Transform(h_A_mob, new_h_A_mob) ) - self.dither(8) + self.wait(8) ##### @@ -1968,7 +1968,7 @@ class AlternateBasis(ShowTipToTailSum): d = (RIGHT + UP)/np.sqrt(2) a = (LEFT + UP)/np.sqrt(2) - self.dither(4) + self.wait(4) self.play( self.xy_plane.fade, 0.5, self.xy_plane.coordinate_labels.fade, 1, @@ -1993,7 +1993,7 @@ class AlternateBasis(ShowTipToTailSum): Transform(self.hv_superposition, self.da_superposition), run_time = 2, ) - self.dither(4) + self.wait(4) def show_vertically_polarized(self): self.play( @@ -2014,14 +2014,14 @@ class AlternateBasis(ShowTipToTailSum): ) ), ) - self.dither(8) + self.wait(8) class WriteBasis(Scene): def construct(self): words = TextMobject("Choice of ``basis''") words.scale_to_fit_width(2*SPACE_WIDTH-1) self.play(Write(words)) - self.dither() + self.wait() class ShowPolarizingFilter(DirectionOfPolarizationScene): CONFIG = { @@ -2048,9 +2048,9 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene): self.em_wave.M_vects.set_fill(opacity = 0) def initial_rotation(self): - self.dither() + self.wait() self.play(FadeIn(self.rectangles)) - self.dither() + self.wait() self.change_polarization_direction(np.pi/2, run_time = 3) self.move_camera(phi = 0.9*np.pi/2, theta = -0.05*np.pi) @@ -2077,7 +2077,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene): Write(words, run_time = 2), *map(GrowFromCenter, lines) ) - self.dither(6) + self.wait(6) self.play(FadeOut(lines)) self.play(FadeOut(words)) @@ -2089,7 +2089,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene): self.add(*continual_updates) for angle in np.pi/4, -np.pi/6: self.change_polarization_direction(angle) - self.dither(3) + self.wait(3) self.move_camera( theta = -0.6*np.pi, @@ -2107,7 +2107,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene): for angle in np.pi/3, -np.pi/3, np.pi/6: self.change_polarization_direction(angle) - self.dither(2) + self.wait(2) self.play( FadeOut(superposition), FadeOut(arrow), @@ -2134,7 +2134,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene): self.add(*continual_updates) for angle in np.pi/4, -np.pi/3, -np.pi/6: self.change_polarization_direction(np.pi/4) - self.dither(2) + self.wait(2) ####### @@ -2206,7 +2206,7 @@ class NamePolarizingFilter(Scene): words = TextMobject("Polarizing filter") words.scale_to_fit_width(2*SPACE_WIDTH - 1) self.play(Write(words)) - self.dither() + self.wait() class EnergyOfWavesWavePortion(DirectWaveOutOfScreen): CONFIG = { @@ -2238,7 +2238,7 @@ class EnergyOfWavesWavePortion(DirectWaveOutOfScreen): brace_group = VGroup(brace, brace.A) self.position_brace_group(brace_group) self.play(Write(brace_group, run_time = 1)) - self.dither(12) + self.wait(12) self.brace = brace @@ -2278,16 +2278,16 @@ class EnergyOfWavesWavePortion(DirectWaveOutOfScreen): ReplacementTransform(self.brace, h_brace), Write(h_brace.A) ) - self.dither(6) + self.wait(6) self.play( ReplacementTransform(h_brace.copy(), v_brace), Write(v_brace.A) ) - self.dither(6) + self.wait(6) rhs.next_to(self.brace.A, UP, SMALL_BUFF) self.play(Write(rhs)) - self.dither(2*period) + self.wait(2*period) self.h_brace = h_brace self.v_brace = v_brace @@ -2297,8 +2297,8 @@ class EnergyOfWavesWavePortion(DirectWaveOutOfScreen): def scale_up_and_down(self): for scale_factor in 1.25, 0.4, 1.5, 0.3, 2: self.scale_wave(scale_factor) - self.dither() - self.dither(4) + self.wait() + self.wait(4) ###### @@ -2376,10 +2376,10 @@ class EnergyOfWavesTeacherPortion(TeacherStudentsScene): *["pondering"]*3, look_at_arg = dot ) - self.dither(2) + self.wait(2) self.play(Write(energy)) self.play(self.teacher.change, "happy") - self.dither(3) + self.wait(3) self.play( ReplacementTransform( VGroup(*energy[-4:]).copy(), @@ -2391,7 +2391,7 @@ class EnergyOfWavesTeacherPortion(TeacherStudentsScene): ) ) self.change_student_modes(*["happy"]*3, look_at_arg = energy) - self.dither() + self.wait() def show_both_ways_of_thinking_about_it(self): s1, s2 = self.get_students()[:2] @@ -2411,7 +2411,7 @@ class EnergyOfWavesTeacherPortion(TeacherStudentsScene): Write(b.content, run_time = 2), s.change, "thinking" ) - self.dither(2) + self.wait(2) self.change_student_modes( *["plain"]*3, look_at_arg = self.dot, @@ -2421,7 +2421,7 @@ class EnergyOfWavesTeacherPortion(TeacherStudentsScene): ) self.play(self.teacher.look_at, self.dot) - self.dither(5) + self.wait(5) class DescribePhoton(ThreeDScene): CONFIG = { @@ -2568,7 +2568,7 @@ class DescribePhoton(ThreeDScene): part.add_to_back(bg_rect) part.rotate(np.pi/2, UP) self.add(part) - self.dither() + self.wait() self.h_part_tex = h_part self.h_arrow = h_arrow @@ -2610,7 +2610,7 @@ class DescribePhoton(ThreeDScene): ShowCreation(rect), Write(word, run_time = 1) ) - self.dither() + self.wait() self.play(*map(FadeOut, [new_alpha, group])) def change_basis(self): @@ -2676,9 +2676,9 @@ class DescribePhoton(ThreeDScene): self.equation.generate_target() self.play(*map(MoveToTarget, movers)) - self.dither(2) + self.wait(2) self.play(*[mob.restore for mob in movers]) - self.dither() + self.wait() def write_different_meaning(self): superposition = self.superposition @@ -2703,7 +2703,7 @@ class DescribePhoton(ThreeDScene): morty, blinked, rate_func = squish_rate_func(there_and_back) )) - self.dither() + self.wait() self.play(*map(FadeOut, [ morty, words, rect, self.equation.rect, @@ -2734,7 +2734,7 @@ class DescribePhoton(ThreeDScene): GrowFromCenter(d_brace), Write(d_brace.label) ) - self.dither() + self.wait() self.play( FadeOut(self.h_part_tex), FadeOut(self.v_part_tex), @@ -2745,7 +2745,7 @@ class DescribePhoton(ThreeDScene): Write(h_brace.label), Write(v_brace.label), ) - self.dither() + self.wait() self.d_brace = d_brace self.h_brace = h_brace @@ -2789,7 +2789,7 @@ class DescribePhoton(ThreeDScene): ), Write(parts[1], run_time = 1), ) - self.dither() + self.wait() self.play( Transform( self.h_brace.label[1].copy(), @@ -2806,7 +2806,7 @@ class DescribePhoton(ThreeDScene): Write(parts[2]), run_time = 2 ) - self.dither() + self.wait() self.energy_equation_parts = parts @@ -2834,7 +2834,7 @@ class DescribePhoton(ThreeDScene): randy.rotate, np.pi/2, RIGHT, randy.rotate, np.pi/2, OUT, ) - self.dither() + self.wait() def ask_what_they_mean(self): morty = Mortimer(mode = "confused") @@ -2870,7 +2870,7 @@ class DescribePhoton(ThreeDScene): Write(bubble.content), morty.look_at, component, ) - self.dither() + self.wait() def change_camera(self): everything = VGroup(*self.get_top_level_mobjects()) @@ -2890,7 +2890,7 @@ class DescribePhoton(ThreeDScene): ) self.photon.rate_func = lambda x : x self.play(self.photon) - self.dither() + self.wait() class SeeCommentInDescription(Scene): def construct(self): @@ -2916,7 +2916,7 @@ class GetExperimental(TeacherStudentsScene): def construct(self): self.teacher_says("Get experimental!", target_mode = "hooray") self.change_student_modes(*["hooray"]*3) - self.dither(3) + self.wait(3) class ShootPhotonThroughFilter(DirectionOfPolarizationScene): CONFIG = { @@ -3002,7 +3002,7 @@ class ShootPhotonThroughFilter(DirectionOfPolarizationScene): FadeIn(self.superposition_tex) ) self.play(Write(question, run_time = 1)) - self.dither() + self.wait() self.play(FadeOut(self.pol_filter.label)) self.pol_filter.remove(self.pol_filter.label) self.add(self.pol_filter) @@ -3051,7 +3051,7 @@ class ShootPhotonThroughFilter(DirectionOfPolarizationScene): Animation(self.frozen_photon.mobject) ] ) - self.dither(2) + self.wait(2) self.move_camera( phi = 0.8*np.pi/2, theta = -0.7*np.pi, added_anims = [ @@ -3073,7 +3073,7 @@ class ShootPhotonThroughFilter(DirectionOfPolarizationScene): self.superposition_tex.h_rect.fade, 1, Animation(self.pol_filter) ) - self.dither() + self.wait() self.absorption_words = words @@ -3151,7 +3151,7 @@ class YouCanSeeTheCollapse(TeacherStudentsScene): target_mode = "hooray" ) self.change_student_modes("confused", "hooray", "erm") - self.dither(3) + self.wait(3) class ThreeFilters(ShootPhotonThroughFilter): CONFIG = { @@ -3250,7 +3250,7 @@ class ThreeFilters(ShootPhotonThroughFilter): FadeIn(label), run_time = 0.5, ) - self.dither(2) + self.wait(2) self.play( FadeOut(l3), Animation(pf2), @@ -3310,7 +3310,7 @@ class ThreeFilters(ShootPhotonThroughFilter): ], **kwargs ) - self.dither() + self.wait() self.photon = photon self.brace_group = VGroup(brace, label) @@ -3350,7 +3350,7 @@ class ThreeFilters(ShootPhotonThroughFilter): FadeIn(l1), FadeOut(self.brace_group) ) - self.dither(2) + self.wait(2) def remove_middle_then_put_back(self): l1, l2, l3, l4 = self.lines_group @@ -3392,7 +3392,7 @@ class ThreeFilters(ShootPhotonThroughFilter): ShowCreation(arrow), Write(labels[0], run_time = 1) ) - self.dither(2) + self.wait(2) self.play( FadeIn(l4), Animation(pf3), @@ -3404,7 +3404,7 @@ class ThreeFilters(ShootPhotonThroughFilter): Animation(l1) ) self.play(ReplacementTransform(*labels)) - self.dither(3) + self.wait(3) #### @@ -3508,7 +3508,7 @@ class PhotonAtSlightAngle(ThreeFilters): ShowCreation(arc), Write(label, run_time = 1) ) - self.dither() + self.wait() self.arc = arc self.angle_label = label @@ -3571,7 +3571,7 @@ class PhotonAtSlightAngle(ThreeFilters): GrowFromCenter(d_brace), Write(d_brace.label) ) - self.dither() + self.wait() self.play( GrowFromPoint(h_arrow, ORIGIN), Write(h_label, run_time = 1) @@ -3592,7 +3592,7 @@ class PhotonAtSlightAngle(ThreeFilters): GrowFromCenter(sin_brace), Write(sin_brace.label, run_time = 1) ) - self.dither() + self.wait() self.play( GrowFromPoint(v_arrow, h_arrow.get_end()), Write(v_label, run_time = 1) @@ -3611,7 +3611,7 @@ class PhotonAtSlightAngle(ThreeFilters): GrowFromCenter(cos_brace), Write(cos_brace.label, run_time = 1) ) - self.dither() + self.wait() self.d_brace = d_brace self.state_equation = state @@ -3688,7 +3688,7 @@ class PhotonAtSlightAngle(ThreeFilters): Write(h_content.get_part_by_tex("direction")), run_time = 2, ) - self.dither(2) + self.wait(2) self.play(h_content.shift, 2*IN) self.play( ReplacementTransform( @@ -3705,7 +3705,7 @@ class PhotonAtSlightAngle(ThreeFilters): Write(v_content.get_part_by_tex("direction")), run_time = 2, ) - self.dither(2) + self.wait(2) self.play( FadeOut(randy), FadeOut(bubble), @@ -3716,7 +3716,7 @@ class PhotonAtSlightAngle(ThreeFilters): ) self.play(ShowCreation(filter_lines, submobject_mode = "all_at_once")) self.play(FadeOut(filter_lines)) - self.dither() + self.wait() self.classically = VGroup(classically, h_content) @@ -3796,7 +3796,7 @@ class PhotonAtSlightAngle(ThreeFilters): # ) # ) # self.play(photon, *added_anims) - # self.dither() + # self.wait() l1 = self.get_lines(None, self.pol_filter) l2 = self.get_lines(self.pol_filter, None, 0.85) @@ -3830,7 +3830,7 @@ class PhotonAtSlightAngle(ThreeFilters): Animation(self.pol_filter), Animation(l1) ) - self.dither() + self.wait() ### @@ -3984,7 +3984,7 @@ class CompareWaveEquations(TeacherStudentsScene): UP, SMALL_BUFF, A_copy.shift, 0.5*SMALL_BUFF*(UP+LEFT), ) - self.dither() + self.wait() def show_interpretations(self): c_words = TexMobject( @@ -4027,7 +4027,7 @@ class CompareWaveEquations(TeacherStudentsScene): "erm", "confused", "pondering", look_at_arg = qm_words ) - self.dither() + self.wait() class CircularPhotons(ShootPhotonThroughFilter): CONFIG = { @@ -4184,7 +4184,7 @@ class CircularPhotons(ShootPhotonThroughFilter): self.pol_filter, blocked_v_photon ) ) - self.dither() + self.wait() #### @@ -4220,7 +4220,7 @@ class OrClickHere(Scene): Write(words), ShowCreation(arrow) ) - self.dither() + self.wait() class WavesPatreonThanks(PatreonThanks): CONFIG = { diff --git a/old_projects/wcat.py b/old_projects/wcat.py index 677c76ea..b72e1e45 100644 --- a/old_projects/wcat.py +++ b/old_projects/wcat.py @@ -260,7 +260,7 @@ class Introduction(TeacherStudentsScene): for pi in self.get_students(): pi.target.look_at(self.get_teacher().eyes) self.play(*map(MoveToTarget, self.get_students())) - self.dither() + self.wait() class WhenIWasAKid(TeacherStudentsScene): def construct(self): @@ -283,7 +283,7 @@ class WhenIWasAKid(TeacherStudentsScene): target_mode = "hooray" ) self.change_student_modes(*["happy"]*3) - self.dither() + self.wait() speaker.look_at(children) me = children[-1] @@ -344,10 +344,10 @@ class WhenIWasAKid(TeacherStudentsScene): ) self.random_blink() self.play(me.change_mode, "pondering") - self.dither() + self.wait() self.random_blink(2) self.play(pi1.change_mode, "raise_left_hand") - self.dither() + self.wait() self.play(pi2.change_mode, "erm") self.random_blink() self.student_says( @@ -385,9 +385,9 @@ class WhenIWasAKid(TeacherStudentsScene): self.remove(me) self.add(morty) self.play(Blink(morty)) - self.dither() + self.wait() self.play(morty.change_mode, "hooray") - self.dither() + self.wait() def prepare_everyone(self, children, speaker): @@ -444,16 +444,16 @@ class DefineInscribedSquareProblem(ClosedLoopScene): #Draw loop self.remove(self.loop) self.play(Write(self.title)) - self.dither() + self.wait() self.play(ShowCreation( self.loop, run_time = 5, rate_func = None )) - self.dither() + self.wait() self.add_rect_dots(square = True) self.play(ShowCreation(self.dots, run_time = 2)) - self.dither() + self.wait() self.add_connecting_lines(cyclic = True) self.play( ShowCreation( @@ -463,7 +463,7 @@ class DefineInscribedSquareProblem(ClosedLoopScene): ), Animation(self.dots) ) - self.dither(2) + self.wait(2) def cycle_through_shapes(self): circle = Circle(radius = 2.5, color = WHITE) @@ -490,20 +490,20 @@ class DefineInscribedSquareProblem(ClosedLoopScene): self.remove(self.loop) self.loop = circle self.add(self.loop, self.connecting_lines, self.dots) - self.dither() + self.wait() odd_eigths = np.linspace(1./8, 7./8, 4) self.move_dots_to_alphas(odd_eigths) - self.dither() + self.wait() for nudge in 0.1, -0.1, 0: self.move_dots_to_alphas(odd_eigths+nudge) - self.dither() + self.wait() self.transform_loop(ellipse) - self.dither() + self.wait() nudge = 0.055 self.move_dots_to_alphas( odd_eigths + [nudge, -nudge, nudge, -nudge] ) - self.dither(2) + self.wait(2) self.transform_loop(pi_loop) self.let_dots_wonder() randy_anims = [ @@ -539,10 +539,10 @@ class DefineInscribedSquareProblem(ClosedLoopScene): self.play(morty.change_mode, "speaking") self.play(Transform(self.title, new_title)) self.move_dots_to_alphas(rect_alphas) - self.dither() + self.wait() self.play(morty.change_mode, "hooray") self.play(Blink(morty)) - self.dither() + self.wait() self.play(FadeOut(self.connecting_lines)) self.connecting_lines = VGroup() self.play(morty.change_mode, "plain") @@ -591,12 +591,12 @@ class RectangleProperties(Scene): self.play(ShowCreation(rect)) - self.dither() + self.wait() self.play( ShowCreation(vertex_dots), Write(labels) ) - self.dither() + self.wait() mob_lists = [ (a, c, dot_pairs[0]), (b, d, dot_pairs[1]), @@ -606,16 +606,16 @@ class RectangleProperties(Scene): ApplyMethod(mob.highlight, color) for mob in mob_list ]) - self.dither() + self.wait() for line, brace in zip(diag_lines, braces): self.play( ShowCreation(line), GrowFromCenter(brace) ) - self.dither() + self.wait() self.play(FadeOut(brace)) self.play(FadeIn(midpoint)) - self.dither() + self.wait() class PairOfPairBecomeRectangle(Scene): def construct(self): @@ -661,7 +661,7 @@ class PairOfPairBecomeRectangle(Scene): Write(labels) ) self.play(*map(ShowCreation, lines)) - self.dither() + self.wait() self.play(*[ ApplyMethod( group.shift, @@ -684,7 +684,7 @@ class PairOfPairBecomeRectangle(Scene): self.play(Transform(groups[1], grower)) self.play(Write(words[1])) - self.dither() + self.wait() rectangle = Polygon(*[ dots[i].get_center() @@ -696,7 +696,7 @@ class PairOfPairBecomeRectangle(Scene): Animation(dots) ) self.play(*map(Write, words[2:])) - self.dither() + self.wait() class SearchForRectangleOnLoop(ClosedLoopScene): def construct(self): @@ -715,7 +715,7 @@ class SearchForRectangleOnLoop(ClosedLoopScene): color = RED ) self.play(ShowCreation(midpoint)) - self.dither() + self.wait() angles = [line.get_angle() for line in self.connecting_lines] angle_mean = np.mean(angles) self.play( @@ -727,13 +727,13 @@ class SearchForRectangleOnLoop(ClosedLoopScene): ) self.add(self.connecting_lines.copy(), midpoint) self.connecting_lines = VGroup() - self.dither() + self.wait() self.add_connecting_lines(cyclic = True) self.play( ShowCreation(self.connecting_lines), Animation(self.dots) ) - self.dither() + self.wait() class DeclareFunction(ClosedLoopScene): def construct(self): @@ -763,9 +763,9 @@ class DeclareFunction(ClosedLoopScene): self.add(tex) self.play(Write(ab_brace)) - self.dither() + self.wait() self.play(Write(xyz_brace)) - self.dither() + self.wait() class DefinePairTo3dFunction(Scene): def construct(self): @@ -777,7 +777,7 @@ class LabelMidpoint(Scene): words.highlight(RED) words.scale(2) self.play(Write(words, run_time = 1)) - self.dither() + self.wait() class LabelDistance(Scene): def construct(self): @@ -785,7 +785,7 @@ class LabelDistance(Scene): words.highlight(MAROON_B) words.scale(2) self.play(Write(words, run_time = 1)) - self.dither() + self.wait() class DrawingOneLineOfTheSurface(Scene): def construct(self): @@ -805,9 +805,9 @@ class InputPairToFunction(Scene): tex.highlight_by_tex("=X", BLUE) tex.scale(2) self.play(Write(tex[0])) - self.dither(2) + self.wait(2) self.play(Write(tex[1])) - self.dither(2) + self.wait(2) class WigglePairUnderSurface(Scene): def construct(self): @@ -816,7 +816,7 @@ class WigglePairUnderSurface(Scene): class WriteContinuous(Scene): def construct(self): self.play(Write(TextMobject("Continuous").scale(2))) - self.dither(2) + self.wait(2) class DistinctPairCollisionOnSurface(Scene): def construct(self): @@ -853,7 +853,7 @@ class PairOfRealsToPlane(Scene): self.add(x_axis, y_axis, dots, pair_label) self.play(ShowCreation(arrows, run_time = 2)) - self.dither() + self.wait() self.play( pair_label.next_to, two_d_point, UP+LEFT, SMALL_BUFF, Rotate(y_axis, np.pi/2), @@ -872,7 +872,7 @@ class PairOfRealsToPlane(Scene): Animation(everything), Animation(dot2) ) - self.dither() + self.wait() class SeekSurfaceForPairs(ClosedLoopScene): def construct(self): @@ -940,19 +940,19 @@ class DefineOrderedPair(ClosedLoopScene): first.next_to(self.dots[0], UP+2*LEFT, LARGE_BUFF) arrow = Arrow(first.get_bottom(), self.dots[0], color = GREEN) - self.dither() + self.wait() self.play(*[ Transform(label.copy(), dot.label) for label, dot in zip(labels_start, dots) ]) self.remove(*self.get_mobjects_from_last_animation()) self.add(*[d.label for d in dots]) - self.dither() + self.wait() self.play( Write(first), ShowCreation(arrow) ) - self.dither() + self.wait() class DefineUnorderedPair(ClosedLoopScene): def construct(self): @@ -984,14 +984,14 @@ class DefineUnorderedPair(ClosedLoopScene): for label, arrow_pair in zip(labels, arrow_pairs): self.play(*map(FadeIn, [label, arrow_pair])) - self.dither() + self.wait() for x in range(2): self.play( dots[0].move_to, dots[1], dots[1].move_to, dots[0], path_arc = np.pi/2 ) - self.dither() + self.wait() class BeginWithOrdered(TeacherStudentsScene): def construct(self): @@ -1019,16 +1019,16 @@ class DeformToInterval(ClosedLoopScene): #Unwrap loop self.transform_loop(cut_loop, path_arc = np.pi) - self.dither() + self.wait() self.transform_loop( line, run_time = 3, path_arc = np.pi/2 ) - self.dither() + self.wait() self.play(ShowCreation(interval)) self.play(Write(numbers)) - self.dither() + self.wait() #Follow points self.loop = original_loop.copy() @@ -1049,13 +1049,13 @@ class DeformToInterval(ClosedLoopScene): self.play(Write(self.dots)) self.add(dots_copy) - self.dither() + self.wait() self.transform_loop( line, added_anims = [MoveToTarget(dot_at_1)], run_time = 3 ) - self.dither() + self.wait() self.loop = original_loop self.dots = dots_copy dot_at_1 = self.dots[-1] @@ -1064,7 +1064,7 @@ class DeformToInterval(ClosedLoopScene): cut_loop, added_anims = [MoveToTarget(dot_at_1)] ) - self.dither() + self.wait() fading_dots.generate_target() fading_dots.target.set_fill(opacity = 0.3) self.play(MoveToTarget(fading_dots)) @@ -1072,7 +1072,7 @@ class DeformToInterval(ClosedLoopScene): end_dots.shift, 0.2*UP, rate_func = wiggle ) - self.dither() + self.wait() class RepresentPairInUnitSquare(ClosedLoopScene): def construct(self): @@ -1111,14 +1111,14 @@ class RepresentPairInUnitSquare(ClosedLoopScene): Write(self.dots), Write(right_words[0]) ) - self.dither() + self.wait() self.transform_loop(line) self.play( ShowCreation(interval), Write(numbers), Animation(self.dots) ) - self.dither() + self.wait() self.play(*[ Rotate(mob, np.pi/2, about_point = interval.get_left()) for mob in vert_interval, self.dots[1] @@ -1139,7 +1139,7 @@ class RepresentPairInUnitSquare(ClosedLoopScene): Animation(self.dots), *map(Write, right_words[1:]) ) - self.dither() + self.wait() #Shift point in square @@ -1165,7 +1165,7 @@ class RepresentPairInUnitSquare(ClosedLoopScene): inner_dot.target.get_center() ) self.play(*map(MoveToTarget, movers)) - self.dither() + self.wait() self.play(*map(FadeOut, [dashed_lines, self.dots])) class EdgesOfSquare(Scene): @@ -1177,17 +1177,17 @@ class EdgesOfSquare(Scene): for edge in list(x_edges) + list(y_edges): self.play(ShowCreation(edge)) - self.dither() + self.wait() for label_group in label_groups: for label in label_group[:3]: self.play(FadeIn(label)) - self.dither() + self.wait() self.play(Write(VGroup(*label_group[3:]))) - self.dither() + self.wait() self.play(FadeOut(VGroup(*label_groups))) for arrows in arrow_groups: self.play(ShowCreation(arrows, run_time = 2)) - self.dither() + self.wait() self.play(*[ ApplyMethod( n.next_to, @@ -1198,7 +1198,7 @@ class EdgesOfSquare(Scene): ) for n, vect in zip(self.numbers, [DOWN, UP]) ]) - self.dither() + self.wait() def add_square(self): interval = UnitInterval(color = WHITE) @@ -1310,7 +1310,7 @@ class EndpointsGluedTogether(ClosedLoopScene): self.add(interval, dots) self.play(dots.rotate_in_place, np.pi/20, rate_func = wiggle) - self.dither() + self.wait() self.transform_loop( original_loop, added_anims = [ @@ -1319,7 +1319,7 @@ class EndpointsGluedTogether(ClosedLoopScene): ], run_time = 3 ) - self.dither() + self.wait() class WrapUpToTorus(Scene): def construct(self): @@ -1348,15 +1348,15 @@ class TorusPlaneAnalogy(ClosedLoopScene): Dot(number_line.number_to_point(-2), color = RED), ) - self.dither() + self.wait() self.play(ShowCreation(single_pointed_top_arrow)) - self.dither() + self.wait() self.play(ShowCreation(top_arrow)) - self.dither() + self.wait() self.play(ShowCreation(plane)) self.play(ShowCreation(low_arrow)) self.play(ShowCreation(number_line)) - self.dither() + self.wait() class WigglingPairOfPoints(ClosedLoopScene): def construct(self): @@ -1411,7 +1411,7 @@ class TrivialPairCollision(ClosedLoopScene): randy.look_at, label ) self.play(Blink(randy)) - self.dither() + self.wait() swappers = [a, b, a_label, b_label] for mob in swappers: mob.save_state() @@ -1432,7 +1432,7 @@ class TrivialPairCollision(ClosedLoopScene): path_arc = -np.pi ) self.play(Blink(randy)) - self.dither() + self.wait() class NotHelpful(Scene): def construct(self): @@ -1449,7 +1449,7 @@ class NotHelpful(Scene): morty.look, OUT ) self.play(Blink(morty)) - self.dither() + self.wait() class FoldUnitSquare(EdgesOfSquare): def construct(self): @@ -1545,7 +1545,7 @@ class FoldUnitSquare(EdgesOfSquare): self.play(Transform(old_y_line, y_line), Animation(dot)) self.remove(old_x_line, old_y_line) self.add(x_line, y_line, dot) - self.dither(2) + self.wait(2) self.play(FadeOut(label)) if a < b: start_dots.add(dot) @@ -1562,13 +1562,13 @@ class FoldUnitSquare(EdgesOfSquare): ) self.play(ShowCreation(diag_line)) - self.dither() + self.wait() self.play( Transform(*self.triangles), Transform(self.start_dots, self.end_dots), Transform(self.start_arrows, self.end_arrows), ) - self.dither() + self.wait() self.diag_line = diag_line def show_singleton_pairs(self): @@ -1596,7 +1596,7 @@ class FoldUnitSquare(EdgesOfSquare): Transform(old_dot, dot), Transform(old_label, label), ) - self.dither() + self.wait() #Some strange bug necesitating this self.remove(old_label) self.add(label) @@ -1629,7 +1629,7 @@ class FoldUnitSquare(EdgesOfSquare): Write(bubble.content) ) self.play(Blink(randy)) - self.dither() + self.wait() self.randy = randy def clarify_edge_gluing(self): @@ -1650,7 +1650,7 @@ class FoldUnitSquare(EdgesOfSquare): ShowCreation(dot), self.randy.look_at, dot ) - self.dither() + self.wait() for dot in dots[2:]: dot.highlight(MAROON_B) self.play( @@ -1658,7 +1658,7 @@ class FoldUnitSquare(EdgesOfSquare): self.randy.look_at, dot ) self.play(Blink(self.randy)) - self.dither() + self.wait() def get_point_from_coords(self, x, y): left, right, bottom, top = [ @@ -1736,12 +1736,12 @@ class PrepareForMobiusStrip(Scene): self.play(ShowCreation(tri1.cut_arrows)) for tri in self.triangles: tri.add(tri.cut_arrows) - self.dither() + self.wait() self.play( tri1.shift, (DOWN+LEFT)/2., tri2.shift, (UP+RIGHT)/2., ) - self.dither() + self.wait() def rearrange_pieces(self): tri1, tri2 = self.triangles @@ -1750,7 +1750,7 @@ class PrepareForMobiusStrip(Scene): tri1.next_to, ORIGIN, RIGHT, tri2.next_to, ORIGIN, LEFT, ) - self.dither() + self.wait() self.play(*[ ApplyMethod(tri.shift, tri.points[0][0]*LEFT) for tri in self.triangles @@ -1761,12 +1761,12 @@ class PrepareForMobiusStrip(Scene): ]) for tri in self.triangles: tri.remove(tri.original_arrows) - self.dither() + self.wait() # self.play(*[ # ApplyMethod(tri.rotate, -np.pi/4) # for tri in self.triangles # ]) - # self.dither() + # self.wait() class FoldToMobius(Scene): def construct(self): @@ -1793,13 +1793,13 @@ class MobiusPlaneAnalogy(ClosedLoopScene): Dot(number_line.number_to_point(-2), color = RED), ) - self.dither() + self.wait() self.play(ShowCreation(top_arrow)) - self.dither() + self.wait() self.play(ShowCreation(plane)) self.play(ShowCreation(low_arrow)) self.play(ShowCreation(number_line)) - self.dither() + self.wait() class DrawRightArrow(Scene): CONFIG = { @@ -1809,7 +1809,7 @@ class DrawRightArrow(Scene): arrow = TexMobject(self.tex) arrow.scale(4) self.play(Write(arrow)) - self.dither() + self.wait() class DrawLeftrightArrow(DrawRightArrow): CONFIG = { @@ -1839,12 +1839,12 @@ class MobiusToPairToSurface(ClosedLoopScene): ShowCreation(top_arrow), randy.look_at, self.loop ) - self.dither() + self.wait() self.look_at(strip_dot, surface_dot) self.play(ShowCreation(diag_arrow)) self.play(Blink(randy)) self.look_at(strip_dot, self.loop) - self.dither() + self.wait() self.play( ShowCreation(right_arrow), randy.look_at, surface_dot @@ -1852,7 +1852,7 @@ class MobiusToPairToSurface(ClosedLoopScene): self.play(Blink(randy)) self.play(randy.change_mode, "happy") self.play(Blink(randy)) - self.dither() + self.wait() def look_at(self, *things): @@ -1995,7 +1995,7 @@ class PatreonThanks(Scene): for patrons in left_patrons, right_patrons: for index in 0, -1: self.play(morty.look_at, patrons[index]) - self.dither() + self.wait() class CreditTWo(Scene): def construct(self): @@ -2022,23 +2022,23 @@ class CreditTWo(Scene): Animation(morty) ) self.play(morty.change_mode, "happy") - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() self.play( FadeIn(brother), morty.look_at, brother.eyes ) self.play(brother.change_mode, "surprised") self.play(Blink(brother)) - self.dither() + self.wait() self.play( morty.look, LEFT, brother.change_mode, "happy", brother.look, LEFT ) self.play(Blink(morty)) - self.dither() + self.wait() class CreditThree(Scene): def construct(self): @@ -2070,7 +2070,7 @@ class CreditThree(Scene): randy.change_mode, "happy", randy.look_at, logo_dot ) - self.dither() + self.wait() self.play( ShowCreation(bubble), randy.change_mode, "pondering", @@ -2081,33 +2081,33 @@ class CreditThree(Scene): Transform(bubble, VectorizedPoint(randy.get_corner(UP+LEFT))), randy.change_mode, "sad" ) - self.dither() + self.wait() self.play( Write(domains, run_time = 5, lag_factor = 5), randy.look_at, domains ) - self.dither() + self.wait() self.play(Blink(randy)) self.play( randy.change_mode, "hooray", randy.look_at, logo_dot, FadeOut(domains) ) - self.dither() + self.wait() self.play( Write(whois), randy.change_mode, "confused", randy.look_at, whois ) - self.dither(2) + self.wait(2) self.play(randy.change_mode, "sassy") - self.dither(2) + self.wait(2) self.play( randy.change_mode, "happy", randy.look_at, logo_dot ) self.play(Blink(randy)) - self.dither() + self.wait() class ShiftingLoopPairSurface(Scene): diff --git a/old_projects/zeta.py b/old_projects/zeta.py index 1efcf1ca..064d2986 100644 --- a/old_projects/zeta.py +++ b/old_projects/zeta.py @@ -164,7 +164,7 @@ class TestZetaOnHalfPlane(ZetaTransformationScene): ])) print(len(self.plane.family_members_with_points())) self.apply_zeta_function() - self.dither() + self.wait() class TestZetaOnFullPlane(ZetaTransformationScene): def construct(self): @@ -180,9 +180,9 @@ class TestZetaOnLine(ZetaTransformationScene): self.add_transformable_plane() self.plane.submobjects = [line] self.apply_zeta_function() - self.dither(2) + self.wait(2) self.play(ShowCreation(line, run_time = 10)) - self.dither(3) + self.wait(3) ###################### @@ -215,16 +215,16 @@ class IntroduceZeta(ZetaTransformationScene): reflected_plane = self.get_reflected_plane() self.play(ShowCreation(reflected_plane, run_time = 2)) self.plane.add(reflected_plane) - self.dither() + self.wait() self.apply_zeta_function() - self.dither(2) + self.wait(2) self.play(FadeIn(randy)) self.play( randy.change_mode, "confused", randy.look_at, func_mob, ) self.play(Blink(randy)) - self.dither() + self.wait() class WhyPeopleMayKnowIt(TeacherStudentsScene): def construct(self): @@ -261,7 +261,7 @@ class WhyPeopleMayKnowIt(TeacherStudentsScene): ) student = self.get_students()[2] self.random_blink() - self.dither(2) + self.wait(2) self.student_thinks( divergent_sum, student_index = 1, added_anims = [student.change_mode, "plain"] @@ -276,12 +276,12 @@ class WhyPeopleMayKnowIt(TeacherStudentsScene): [pi.change_mode, "confused", pi.look_at, divergent_sum] for pi in self.get_pi_creatures() ])) - self.dither() + self.wait() self.random_blink() divergent_sum[1].highlight(WHITE) self.play(Write(divergent_sum[1])) self.random_blink() - self.dither() + self.wait() #Ask about continuation self.student_says( @@ -299,9 +299,9 @@ class WhyPeopleMayKnowIt(TeacherStudentsScene): self.get_teacher().look_at, student.eyes, ) self.random_blink() - self.dither(2) + self.wait(2) self.random_blink() - self.dither() + self.wait() class ComplexValuedFunctions(ComplexTransformationScene): def construct(self): @@ -321,13 +321,13 @@ class ComplexValuedFunctions(ComplexTransformationScene): f_z.highlight(z_out.get_color()) self.add(z_in, z) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.play( ShowCreation(z_out), Write(f_z) ) - self.dither(2) + self.wait(2) class PreviewZetaAndContinuation(ZetaTransformationScene): CONFIG = { @@ -364,15 +364,15 @@ class PreviewZetaAndContinuation(ZetaTransformationScene): reflected_plane.apply_complex_function(zeta) reflected_plane.make_smooth() reflected_plane.set_stroke(width = 2) - self.dither() + self.wait() self.play(Transform(*titles)) - self.dither() + self.wait() self.play(ShowCreation( reflected_plane, submobject_mode = "all_at_once", run_time = 2 )) - self.dither() + self.wait() class AssumeKnowledgeOfComplexNumbers(ComplexTransformationScene): def construct(self): @@ -403,7 +403,7 @@ class AssumeKnowledgeOfComplexNumbers(ComplexTransformationScene): text.to_corner(UP+LEFT) self.play(Write(text[0])) - self.dither() + self.wait() self.play(FadeIn(text[1])) self.play( ShowCreation(x_line), @@ -412,9 +412,9 @@ class AssumeKnowledgeOfComplexNumbers(ComplexTransformationScene): Write(complex_number_label), ) self.play(Write(text[2])) - self.dither(2) + self.wait(2) self.play(Write(text[3])) - self.dither() + self.wait() self.play(text[3].fade) class DefineForRealS(PiCreatureScene): @@ -441,18 +441,18 @@ class DefineForRealS(PiCreatureScene): ) self.remove(pre_zeta_s) self.add(zeta_s) - self.dither() + self.wait() for count, term in enumerate(sum_terms): self.play(FadeIn(term), run_time = 0.5) if count%2 == 0: - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(sigma), self.pi_creature.change_mode, "pondering" ) - self.dither() + self.wait() def plug_in_two(self, zeta_def): two_def = self.get_definition("2")[0] @@ -496,7 +496,7 @@ class DefineForRealS(PiCreatureScene): approx.next_to(pi_term) self.play(Transform(zeta_def, two_def)) - self.dither() + self.wait() self.play(ShowCreation(number_line)) for frac, brace, line in zip(fracs, braces, lines): @@ -506,24 +506,24 @@ class DefineForRealS(PiCreatureScene): ShowCreation(line), run_time = 0.7 ) - self.dither(0.7) - self.dither() + self.wait(0.7) + self.wait() self.play( ShowCreation(VGroup(*lines[4:])), Write(dots) ) - self.dither() + self.wait() self.play( Write(pi_term), ShowCreation(VGroup(pi_arrow, pi_dot)), self.pi_creature.change_mode, "hooray" ) - self.dither() + self.wait() self.play( Write(approx), self.pi_creature.change_mode, "happy" ) - self.dither(3) + self.wait(3) self.play(*map(FadeOut, [ fracs, pi_arrow, pi_dot, approx, ])) @@ -538,7 +538,7 @@ class DefineForRealS(PiCreatureScene): sum_terms, brace, sigma = zeta_def[1:] for exponent, final_sum in zip([3, 4], final_sums): self.transition_to_new_input(zeta_def, exponent, final_sum) - self.dither() + self.wait() arrow = Arrow(sum_terms.get_left(), sum_terms.get_right()) arrow.next_to(sum_terms, DOWN) @@ -546,13 +546,13 @@ class DefineForRealS(PiCreatureScene): smaller_words.next_to(arrow, DOWN) self.arrow, self.smaller_words = arrow, smaller_words - self.dither() + self.wait() self.play( ShowCreation(arrow), Write(smaller_words) ) self.change_mode("happy") - self.dither(2) + self.wait(2) def plug_in_negative_values(self, zeta_def): zeta_s, sum_terms, brace, sigma = zeta_def @@ -583,7 +583,7 @@ class DefineForRealS(PiCreatureScene): Transform(smaller_words, bigger_words), self.final_sum.next_to, new_sum_terms, RIGHT ) - self.dither(3) + self.wait(3) #plug in -2 new_sum_terms = TexMobject( @@ -605,9 +605,9 @@ class DefineForRealS(PiCreatureScene): Transform(self.lines, lines), Transform(self.braces, braces), ) - self.dither() + self.wait() self.change_mode("pleading") - self.dither(2) + self.wait(2) def get_definition(self, input_string, input_color = YELLOW): inputs = VGroup() @@ -739,7 +739,7 @@ class ReadIntoZetaFunction(Scene): ) self.play(Blink(randy)) self.play(randy.look_at, statement) - self.dither() + self.wait() class ReadIntoZetaFunctionTrivialZero(ReadIntoZetaFunction): CONFIG = { @@ -804,7 +804,7 @@ class RiemannFatherOfComplex(ComplexTransformationScene): self.add(photo) self.play(Write(name)) - self.dither() + self.wait() input_dot = Dot(2*RIGHT+UP, color = YELLOW) arc = Arc(-2*np.pi/3) @@ -830,7 +830,7 @@ class RiemannFatherOfComplex(ComplexTransformationScene): ShowCreation(output_dot), Write(output_dot.label) ) - self.dither() + self.wait() class FromRealToComplex(ComplexTransformationScene): CONFIG = { @@ -886,7 +886,7 @@ class FromRealToComplex(ComplexTransformationScene): two = zeta[1][2].copy() sum_term = zeta[-1] self.add(number_line, *zeta[:-1]) - self.dither() + self.wait() self.play(Transform(two, input_dot)) self.remove(two) self.add(input_dot) @@ -895,7 +895,7 @@ class FromRealToComplex(ComplexTransformationScene): self.play(Transform(output_dot.copy(), sum_term)) self.remove(*self.get_mobjects_from_last_animation()) self.add(sum_term) - self.dither(2) + self.wait(2) self.play( ShowCreation( self.background, @@ -905,7 +905,7 @@ class FromRealToComplex(ComplexTransformationScene): Animation(zeta), Animation(input_dot) ) - self.dither(2) + self.wait(2) self.zeta = zeta self.input_dot = input_dot @@ -927,12 +927,12 @@ class FromRealToComplex(ComplexTransformationScene): self.input_label = input_label self.play(Transform(self.zeta, complex_zeta)) - self.dither() + self.wait() self.play( input_label.restore, MoveToTarget(input_dot) ) - self.dither(2) + self.wait(2) def single_out_complex_exponent(self): frac_scale_factor = 1.2 @@ -979,16 +979,16 @@ class FromRealToComplex(ComplexTransformationScene): self.play(Transform(frac, new_frac)) self.play(Write(words)) for x in range(2): - self.dither(2) + self.wait(2) self.play(Blink(randy)) self.play( Transform(words, new_words), randy.change_mode, "maybe" ) - self.dither() + self.wait() self.play(Blink(randy)) self.play(randy.change_mode, "happy") - self.dither() + self.wait() self.play(*map(FadeOut, [randy, bubble, frac, words])) def show_s_equals_two_lines(self): @@ -1017,9 +1017,9 @@ class FromRealToComplex(ComplexTransformationScene): self.play(line.restore) later_lines = VGroup(*lines[4:]) transform_and_replace(dots_copy, later_lines) - self.dither() + self.wait() transform_and_replace(pi_copy, output_dot) - self.dither() + self.wait() self.lines = lines self.output_dot = output_dot @@ -1034,23 +1034,23 @@ class FromRealToComplex(ComplexTransformationScene): self.input_dot.shift, 2*UP, self.input_label.restore, ) - self.dither() + self.wait() self.play(Transform(self.zeta, zeta)) - self.dither() + self.wait() self.play( Transform(self.lines, lines), Transform(self.output_dot, output_dot), run_time = 2, path_arc = -np.pi/6, ) - self.dither() + self.wait() def vary_complex_input(self): zeta = self.get_zeta_definition("s", "") zeta[3].highlight(BLACK) self.play(Transform(self.zeta, zeta)) self.play(FadeOut(self.input_label)) - self.dither(2) + self.wait(2) inputs = [ complex(1.5, 1.8), complex(1.5, -1), @@ -1070,8 +1070,8 @@ class FromRealToComplex(ComplexTransformationScene): Transform(self.output_dot, output_dot), run_time = 2 ) - self.dither() - self.dither() + self.wait() + self.wait() def show_domain_of_convergence(self, opacity = 0.2): domain = Rectangle( @@ -1106,10 +1106,10 @@ class FromRealToComplex(ComplexTransformationScene): self.play(FadeIn(domain)) self.play(Write(domain_words)) - self.dither() + self.wait() self.play(FadeIn(anti_domain)) self.play(Write(anti_domain_words)) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [ anti_domain, anti_domain_words, ])) @@ -1133,7 +1133,7 @@ class FromRealToComplex(ComplexTransformationScene): Write(bubble.content) ) self.play(Blink(morty)) - self.dither(3) + self.wait(3) self.play( morty.change_mode, "pondering", morty.look_at, self.input_dot, @@ -1145,7 +1145,7 @@ class FromRealToComplex(ComplexTransformationScene): arrow.highlight(WHITE) self.play(ShowCreation(arrow)) self.play(Blink(morty)) - self.dither() + self.wait() def get_zeta_definition(self, input_string, output_string, input_color = YELLOW): inputs = VGroup() @@ -1278,7 +1278,7 @@ class ComplexExponentiation(Scene): VGroup(brace, we_understand).highlight(GREEN_B) self.add(original) - self.dither() + self.wait() self.play(*[ Transform(*pair) for pair in [ @@ -1290,18 +1290,18 @@ class ComplexExponentiation(Scene): ]) self.remove(*self.get_mobjects_from_last_animation()) self.add(real_part, imag_part) - self.dither() + self.wait() self.play( GrowFromCenter(brace), FadeIn(we_understand), real_part.highlight, GREEN_B ) - self.dither() + self.wait() self.play( imag_part.move_to, imag_part.get_left(), *map(FadeOut, [brace, we_understand, real_part]) ) - self.dither() + self.wait() self.imag_exponent = imag_part def add_on_planes(self): @@ -1360,7 +1360,7 @@ class ComplexExponentiation(Scene): run_time = 3 ) self.play(ShowCreation(arrow)) - self.dither() + self.wait() self.left_plane = left_plane self.right_plane = right_plane @@ -1406,15 +1406,15 @@ class ComplexExponentiation(Scene): self.play(Transform(exp, new_exp)) self.play(input_dot.shift, 2*UP) self.play(input_dot.shift, 2*DOWN) - self.dither() + self.wait() self.play(output_dot.restore) - self.dither() + self.wait() walk_up_and_down() - self.dither() + self.wait() curr_base = 1./9 self.play(Transform(denom, nine)) walk_up_and_down() - self.dither() + self.wait() def z_to_point(self, z, is_input = True): if is_input: @@ -1443,7 +1443,7 @@ class SizeAndRotationBreakdown(Scene): rotation = rotation_brace.get_text("Rotation") self.add(original) - self.dither() + self.wait() self.play(*[ Transform(*pair) for pair in [ @@ -1461,7 +1461,7 @@ class SizeAndRotationBreakdown(Scene): GrowFromCenter(rotation_brace), Write(rotation) ) - self.dither() + self.wait() class SeeLinksInDescription(TeacherStudentsScene): def construct(self): @@ -1495,7 +1495,7 @@ class ShowMultiplicationOfRealAndImaginaryExponentialParts(FromRealToComplex): imag_part = VGroup(*split[2:]) self.add(rect, original) - self.dither() + self.wait() self.play(*[ Transform(*pair) for pair in [ @@ -1507,7 +1507,7 @@ class ShowMultiplicationOfRealAndImaginaryExponentialParts(FromRealToComplex): ]) self.remove(*self.get_mobjects_from_last_animation()) self.add(real_part, imag_part) - self.dither() + self.wait() self.real_part = real_part self.imag_part = imag_part @@ -1551,7 +1551,7 @@ class ShowMultiplicationOfRealAndImaginaryExponentialParts(FromRealToComplex): GrowFromCenter(brace), ShowCreation(fourth_line), ) - self.dither() + self.wait() self.play( imag_part.scale, 0.7, imag_part.next_to, imag_power_dot, DOWN+RIGHT, SMALL_BUFF, @@ -1559,7 +1559,7 @@ class ShowMultiplicationOfRealAndImaginaryExponentialParts(FromRealToComplex): ) self.play(ShowCreation(circle), Animation(imag_power_dot)) self.play(ShowCreation(imag_power_line)) - self.dither(2) + self.wait(2) self.play( fourth_group.rotate, imag_power_line.get_angle() ) @@ -1568,7 +1568,7 @@ class ShowMultiplicationOfRealAndImaginaryExponentialParts(FromRealToComplex): real_part.target.next_to(brace, UP+RIGHT, buff = 0) imag_part.target.next_to(real_part.target, buff = 0) self.play(*map(MoveToTarget, [real_part, imag_part])) - self.dither() + self.wait() class ComplexFunctionsAsTransformations(ComplexTransformationScene): def construct(self): @@ -1585,8 +1585,8 @@ class ComplexFunctionsAsTransformations(ComplexTransformationScene): Transform(in_dot.copy(), out_dot), ShowCreation(arrow) ) - self.dither() - self.dither() + self.wait() + self.wait() def add_title(self): @@ -1653,7 +1653,7 @@ class VisualizingSSquared(ComplexTransformationScene): title.to_corner(UP+LEFT) self.play(Write(title)) self.add_foreground_mobject(title) - self.dither() + self.wait() self.title = title def plug_in_specific_values(self): @@ -1695,10 +1695,10 @@ class VisualizingSSquared(ComplexTransformationScene): input_dot.set_fill(opacity = 0) self.play(input_dot.restore) - self.dither() + self.wait() self.play(ShowCreation(arrow)) self.play(ShowCreation(output_dot)) - self.dither() + self.wait() self.add_foreground_mobjects(arrows, output_dots, input_dots) self.input_dots = input_dots self.output_dots = output_dots @@ -1717,7 +1717,7 @@ class VisualizingSSquared(ComplexTransformationScene): self.add_transformable_plane() self.play(ShowCreation(self.plane, run_time = 3)) - self.dither() + self.wait() self.apply_complex_homotopy( lambda z, t : z**(1+t), added_anims = [ @@ -1726,7 +1726,7 @@ class VisualizingSSquared(ComplexTransformationScene): ], run_time = 5 ) - self.dither(2) + self.wait(2) def comment_on_two_dimensions(self): @@ -1748,7 +1748,7 @@ class VisualizingSSquared(ComplexTransformationScene): Write(bubble.content), ) self.play(Blink(morty)) - self.dither(2) + self.wait(2) class ShowZetaOnHalfPlane(ZetaTransformationScene): CONFIG = { @@ -1784,12 +1784,12 @@ class ShowZetaOnHalfPlane(ZetaTransformationScene): def initial_transformation(self): self.add_transformable_plane() - self.dither() + self.wait() self.add_extra_plane_lines_for_zeta(animate = True) - self.dither(2) + self.wait(2) self.plane.save_state() self.apply_zeta_function() - self.dither(2) + self.wait(2) def react_to_transformation(self): morty = Mortimer().flip() @@ -1808,7 +1808,7 @@ class ShowZetaOnHalfPlane(ZetaTransformationScene): ) self.play(Blink(morty)) self.play(morty.look_at, self.plane.get_top()) - self.dither() + self.wait() self.play( morty.look_at, self.plane.get_bottom(), *map(FadeOut, [bubble, bubble.content]) @@ -1840,7 +1840,7 @@ class ShowZetaOnHalfPlane(ZetaTransformationScene): run_time = 2 ) self.play(FadeOut(arrows[0])) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [words, line])) def highlight_i_line(self): @@ -1869,17 +1869,17 @@ class ShowZetaOnHalfPlane(ZetaTransformationScene): right_i_lines.set_stroke(YELLOW, width = 3) self.play(ShowCreation(right_i_lines)) self.plane.save_state() - self.dither(2) + self.wait(2) self.apply_zeta_function() - self.dither(2) + self.wait(2) left_i_lines.save_state() left_i_lines.apply_complex_function(zeta) self.play(ShowCreation(left_i_lines, run_time = 5)) - self.dither() + self.wait() self.restore_mobjects(self.plane, left_i_lines) self.play(Transform(self.plane, colored_plane)) - self.dither() + self.wait() self.left_i_lines = left_i_lines def show_continuation(self): @@ -1887,15 +1887,15 @@ class ShowZetaOnHalfPlane(ZetaTransformationScene): self.play(ShowCreation(reflected_plane, run_time = 2)) self.plane.add(reflected_plane) self.remove(self.left_i_lines) - self.dither() + self.wait() self.apply_zeta_function() - self.dither(2) + self.wait(2) self.play(ShowCreation( reflected_plane, run_time = 6, rate_func = lambda t : 1-there_and_back(t) )) - self.dither(2) + self.wait(2) def emphsize_sum_doesnt_make_sense(self): brace = Brace(VGroup(*self.zeta[1][3:])) @@ -1914,9 +1914,9 @@ class ShowZetaOnHalfPlane(ZetaTransformationScene): GrowFromCenter(brace), Write(words) ) - self.dither(2) + self.wait(2) self.play(Write(divergent_sum)) - self.dither(2) + self.wait(2) def restore_mobjects(self, *mobjects): self.play(*it.chain(*[ @@ -1950,14 +1950,14 @@ class ShowConditionalDefinition(Scene): sigma.save_state() sigma.next_to(zeta) self.add(zeta, sigma) - self.dither() + self.wait() self.play( sigma.restore, GrowFromCenter(brace), FadeIn(something_else) ) self.play(Write(conditions)) - self.dither() + self.wait() underbrace = Brace(something_else) question = underbrace.get_text(""" @@ -1970,7 +1970,7 @@ class ShowConditionalDefinition(Scene): Write(question), something_else.highlight, GREEN_B ) - self.dither(2) + self.wait(2) class SquiggleOnExtensions(ZetaTransformationScene): CONFIG = { @@ -2022,7 +2022,7 @@ class SquiggleOnExtensions(ZetaTransformationScene): self.play(Write(label, run_time = 1)) self.play(*map(ShowCreation, [arrow, dot])) - self.dither() + self.wait() self.play(*map(FadeOut, [arrow, label])) return dot @@ -2084,18 +2084,18 @@ class SquiggleOnExtensions(ZetaTransformationScene): Transform(self.dot, dot), run_time = 3 ) - self.dither() + self.wait() self.play(FadeOut(self.dot)) #Squiggle on example - self.dither() + self.wait() self.play(FadeOut(self.left_plane)) self.play(ShowCreation( self.left_plane, run_time = 5, rate_func = None )) - self.dither() + self.wait() def lock_into_place(self): words = TextMobject( @@ -2112,7 +2112,7 @@ class SquiggleOnExtensions(ZetaTransformationScene): self.play(Write(words)) self.add_foreground_mobjects(words) self.play(self.left_plane.restore) - self.dither() + self.wait() class DontKnowDerivatives(TeacherStudentsScene): def construct(self): @@ -2167,11 +2167,11 @@ class IntroduceAnglePreservation(VisualizingSSquared): self.add_transformable_plane() self.play(Write(title)) self.add_foreground_mobjects(title) - self.dither() + self.wait() def show_initial_transformation(self): self.apply_function() - self.dither(2) + self.wait(2) self.reset() def talk_about_derivative(self): @@ -2196,7 +2196,7 @@ class IntroduceAnglePreservation(VisualizingSSquared): Write(randy.bubble.content) ) self.play(Blink(morty)) - self.dither() + self.wait() self.play( morty.change_mode, "speaking", randy.change_mode, "pondering", @@ -2204,7 +2204,7 @@ class IntroduceAnglePreservation(VisualizingSSquared): Write(morty.bubble.content), ) self.play(Blink(randy)) - self.dither() + self.wait() self.play(*map(FadeOut, [ randy, morty, randy.bubble, randy.bubble.content, @@ -2243,12 +2243,12 @@ class IntroduceAnglePreservation(VisualizingSSquared): intersection_inputs )) self.apply_function() - self.dither() + self.wait() self.play( ShowCreation(brackets, run_time = 5), Animation(self.plane) ) - self.dither() + self.wait() def name_analytic(self): equiv = TextMobject("``Analytic'' $\\Leftrightarrow$ Angle-preserving") @@ -2262,9 +2262,9 @@ class IntroduceAnglePreservation(VisualizingSSquared): VGroup(equiv, kind_of).next_to(ORIGIN, UP, buff = 1) self.play(Write(equiv)) - self.dither(2) + self.wait(2) self.play(Write(kind_of, run_time = 1)) - self.dither(2) + self.wait(2) def reset(self, faded = True): self.play(FadeOut(self.plane)) @@ -2329,7 +2329,7 @@ class IntroduceAnglePreservation(VisualizingSSquared): ShowCreation(angle_arrow), ShowCreation(arc) ) - self.dither() + self.wait() self.play(FadeOut(angle_group)) self.plane.add(*lines) @@ -2343,7 +2343,7 @@ class IntroduceAnglePreservation(VisualizingSSquared): Write(angle_tex), ShowCreation(arrow) ) - self.dither(2) + self.wait(2) self.play(*map(FadeOut, [arc, angle_tex, arrow])) def put_angle_tex_next_to_arc(self, angle_tex, arc): @@ -2383,7 +2383,7 @@ class AngleAtZeroDerivativePoints(IntroduceAnglePreservation): self.show_angle_preservation_between_lines( line, line.copy().rotate(np.pi/5) ) - self.dither() + self.wait() def add_title(self): title = TexMobject("f(", "s", ")=", "s", "^2") @@ -2427,7 +2427,7 @@ class AnglePreservationAtAnyPairOfPoints(IntroduceAnglePreservation): run_time = 2, path_arc = np.pi )) - self.dither() + self.wait() self.show_angle_preservation_between_lines(*line_pair) self.show_example_analytic_functions() @@ -2471,7 +2471,7 @@ class AnglePreservationAtAnyPairOfPoints(IntroduceAnglePreservation): self.play(Write(words)) for function in functions: self.play(FadeIn(function)) - self.dither() + self.wait() class NoteZetaFunctionAnalyticOnRightHalf(ZetaTransformationScene): CONFIG = { @@ -2506,7 +2506,7 @@ class NoteZetaFunctionAnalyticOnRightHalf(ZetaTransformationScene): intersection_inputs )) self.play(ShowCreation(brackets, run_time = 3)) - self.dither() + self.wait() def get_right_angle_bracket(self, input_z): output_z = zeta(input_z) @@ -2555,14 +2555,14 @@ class InfiniteContinuousJigsawPuzzle(ZetaTransformationScene): for word in title: word.add_to_back(BackgroundRectangle(word)) self.play(FadeIn(word)) - self.dither() + self.wait() self.add_foreground_mobjects(title) self.title = title def show_jigsaw(self): for piece in self.pieces: self.play(FadeIn(piece, run_time = 0.5)) - self.dither() + self.wait() def name_analytic_continuation(self): words = TextMobject("``Analytic continuation''") @@ -2571,7 +2571,7 @@ class InfiniteContinuousJigsawPuzzle(ZetaTransformationScene): words.next_to(self.title, DOWN, buff = LARGE_BUFF) words.add_background_rectangle() self.play(Write(words)) - self.dither() + self.wait() class ThatsHowZetaIsDefined(TeacherStudentsScene): def construct(self): @@ -2748,7 +2748,7 @@ class MathematiciansLookingAtFunctionEquation(Scene): )) for mathy in mathys: self.play(Blink(mathy)) - self.dither() + self.wait() class DiscussZeros(ZetaTransformationScene): def construct(self): @@ -2790,7 +2790,7 @@ class DiscussZeros(ZetaTransformationScene): for mob in dots, arrows, q_marks: self.play(ShowCreation(mob)) self.play(Write(question)) - self.dither(2) + self.wait(2) dots.generate_target() for i, dot in enumerate(dots.target): dot.move_to(2*(i+1)*LEFT) @@ -2800,7 +2800,7 @@ class DiscussZeros(ZetaTransformationScene): FadeOut(question), MoveToTarget(dots), ) - self.dither() + self.wait() self.dots = dots def show_trivial_zeros(self): @@ -2824,7 +2824,7 @@ class DiscussZeros(ZetaTransformationScene): added_anims = [MoveToTarget(self.dots, run_time = 3)], run_time = 3 ) - self.dither(3) + self.wait(3) self.play( self.plane.restore, self.plane.make_smooth, @@ -2837,7 +2837,7 @@ class DiscussZeros(ZetaTransformationScene): self.add(self.plane, self.dots) self.play(Write(trivial_zero_words)) - self.dither() + self.wait() self.play(FadeIn(randy)) self.play( randy.change_mode, "confused", @@ -2845,7 +2845,7 @@ class DiscussZeros(ZetaTransformationScene): Write(bubble.content) ) self.play(Blink(randy)) - self.dither() + self.wait() self.play(Blink(randy)) self.play(*map(FadeOut, [ randy, bubble, bubble.content, trivial_zero_words @@ -2904,7 +2904,7 @@ class DiscussZeros(ZetaTransformationScene): ) self.play(Transform(self.dots, new_dots)) self.play(ShowCreation(critical_line)) - self.dither(3) + self.wait(3) self.play( photo.shift, 7*LEFT, *map(FadeOut, [ @@ -2953,14 +2953,14 @@ class DiscussZeros(ZetaTransformationScene): rate_func = there_and_back, run_time = 2 ) - self.dither() + self.wait() self.play( self.plane.set_stroke, GREY, 1, Animation(self.critical_line) ) self.plane.add(self.critical_line) self.apply_zeta_function() - self.dither(2) + self.wait(2) self.play( self.plane.fade, Animation(self.critical_line) @@ -2978,7 +2978,7 @@ class DiscussZeros(ZetaTransformationScene): YELLOW, BLUE, GREEN, RED, YELLOW, BLUE, GREEN, RED, ) self.play(ShowCreation(full_line, run_time = 20, rate_func = None)) - self.dither() + self.wait() class AskAboutRelationToPrimes(TeacherStudentsScene): def construct(self): @@ -3037,13 +3037,13 @@ class HighlightCriticalLineAgain(DiscussZeros): ) self.play(FadeOut(arrow1)) self.play(Blink(randy)) - self.dither() + self.wait() self.play(randy.look_at, line.get_center()) self.play(randy.change_mode, "confused") self.play(Blink(randy)) - self.dither() + self.wait() self.play(randy.change_mode, "pondering") - self.dither() + self.wait() class DiscussSumOfNaturals(Scene): def construct(self): @@ -3085,21 +3085,21 @@ class DiscussSumOfNaturals(Scene): words.next_to(brace, DOWN) self.add(neg_twelfth, eq, zeta_neg_1, randy, title) - self.dither() + self.wait() self.play( Write(sum_naturals), Write(q_mark), randy.change_mode, "confused" ) self.play(Blink(randy)) - self.dither() + self.wait() self.play(randy.change_mode, "angry") self.play( ShowCreation(sum_to_zeta), Write(cross) ) self.play(Blink(randy)) - self.dither() + self.wait() self.play( Transform(sum_to_zeta, sum_to_ac), FadeOut(cross), @@ -3109,16 +3109,16 @@ class DiscussSumOfNaturals(Scene): ) self.play(ShowCreation(ac_to_zeta)) self.play(Blink(randy)) - self.dither() + self.wait() self.play( GrowFromCenter(brace), Write(words[0]), randy.look_at, words[0], ) - self.dither() + self.wait() self.play(FadeIn(words[1])) self.play(Blink(randy)) - self.dither() + self.wait() class InventingMathPreview(Scene): def construct(self): @@ -3134,7 +3134,7 @@ class InventingMathPreview(Scene): Write(title) ) self.play(Write(sum_tex)) - self.dither() + self.wait() class FinalAnimationTease(Scene): def construct(self): @@ -3153,7 +3153,7 @@ class FinalAnimationTease(Scene): Write(bubble.content) ) self.play(Blink(morty)) - self.dither() + self.wait() class PatreonThanks(Scene): CONFIG = { @@ -3214,7 +3214,7 @@ class PatreonThanks(Scene): for patrons in left_patrons, right_patrons: for index in 0, -1: self.play(morty.look_at, patrons[index]) - self.dither() + self.wait() class CreditTwo(Scene): def construct(self): @@ -3242,16 +3242,16 @@ class CreditTwo(Scene): ) self.play(morty.change_mode, "happy") for x in range(4): - self.dither() + self.wait() self.play(Blink(morty)) - self.dither() + self.wait() self.play( FadeIn(brother), morty.look_at, brother.eyes ) self.play(brother.change_mode, "surprised") self.play(Blink(brother)) - self.dither() + self.wait() self.play( morty.look, LEFT, brother.change_mode, "happy", @@ -3259,9 +3259,9 @@ class CreditTwo(Scene): ) for x in range(10): self.play(Blink(morty)) - self.dither() + self.wait() self.play(Blink(brother)) - self.dither() + self.wait() class FinalAnimation(ZetaTransformationScene): CONFIG = { @@ -3279,9 +3279,9 @@ class FinalAnimation(ZetaTransformationScene): self.play(Write(title)) self.add_foreground_mobjects(title) - self.dither() + self.wait() self.apply_complex_function(d_zeta, run_time = 8) - self.dither() + self.wait() class Thumbnail(ZetaTransformationScene): CONFIG = { @@ -3358,4 +3358,4 @@ class ZetaPartialSums(ZetaTransformationScene): Transform(self.plane, plane), Transform(symbol, sigma) ) - self.dither() + self.wait() diff --git a/scene/reconfigurable_scene.py b/scene/reconfigurable_scene.py index 25a57210..51843b0c 100644 --- a/scene/reconfigurable_scene.py +++ b/scene/reconfigurable_scene.py @@ -62,7 +62,7 @@ class ReconfigurableScene(Scene): def transition_between_states(self, start_state, target_state, **kwargs): self.play(Transform(start_state, target_state, **kwargs)) - self.dither() + self.wait() diff --git a/scene/scene.py b/scene/scene.py index 87dd45d5..823b642d 100644 --- a/scene/scene.py +++ b/scene/scene.py @@ -154,7 +154,7 @@ class Scene(object): wind_down_time = kwargs.get("wind_down_time", 1) for continual_animation in continual_animations: continual_animation.begin_wind_down(wind_down_time) - self.dither(wind_down_time) + self.wait(wind_down_time) #TODO, this is not done with the remove method so as to #keep the relevant mobjects. Better way? self.continual_animations = filter( @@ -422,7 +422,7 @@ class Scene(object): return self.mobjects_from_last_animation return [] - def dither(self, duration = DEFAULT_DITHER_TIME): + def wait(self, duration = DEFAULT_wait_TIME): if self.skip_animations: return self diff --git a/topics/arithmetic.py b/topics/arithmetic.py index 39eb062d..67579bfc 100644 --- a/topics/arithmetic.py +++ b/topics/arithmetic.py @@ -50,12 +50,12 @@ class RearrangeEquation(Scene): self.add(*start_mobs) if leave_start_terms: self.add(Mobject(*start_mobs)) - self.dither() + self.wait() self.play(*[ Transform(*pair, **transform_kwargs) for pair in mobject_pairs ]) - self.dither() + self.wait() def get_mobs_from_terms(self, start_terms, end_terms): diff --git a/topics/characters.py b/topics/characters.py index 13957e02..8985f714 100644 --- a/topics/characters.py +++ b/topics/characters.py @@ -385,7 +385,7 @@ class RemovePiCreatureBubble(AnimationGroup): class PiCreatureScene(Scene): CONFIG = { - "total_dither_time" : 0, + "total_wait_time" : 0, "seconds_to_blink" : 3, "pi_creatures_start_on_screen" : True, } @@ -564,21 +564,21 @@ class PiCreatureScene(Scene): ]) return self - def dither(self, time = 1, blink = True): + def wait(self, time = 1, blink = True): while time >= 1: - time_to_blink = self.total_dither_time%self.seconds_to_blink == 0 + time_to_blink = self.total_wait_time%self.seconds_to_blink == 0 if blink and self.any_pi_creatures_on_screen() and time_to_blink: self.blink() else: - self.non_blink_dither() + self.non_blink_wait() time -= 1 - self.total_dither_time += 1 + self.total_wait_time += 1 if time > 0: - self.non_blink_dither(time) + self.non_blink_wait(time) return self - def non_blink_dither(self, time = 1): - Scene.dither(self, time) + def non_blink_wait(self, time = 1): + Scene.wait(self, time) return self def change_mode(self, mode): diff --git a/topics/combinatorics.py b/topics/combinatorics.py index 60c29003..6d8f8286 100644 --- a/topics/combinatorics.py +++ b/topics/combinatorics.py @@ -49,13 +49,13 @@ class CountingScene(Scene): if mode == "highlight": original_color = mob.color mob.highlight(color) - self.dither(frame_time) + self.wait(frame_time) mob.highlight(original_color) if mode == "show_creation": self.play(ShowCreation(mob, run_time = frame_time)) if mode == "show": self.add(mob) - self.dither(frame_time) + self.wait(frame_time) if display_numbers: self.remove(num_mob) if display_numbers: @@ -76,7 +76,7 @@ class CountingScene(Scene): num_mob.center().shift(num_offset) self.add(num_mob) self.highlight_region(region) - self.dither(frame_time) + self.wait(frame_time) if mode == "one_at_a_time": self.reset_background() self.remove(num_mob) diff --git a/topics/common_scenes.py b/topics/common_scenes.py index 3533e5ff..0236f372 100644 --- a/topics/common_scenes.py +++ b/topics/common_scenes.py @@ -30,9 +30,9 @@ class OpeningQuote(Scene): self.author = self.get_author(self.quote) self.play(FadeIn(self.quote, **self.fade_in_kwargs)) - self.dither(2) + self.wait(2) self.play(Write(self.author, run_time = 3)) - self.dither() + self.wait() def get_quote(self, max_width = 2*SPACE_WIDTH-1): text_mobject_kwargs = { @@ -198,7 +198,7 @@ class TODOStub(Scene): } def construct(self): self.add(TextMobject("TODO: %s"%self.message)) - self.dither() + self.wait() diff --git a/topics/matrix.py b/topics/matrix.py index a4522e96..4ddbf1c3 100644 --- a/topics/matrix.py +++ b/topics/matrix.py @@ -192,7 +192,7 @@ class NumericalMatrixMultiplication(Scene): self.play(ShowCreation(h_lines)) self.play(ShowCreation(v_lines)) - self.dither() + self.wait() self.show_frame() def organize_matrices(self, left, right, result): @@ -255,7 +255,7 @@ class NumericalMatrixMultiplication(Scene): l_matrix[a][c].highlight(WHITE) r_matrix[c][b].highlight(WHITE) self.play(FadeOut(circles), *lagging_anims) - self.dither() + self.wait() diff --git a/topics/vector_space_scene.py b/topics/vector_space_scene.py index f31cfd5a..0e5f6f03 100644 --- a/topics/vector_space_scene.py +++ b/topics/vector_space_scene.py @@ -142,7 +142,7 @@ class VectorScene(Scene): x_coord, y_coord = array.get_mob_matrix().flatten() self.play(Write(array, run_time = 1)) - self.dither() + self.wait() self.play(ApplyFunction( lambda x : self.position_x_coordinate(x, x_line, vector), x_coord @@ -158,7 +158,7 @@ class VectorScene(Scene): y_coord, brackets = self.get_mobjects_from_last_animation() self.play(ShowCreation(y_line)) self.play(ShowCreation(arrow)) - self.dither() + self.wait() if clean_up: self.clear() self.add(*starting_mobjects) @@ -198,13 +198,13 @@ class VectorScene(Scene): Write(y_coord_start), run_time = 1 ) - self.dither() + self.wait() self.play( Transform(x_coord_start, x_coord, submobject_mode = "all_at_once"), Transform(y_coord_start, y_coord, submobject_mode = "all_at_once"), Write(brackets, run_time = 1), ) - self.dither() + self.wait() self.remove(x_coord_start, y_coord_start, brackets) self.add(array)