def compute_distance_on_each_interval(self):
    rect_list = self.get_riemann_rectangles_list(self.v_graph, self.num_riemann_approximations, max_dx=1, x_min=0, x_max=8)
    for rects in rect_list:
        rects.set_fill(opacity=self.riemann_rect_fill_opacity)
    flat_rects = self.get_riemann_rectangles(self.get_graph((lambda t: 0)), x_min=0, x_max=8, dx=1)
    rects = rect_list[0]
    rect = rects[1]
    flat_rects.submobjects[1] = rect.copy()
    right_brace = Brace(rect, RIGHT)
    top_brace = Brace(rect, UP)
    right_brace.label = right_brace.get_text('$7\\frac{\\text{m}}{\\text{s}}$')
    top_brace.label = top_brace.get_text('$1$s')
    self.play(FadeIn(rect))
    for brace in (right_brace, top_brace):
        self.play(GrowFromCenter(brace), Write(brace.label, run_time=1))
        brace.add(brace.label)
        self.wait()
    self.play(ReplacementTransform(flat_rects, rects, run_time=2, lag_ratio=0.5), Animation(right_brace))
    self.play(*list(map(FadeOut, [top_brace, right_brace])))
    self.wait()
    self.rects = rects
    self.rect_list = rect_list
def compute_distance_on_each_interval(self):
    rect_list = self.get_riemann_rectangles_list(self.v_graph, self.num_riemann_approximations, max_dx=1, x_min=0, x_max=8)
    for rects in rect_list:
        rects.set_fill(opacity=self.riemann_rect_fill_opacity)
    flat_rects = self.get_riemann_rectangles(self.get_graph((lambda t: 0)), x_min=0, x_max=8, dx=1)
    rects = rect_list[0]
    rect = rects[1]
    flat_rects.submobjects[1] = rect.copy()
    right_brace = Brace(rect, RIGHT)
    top_brace = Brace(rect, UP)
    right_brace.label = right_brace.get_text('$7\\frac{\\text{m}}{\\text{s}}$')
    top_brace.label = top_brace.get_text('$1$s')
    self.play(FadeIn(rect))
    for brace in (right_brace, top_brace):
        self.play(GrowFromCenter(brace), Write(brace.label, run_time=1))
        brace.add(brace.label)
        self.wait()
    self.play(ReplacementTransform(flat_rects, rects, run_time=2, lag_ratio=0.5), Animation(right_brace))
    self.play(*list(map(FadeOut, [top_brace, right_brace])))
    self.wait()
    self.rects = rects
    self.rect_list = rect_list