mirror of
https://github.com/3b1b/manim.git
synced 2025-08-01 08:54:38 +08:00
Final touches to eoc5 before publishing to Patrons
This commit is contained in:
@ -612,22 +612,20 @@ class RelatedRatesExample(ThreeDScene):
|
|||||||
"wall_center" : 1.5*LEFT+0.5*UP,
|
"wall_center" : 1.5*LEFT+0.5*UP,
|
||||||
}
|
}
|
||||||
def construct(self):
|
def construct(self):
|
||||||
self.skip_animations = True
|
|
||||||
self.introduce_ladder()
|
self.introduce_ladder()
|
||||||
self.write_related_rates()
|
self.write_related_rates()
|
||||||
self.measure_ladder()
|
self.measure_ladder()
|
||||||
self.slide_ladder()
|
self.slide_ladder()
|
||||||
self.skip_animations = False
|
|
||||||
self.ponder_question()
|
self.ponder_question()
|
||||||
# self.write_equation()
|
self.write_equation()
|
||||||
# self.isolate_x_of_t()
|
self.isolate_x_of_t()
|
||||||
# self.discuss_lhs_as_function()
|
self.discuss_lhs_as_function()
|
||||||
# self.let_dt_pass()
|
self.let_dt_pass()
|
||||||
# self.take_derivative_of_rhs()
|
self.take_derivative_of_rhs()
|
||||||
# self.take_derivative_of_lhs()
|
self.take_derivative_of_lhs()
|
||||||
# self.bring_back_velocity_arrows()
|
self.bring_back_velocity_arrows()
|
||||||
# self.replace_terms_in_final_form()
|
self.replace_terms_in_final_form()
|
||||||
# self.write_final_solution()
|
self.write_final_solution()
|
||||||
|
|
||||||
def introduce_ladder(self):
|
def introduce_ladder(self):
|
||||||
ladder = Ladder(height = self.get_ladder_length())
|
ladder = Ladder(height = self.get_ladder_length())
|
||||||
@ -767,7 +765,6 @@ class RelatedRatesExample(ThreeDScene):
|
|||||||
randy, randy.bubble, randy.bubble.content
|
randy, randy.bubble, randy.bubble.content
|
||||||
]))
|
]))
|
||||||
|
|
||||||
|
|
||||||
def write_equation(self):
|
def write_equation(self):
|
||||||
self.x_and_y_labels = self.get_x_and_y_labels()
|
self.x_and_y_labels = self.get_x_and_y_labels()
|
||||||
x_label, y_label = self.x_and_y_labels
|
x_label, y_label = self.x_and_y_labels
|
||||||
@ -1090,7 +1087,7 @@ class RelatedRatesExample(ThreeDScene):
|
|||||||
|
|
||||||
new_lhs_derivative = TexMobject(
|
new_lhs_derivative = TexMobject(
|
||||||
"2", "(%d)"%int(self.start_x), "\\frac{dx}{dt}", "+",
|
"2", "(%d)"%int(self.start_x), "\\frac{dx}{dt}", "+",
|
||||||
"2", "(%d)"%int(self.start_y), "(1)",
|
"2", "(%d)"%int(self.start_y), "(-1)",
|
||||||
"= 0"
|
"= 0"
|
||||||
)
|
)
|
||||||
new_lhs_derivative[1].highlight(GREEN)
|
new_lhs_derivative[1].highlight(GREEN)
|
||||||
@ -1123,7 +1120,7 @@ class RelatedRatesExample(ThreeDScene):
|
|||||||
|
|
||||||
def write_final_solution(self):
|
def write_final_solution(self):
|
||||||
solution = TexMobject(
|
solution = TexMobject(
|
||||||
"\\frac{dx}{dt} = \\frac{-4}{3}"
|
"\\frac{dx}{dt} = \\frac{4}{3}"
|
||||||
)
|
)
|
||||||
for i in 0, 1, -1:
|
for i in 0, 1, -1:
|
||||||
solution[i].highlight(GREEN)
|
solution[i].highlight(GREEN)
|
||||||
@ -1136,7 +1133,7 @@ class RelatedRatesExample(ThreeDScene):
|
|||||||
|
|
||||||
box = Rectangle(color = YELLOW)
|
box = Rectangle(color = YELLOW)
|
||||||
box.replace(solution)
|
box.replace(solution)
|
||||||
box.scale_in_place(1.3)
|
box.scale_in_place(1.5)
|
||||||
|
|
||||||
self.play(Write(solution))
|
self.play(Write(solution))
|
||||||
self.dither()
|
self.dither()
|
||||||
@ -1844,6 +1841,7 @@ class TryOtherExamples(TeacherStudentsScene):
|
|||||||
aligned_edge = RIGHT
|
aligned_edge = RIGHT
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
self.teacher_says(
|
self.teacher_says(
|
||||||
"""Nothing special
|
"""Nothing special
|
||||||
about $x^2 + y^2 = 25$"""
|
about $x^2 + y^2 = 25$"""
|
||||||
@ -2264,6 +2262,9 @@ class DerivativeOfNaturalLog(ZoomedScene):
|
|||||||
"example_color" : MAROON_B,
|
"example_color" : MAROON_B,
|
||||||
}
|
}
|
||||||
def construct(self):
|
def construct(self):
|
||||||
|
should_skip_animations = self.skip_animations
|
||||||
|
self.skip_animations = True
|
||||||
|
|
||||||
self.add_plane()
|
self.add_plane()
|
||||||
self.draw_graph()
|
self.draw_graph()
|
||||||
self.describe_as_implicit_curve()
|
self.describe_as_implicit_curve()
|
||||||
@ -2273,6 +2274,7 @@ class DerivativeOfNaturalLog(ZoomedScene):
|
|||||||
self.show_tiny_nudge()
|
self.show_tiny_nudge()
|
||||||
self.note_derivatives()
|
self.note_derivatives()
|
||||||
self.solve_for_dy_dx()
|
self.solve_for_dy_dx()
|
||||||
|
self.skip_animations = should_skip_animations
|
||||||
self.show_slope_above_x()
|
self.show_slope_above_x()
|
||||||
|
|
||||||
def add_plane(self):
|
def add_plane(self):
|
||||||
@ -2556,6 +2558,13 @@ class DerivativeOfNaturalLog(ZoomedScene):
|
|||||||
line = self.tangent_line
|
line = self.tangent_line
|
||||||
start_x = line.get_center()[0]
|
start_x = line.get_center()[0]
|
||||||
target_x = 0.2
|
target_x = 0.2
|
||||||
|
graph = FunctionGraph(
|
||||||
|
lambda x : 1./x,
|
||||||
|
x_min = 0.1,
|
||||||
|
x_max = SPACE_WIDTH,
|
||||||
|
num_steps = 100,
|
||||||
|
color = PINK,
|
||||||
|
)
|
||||||
|
|
||||||
def update_line(line, alpha):
|
def update_line(line, alpha):
|
||||||
x = interpolate(start_x, target_x, alpha)
|
x = interpolate(start_x, target_x, alpha)
|
||||||
@ -2570,6 +2579,15 @@ class DerivativeOfNaturalLog(ZoomedScene):
|
|||||||
run_time = 6
|
run_time = 6
|
||||||
))
|
))
|
||||||
self.dither()
|
self.dither()
|
||||||
|
self.play(ShowCreation(graph, run_time = 3))
|
||||||
|
self.dither()
|
||||||
|
self.play(UpdateFromAlphaFunc(
|
||||||
|
line, update_line,
|
||||||
|
rate_func = there_and_back,
|
||||||
|
run_time = 6
|
||||||
|
))
|
||||||
|
self.dither()
|
||||||
|
|
||||||
|
|
||||||
class FinalWords(TeacherStudentsScene):
|
class FinalWords(TeacherStudentsScene):
|
||||||
def construct(self):
|
def construct(self):
|
||||||
|
Reference in New Issue
Block a user