def construct(self): one_solution = TextMobject(["One ", "solution"]) two_insights = TextMobject(["Two ", " insights"]) two, insights = two_insights.split() johann = ImageMobject("Johann_Bernoulli2", invert=False) mark = ImageMobject("Mark_Levi", invert=False) for mob in johann, mark: mob.scale(0.4) johann.next_to(insights, LEFT) mark.next_to(johann, RIGHT) name = TextMobject("Mark Levi").to_edge(UP) self.play(*map(ShimmerIn, one_solution.split())) self.dither() for pair in zip(one_solution.split(), two_insights.split()): self.play(Transform(*pair, path_func=path_along_arc(np.pi))) self.dither() self.clear() self.add(two, insights) for word, man in [(two, johann), (insights, mark)]: self.play(Transform(word, Point(word.get_left())), GrowFromCenter(man)) self.dither() self.clear() self.play(ApplyMethod(mark.center)) self.play(ShimmerIn(name)) self.dither()
def construct(self): one_solution = TextMobject(["One ", "solution"]) two_insights = TextMobject(["Two ", " insights"]) two, insights = two_insights.split() johann = ImageMobject("Johann_Bernoulli2", invert = False) mark = ImageMobject("Mark_Levi", invert = False) for mob in johann, mark: mob.scale(0.4) johann.next_to(insights, LEFT) mark.next_to(johann, RIGHT) name = TextMobject("Mark Levi").to_edge(UP) self.play(*map(ShimmerIn, one_solution.split())) self.dither() for pair in zip(one_solution.split(), two_insights.split()): self.play(Transform(*pair, path_func = path_along_arc(np.pi))) self.dither() self.clear() self.add(two, insights) for word, man in [(two, johann), (insights, mark)]: self.play( Transform(word, Point(word.get_left())), GrowFromCenter(man) ) self.dither() self.clear() self.play(ApplyMethod(mark.center)) self.play(ShimmerIn(name)) self.dither()
def construct(self): names = [ "Johann_Bernoulli2", "Jacob_Bernoulli", "Gottfried_Wilhelm_von_Leibniz", "Newton" ] guys = [ImageMobject(name, invert=False) for name in names] johann = guys[0] johann.scale(0.8) pensive_johann = johann.copy() pensive_johann.scale(0.25) pensive_johann.to_corner(DOWN + LEFT) comparitive_johann = johann.copy() template = Square(side_length=2) comparitive_johann.replace(template) comparitive_johann.shift(UP + LEFT) greater_than = TexMobject(">") greater_than.next_to(comparitive_johann) for guy, name in zip(guys, names)[1:]: guy.replace(template) guy.next_to(greater_than) name_mob = TextMobject(name.replace("_", " ")) name_mob.scale(0.5) name_mob.next_to(guy, DOWN) guy.name_mob = name_mob guy.sort_points(lambda p: np.dot(p, DOWN + RIGHT)) bubble = ThoughtBubble(initial_width=12) bubble.stretch_to_fit_height(6) bubble.ingest_submobjects() bubble.pin_to(pensive_johann) bubble.shift(DOWN) point = Point(johann.get_corner(UP + RIGHT)) upper_point = Point(comparitive_johann.get_corner(UP + RIGHT)) lightbulb = ImageMobject("Lightbulb", invert=False) lightbulb.scale(0.1) lightbulb.sort_points(np.linalg.norm) lightbulb.next_to(upper_point, RIGHT) self.add(johann) self.wait() self.play(Transform(johann, pensive_johann), Transform(point, bubble), run_time=2) self.remove(point) self.add(bubble) weakling = guys[1] self.play(FadeIn(comparitive_johann), ShowCreation(greater_than), FadeIn(weakling)) self.wait(2) for guy in guys[2:]: self.play(DelayByOrder(Transform(weakling, upper_point))) self.play(FadeIn(guy), ShimmerIn(guy.name_mob)) self.wait(3) self.remove(guy.name_mob) weakling = guy self.play(FadeOut(weakling), FadeOut(greater_than)) self.play(ShowCreation(lightbulb)) self.wait() self.play(FadeOut(comparitive_johann), FadeOut(lightbulb)) self.play(ApplyMethod(Mobject(johann, bubble).scale, 10, run_time=3))
def construct(self): morty = Mortimer(mode = "happy") keith = Keith(mode = "dance_kick") keith_image = ImageMobject("keith_schwarz", invert = False) # keith_image = Rectangle() keith_image.scale_to_fit_height(2*SPACE_HEIGHT - 2) keith_image.next_to(ORIGIN, LEFT) keith.move_to(keith_image, DOWN+RIGHT) morty.next_to(keith, buff = LARGE_BUFF, aligned_edge = DOWN) morty.make_eye_contact(keith) bubble = keith.get_bubble("speech") bubble.write("Check this out...") bubble.resize_to_content() bubble.pin_to(keith) VGroup(bubble, bubble.content).shift(DOWN) title = TextMobject("Keith Schwarz (Computer scientist)") title.to_edge(UP) self.add(keith_image, morty) self.play(Write(title)) self.play(FadeIn(keith, run_time = 2)) self.play(FadeOut(keith_image), Animation(keith)) self.play(Blink(morty)) self.play( keith.change_mode, "speaking", keith.scale_to_fit_height, morty.get_height(), keith.next_to, morty, LEFT, LARGE_BUFF, run_time = 1.5 ) self.play( ShowCreation(bubble), Write(bubble.content) ) self.play( morty.change_mode, "pondering", morty.look_at, bubble ) self.play(Blink(keith)) self.dither()
def construct(self): names = [ "Johann_Bernoulli2", "Jacob_Bernoulli", "Gottfried_Wilhelm_von_Leibniz", "Newton" ] guys = [ ImageMobject(name, invert = False) for name in names ] johann = guys[0] johann.scale(0.8) pensive_johann = johann.copy() pensive_johann.scale(0.25) pensive_johann.to_corner(DOWN+LEFT) comparitive_johann = johann.copy() template = Square(side_length = 2) comparitive_johann.replace(template) comparitive_johann.shift(UP+LEFT) greater_than = TexMobject(">") greater_than.next_to(comparitive_johann) for guy, name in zip(guys, names)[1:]: guy.replace(template) guy.next_to(greater_than) name_mob = TextMobject(name.replace("_", " ")) name_mob.scale(0.5) name_mob.next_to(guy, DOWN) guy.name_mob = name_mob guy.sort_points(lambda p : np.dot(p, DOWN+RIGHT)) bubble = ThoughtBubble(initial_width = 12) bubble.stretch_to_fit_height(6) bubble.ingest_submobjects() bubble.pin_to(pensive_johann) bubble.shift(DOWN) point = Point(johann.get_corner(UP+RIGHT)) upper_point = Point(comparitive_johann.get_corner(UP+RIGHT)) lightbulb = ImageMobject("Lightbulb", invert = False) lightbulb.scale(0.1) lightbulb.sort_points(np.linalg.norm) lightbulb.next_to(upper_point, RIGHT) self.add(johann) self.dither() self.play( Transform(johann, pensive_johann), Transform(point, bubble), run_time = 2 ) self.remove(point) self.add(bubble) weakling = guys[1] self.play( FadeIn(comparitive_johann), ShowCreation(greater_than), FadeIn(weakling) ) self.dither(2) for guy in guys[2:]: self.play(DelayByOrder(Transform( weakling, upper_point ))) self.play( FadeIn(guy), ShimmerIn(guy.name_mob) ) self.dither(3) self.remove(guy.name_mob) weakling = guy self.play(FadeOut(weakling), FadeOut(greater_than)) self.play(ShowCreation(lightbulb)) self.dither() self.play(FadeOut(comparitive_johann), FadeOut(lightbulb)) self.play(ApplyMethod( Mobject(johann, bubble).scale, 10, run_time = 3 ))
def construct(self): self.add_title() title = self.title basel_screen = ScreenRectangle(height=2.35) basel_screen.next_to(title, DOWN) watch_basel = TextMobject( "One such actual piece of math", "(quite pretty!)", ) watch_basel[0].highlight(YELLOW) watch_basel.next_to(basel_screen, DOWN, submobject_to_align=watch_basel[0]) self.add(watch_basel) # self.add(basel_screen) line = DashedLine(SPACE_WIDTH * LEFT, SPACE_WIDTH * RIGHT) line.next_to(watch_basel, DOWN) self.add(line) plushie_square = Square(side_length=2) plushie_square.to_corner(DOWN + LEFT, buff=MED_LARGE_BUFF) plushie_square.shift(UP) plushie_words = TextMobject( "Plushie pi \\\\ creatures \\\\ now available.", alignment="") plushie_words.next_to(plushie_square, RIGHT) self.add(plushie_words) # self.add(plushie_square) instagram_line = TextMobject("randy\\_the\\_pi") instagram_logo = ImageMobject("instagram_logo") instagram_logo.match_height(instagram_line) instagram_logo.next_to(instagram_line, LEFT, SMALL_BUFF) instagram = Group(instagram_logo, instagram_line) instagram.next_to(line, DOWN) instagram.shift(SPACE_WIDTH * RIGHT / 2) self.add(instagram) pictures = Group(*[ ImageMobject("randy/randy_%s" % name) for name in [ "science", "cooking", "in_a_can", "sandwhich", "lab", "fractal", "flowers", "group", "labcoat", "tennis", ] ]) for i, picture in enumerate(pictures): picture.scale_to_fit_height(2) picture.next_to(instagram, DOWN, aligned_edge=RIGHT) if i % 3 != 0: picture.next_to(last_picture, LEFT, buff=0) self.play(FadeIn(picture, run_time=2)) last_picture = picture