3b1b-manim/active_projects/eop/chapter1/what_does_probability_mean.py

44 lines
1.4 KiB
Python
Raw Normal View History

2019-05-02 20:36:14 -07:00
from manimlib.imports import *
2018-05-10 17:09:53 +02:00
2018-05-30 22:54:50 -07:00
class WhatDoesItReallyMean(TeacherStudentsScene):
2018-05-10 17:09:53 +02:00
CONFIG = {
"default_pi_creature_kwargs": {
"color": MAROON_E,
"flip_at_start": True,
},
}
def construct(self):
2018-05-30 22:54:50 -07:00
student_q = TextMobject(
"What does", "``probability''\\\\",
"\\emph{actually}", "mean?"
)
2018-05-10 17:09:53 +02:00
student_q.set_color_by_tex("probability", YELLOW)
2018-05-30 22:54:50 -07:00
self.student_says(student_q, target_mode="sassy")
2018-05-10 17:09:53 +02:00
self.wait()
self.play(
2018-05-30 22:54:50 -07:00
self.students[1].change_mode, "confused"
2018-05-10 17:09:53 +02:00
)
2018-05-30 22:54:50 -07:00
self.wait(2)
student_bubble = self.students[1].bubble
self.students[1].bubble = None
student_bubble.add(student_bubble.content)
self.play(
student_bubble.scale, 0.5,
student_bubble.to_corner, UL,
)
self.teacher_says(
"Don't worry -- philosophy\\\\ can come later!",
added_anims=[self.get_student_changes(*3 * ["happy"])],
)
self.wait(2)
self.play(RemovePiCreatureBubble(self.teacher))
2018-05-10 17:09:53 +02:00
self.play(*[
2018-05-30 22:54:50 -07:00
ApplyMethod(pi.look_at, ORIGIN) for pi in self.get_pi_creatures()
2018-05-10 17:09:53 +02:00
])
2018-05-30 22:54:50 -07:00
self.change_all_student_modes("pondering", look_at_arg=UP)
self.wait(3)
self.change_student_modes("confused", look_at_arg=UP)
self.wait(3)