Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. from manimlib.imports import *
  2.  
  3. class Convergence(GraphScene):
  4. CONFIG = {
  5. "x_axis_label": "$n$",
  6. "y_axis_label": "$a_n$",
  7. "x_min" : 0,
  8. "x_max" : 10.3,
  9. "y_min" : 0,
  10. "y_max" : 1.1,
  11. "graph_origin" : 5*LEFT +3*DOWN ,
  12. "function_color" : BLUE ,
  13. "tangent_color": YELLOW,
  14. "axes_color" : GREEN,
  15. "x_labeled_nums" : range(0,11,1),
  16. "center_point" : 0,
  17. "include_solution" : True
  18. }
  19. def construct(self):
  20. self.setup_axes(animate=False)
  21. wee_dot = Dot(color = YELLOW).next_to(self.coords_to_point(0,1),RIGHT*0)
  22. self.play(ShowCreation(wee_dot),run_time = 0.3)
  23. for n in range(1,11):
  24. point = Dot(color =WHITE)
  25. point.next_to(self.coords_to_point(n,1/2**n),RIGHT*0)
  26. self.play(ShowCreation(point),run_time = 0.5)
  27. self.play(ApplyMethod(wee_dot.move_to,self.coords_to_point(0,1/2**n)),run_time = 0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement