def show_rectangle_approximation(self):
    formula1 = TexMobject('ds', '=', 'v(T)', 'dT')
    formula2 = TexMobject('{ds', '\\over\\,', 'dT}', '=', 'v(T)')
    for formula in (formula1, formula2):
        formula.next_to(self.v_graph_label, UP, LARGE_BUFF)
        formula.set_color_by_tex('ds', DISTANCE_COLOR)
    self.play(DrawBorderThenFill(self.rect), Animation(self.ds_arrow))
    self.wait()
    self.play(*[ReplacementTransform(mob, formula1.get_part_by_tex(tex), run_time=2) for (mob, tex) in [(self.ds_label, 'ds'), (self.ds_arrow, '='), (self.v_T_label_group[0].copy(), 'v(T)'), (self.dT_label_group[0].copy(), 'dT')]])
    self.wait()
    self.transition_to_alt_config(dT=(self.dT / 5.0), transformation_kwargs={'run_time': 2})
    self.wait()
    self.play(*([ReplacementTransform(formula1.get_part_by_tex(tex), formula2.get_part_by_tex(tex)) for tex in ('ds', '=', 'v(T)', 'dT')] + [Write(formula2.get_part_by_tex('over'))]))
    self.wait()
def show_rectangle_approximation(self):
    formula1 = TexMobject('ds', '=', 'v(T)', 'dT')
    formula2 = TexMobject('{ds', '\\over\\,', 'dT}', '=', 'v(T)')
    for formula in (formula1, formula2):
        formula.next_to(self.v_graph_label, UP, LARGE_BUFF)
        formula.set_color_by_tex('ds', DISTANCE_COLOR)
    self.play(DrawBorderThenFill(self.rect), Animation(self.ds_arrow))
    self.wait()
    self.play(*[ReplacementTransform(mob, formula1.get_part_by_tex(tex), run_time=2) for (mob, tex) in [(self.ds_label, 'ds'), (self.ds_arrow, '='), (self.v_T_label_group[0].copy(), 'v(T)'), (self.dT_label_group[0].copy(), 'dT')]])
    self.wait()
    self.transition_to_alt_config(dT=(self.dT / 5.0), transformation_kwargs={'run_time': 2})
    self.wait()
    self.play(*([ReplacementTransform(formula1.get_part_by_tex(tex), formula2.get_part_by_tex(tex)) for tex in ('ds', '=', 'v(T)', 'dT')] + [Write(formula2.get_part_by_tex('over'))]))
    self.wait()