From d7b4936ed2f2db65d117f9aacd32f9d946063119 Mon Sep 17 00:00:00 2001 From: stayaryan Date: Mon, 20 Jul 2020 13:55:43 +0530 Subject: Update RiemannRectanglesAnimation.py --- .../riemannintegrals/RiemannRectanglesAnimation.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/RiemannRectanglesAnimation.py b/FSF-2020/calculus/intro-to-calculus/riemannintegrals/RiemannRectanglesAnimation.py index a278c9d..1757231 100644 --- a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/RiemannRectanglesAnimation.py +++ b/FSF-2020/calculus/intro-to-calculus/riemannintegrals/RiemannRectanglesAnimation.py @@ -24,7 +24,7 @@ class RiemannRectanglesAnimation(GraphScene): "input_sample_type": "right", } flat_rectangles1 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE),**kwargs) - riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph1,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs) + riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph1,6,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs) self.add(graph1) self.graph_origin = ORIGIN+2*DOWN+1*RIGHT self.setup_axes() @@ -37,7 +37,7 @@ class RiemannRectanglesAnimation(GraphScene): "input_sample_type": "left", } flat_rectangles2 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE),**kwargs) - riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph2,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs) + riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph2,6,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs) self.add(graph2) text1 = TextMobject("Left Riemann sum").move_to(np.array([-3,-2.5,0])) text2 = TextMobject("Right Riemann sum").move_to(np.array([4,-2.5,0])) @@ -50,15 +50,17 @@ class RiemannRectanglesAnimation(GraphScene): self.play(ReplacementTransform(flat_rectangles1,riemann_rectangles_list1[0]), ReplacementTransform(flat_rectangles2, riemann_rectangles_list2[0])) self.wait() self.play(ShowCreation(grp1)) - for r in range(1,len(riemann_rectangles_list1)-5): + for r in range(1,len(riemann_rectangles_list1)-3): self.transform_between_riemann_rects(riemann_rectangles_list1[r-1],riemann_rectangles_list1[r],replace_mobject_with_target_in_scene = True,) self.transform_between_riemann_rects(riemann_rectangles_list2[r-1],riemann_rectangles_list2[r],replace_mobject_with_target_in_scene = True,) self.play(ShowCreation(text3)) - for r in range(len(riemann_rectangles_list1)-5,len(riemann_rectangles_list1)): + for r in range(len(riemann_rectangles_list1)-3,len(riemann_rectangles_list1)): self.transform_between_riemann_rects(riemann_rectangles_list1[r-1],riemann_rectangles_list1[r],replace_mobject_with_target_in_scene = True,) self.transform_between_riemann_rects(riemann_rectangles_list2[r-1],riemann_rectangles_list2[r],replace_mobject_with_target_in_scene = True,) self.wait(2) + grp3 = VGroup(graph1, riemann_rectangles_list1[5]) + grp4 = VGroup(graph2, riemann_rectangles_list2[5]) self.play(ReplacementTransform(grp2, text4)) self.wait(2) - self.play(ReplacementTransform(text4, text5)) - self.wait(4) + self.play(ReplacementTransform(text4, text5), ApplyMethod(grp4.shift, 7*LEFT), ApplyMethod(self.axes.shift, 7*LEFT), ) + self.wait(4) \ No newline at end of file -- cgit From f368dbdb0698d51ef9bc20d16a2aded4f2f45dbe Mon Sep 17 00:00:00 2001 From: stayaryan Date: Mon, 20 Jul 2020 16:18:58 +0530 Subject: Gabriel's horn --- .../intro-to-calculus/gabrielshorn/gabriel1.py | 67 ++++++++++++++++++++++ .../intro-to-calculus/gabrielshorn/gabriel2.py | 43 ++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel1.py create mode 100644 FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel2.py diff --git a/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel1.py b/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel1.py new file mode 100644 index 0000000..3596c88 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel1.py @@ -0,0 +1,67 @@ +from manimlib.imports import * +class sphere(GraphScene, ThreeDScene): + CONFIG = { + 'x_min': 0, + 'x_max': 10, + 'y_min': -3, + 'y_max': 3, + 'graph_origin': ORIGIN, + "x_axis_width": 10, + "y_axis_height": 10, + "default_graph_style": { + "stroke_width": 2, + "stroke_color": WHITE, + } + } + def construct(self): + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + text1 = TexMobject(r"y=\frac { 1 }{ x }").move_to(np.array([3,2,0])) + text1a = TexMobject(r"y=\frac { 1 }{ x }, x \ge 1").move_to(np.array([3,2,0])) + text2 = TexMobject(r"y=\frac { 1 }{ x }", r"\text{ is rotated in 3-dimensions}").to_corner(UL) + text3 = TextMobject("For calculating volume, consider a disc as shown").to_corner(UL) + text4 = TextMobject("Imagine the disc to move along the length of the horn").to_corner(UL) + text5 = TextMobject("In this way complete volume is covered").to_corner(UL) + arrow = Vector(np.array([0, np.sin(60*DEGREES), np.cos(60*DEGREES)])).shift(1*RIGHT) + text6 = TexMobject(r"\text{Area of circle is }", r"\pi {r}^{2}").to_corner(UL) + text7 = TextMobject("The disc moves along the length of hyperbolic curve").to_corner(UL) + + axes = ThreeDAxes(**self.CONFIG) + self.setup_axes() + graph1 = self.get_graph(lambda x : 1/x, x_min = 1, x_max = 10) + graph2 = self.get_graph(lambda x : 1/x, x_min = 0.1, x_max = 10) + self.play(FadeIn(self.axes)) + self.play(ShowCreation(graph2), FadeIn(text1)) + self.wait(3) + self.play(Transform(graph2, graph1), ReplacementTransform(text1, text1a)) + axes = ThreeDAxes(**self.CONFIG) + self.move_camera(phi = 90*DEGREES, theta=0*DEGREES,distance = 200, run_time=5) + horn2 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 0.1) + self.play(Transform(graph2, horn2), FadeOut(text1), FadeOut(graph2), ShowCreation(text2), FadeOut(text1a)) + self.wait(2) + self.play(FadeOut(text2)) + self.add_fixed_in_frame_mobjects(text3) + self.wait(1) + disc = ParametricSurface(lambda u, v : np.array([0, 1*v*np.sin(TAU*u), 1*v*np.cos(TAU*u)]), fill_opacity = 1, fill_color = PINK).shift(1*RIGHT) + self.play(ShowCreation(disc), ShowCreation(arrow)) + self.play(FadeOut(text3)) + self.add_fixed_in_frame_mobjects(text6) + self.wait(3) + self.play(FadeOut(text6)) + self.add_fixed_in_frame_mobjects(text7) + self.wait(2) + self.move_camera(phi = 60*DEGREES, theta= -45*DEGREES, distance = 200, run_time=5) + #self.play(FadeOut(text6)) + #self.add_fixed_in_frame_mobjects(text7) + k=0 + while k<9: + disc1 = ParametricSurface(lambda u, v : np.array([0, (1/(1+k))*v*np.sin(TAU*u), (1/(1+k))*v*np.cos(TAU*u)]), fill_opacity = 0.5, fill_color = PINK).shift((1+k)*RIGHT) + self.play(FadeIn(disc1), run_time = 0.1) + k = k+0.1 + self.play(FadeOut(text7)) + self.add_fixed_in_frame_mobjects(text5) + self.wait(2) + self.begin_ambient_camera_rotation(rate = 0.4) + self.wait(10) + self.stop_ambient_camera_rotation() \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel2.py b/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel2.py new file mode 100644 index 0000000..1e2a820 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel2.py @@ -0,0 +1,43 @@ +from manimlib.imports import * +class surface(GraphScene, ThreeDScene): + CONFIG = { + 'x_min': 0, + 'x_max': 10, + 'y_min': -3, + 'y_max': 3, + 'graph_origin': ORIGIN, + "x_axis_width": 10, + "y_axis_height": 10, + "default_graph_style": { + "stroke_width": 2, + "stroke_color": RED, + } + } + def construct(self): + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + self.setup_axes() + text1 = TexMobject(r"y=\frac { 1 }{ x }").move_to(np.array([3,2,0])) + text2 = TexMobject(r"\int _{ 1 }^{ \infty }{ \frac { 1 }{ x } dx }", r"\text{ diverges}").to_corner(UL) + text3 = TexMobject(r"\text{Hence }", r"\int _{ 1 }^{ \infty }{ \frac { 1 }{ x } dx=\infty }").to_corner(UL) + text4 = TextMobject("Which means surface area is infinity").to_corner(UL) + graph1 = self.get_graph(lambda x : 1/x, x_min = 1, x_max = 10) + self.play(FadeIn(self.axes)) + self.play(ShowCreation(graph1), FadeIn(text1)) + self.wait(5) + axes = ThreeDAxes(**self.CONFIG) + self.move_camera(phi = 60*DEGREES, theta=45*DEGREES,distance = 200, run_time=5) + horn2 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 0.1) + horn3 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 1) + self.play(Transform(graph1, horn2)) + self.play(FadeOut(text1)) + self.add_fixed_in_frame_mobjects(text2) + self.wait(3) + self.play(FadeOut(text2)) + self.add_fixed_in_frame_mobjects(text3) + self.wait(3) + self.play(ShowCreation(horn3)) + self.play(FadeOut(text3)) + self.add_fixed_in_frame_mobjects(text4) + self.wait(5) \ No newline at end of file -- cgit From dec03b51ad54f9a869a5db0a0bdad2f5b1d2313a Mon Sep 17 00:00:00 2001 From: stayaryan Date: Mon, 20 Jul 2020 17:38:44 +0530 Subject: pull request --- .../intro-to-calculus/gabriels-horn/gabriel1.py | 67 +++++++++++++++++++ .../intro-to-calculus/gabriels-horn/gabriel2.py | 43 ++++++++++++ .../intro-to-calculus/gabrielshorn/gabriel1.py | 67 ------------------- .../intro-to-calculus/gabrielshorn/gabriel2.py | 43 ------------ .../intro-to-derivative/derivative1.py | 55 +++++++++++++++ .../intro-to-derivative/derivative2.py | 78 ++++++++++++++++++++++ .../intro-to-derivative/derivative3.py | 57 ++++++++++++++++ .../introderivative/derivative1.py | 55 --------------- .../introderivative/derivative2.py | 78 ---------------------- .../introderivative/derivative3.py | 57 ---------------- .../calculus/intro-to-calculus/limit/limitdef.py | 73 -------------------- .../calculus/intro-to-calculus/limit/limitfin1.py | 76 +++++++++++++++++++++ .../calculus/intro-to-calculus/limit/limitfin2.py | 70 +++++++++++++++++++ .../intro-to-calculus/riemann-integrals/README.md | 18 +++++ .../RiemannRectanglesAnimation.py | 66 ++++++++++++++++++ .../intro-to-calculus/riemann-integrals/mimi.py | 53 +++++++++++++++ .../riemann-integrals/rierect1.py | 31 +++++++++ .../riemann-integrals/rierect2.py | 31 +++++++++ .../riemann-integrals/rierect3.py | 31 +++++++++ .../intro-to-calculus/riemannintegrals/README.md | 18 ----- .../riemannintegrals/RiemannRectanglesAnimation.py | 66 ------------------ .../intro-to-calculus/riemannintegrals/mimi.py | 53 --------------- .../intro-to-calculus/riemannintegrals/rierect1.py | 31 --------- .../intro-to-calculus/riemannintegrals/rierect2.py | 31 --------- .../intro-to-calculus/riemannintegrals/rierect3.py | 31 --------- 25 files changed, 676 insertions(+), 603 deletions(-) create mode 100644 FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py create mode 100644 FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel2.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel1.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel2.py create mode 100644 FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative1.py create mode 100644 FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative2.py create mode 100644 FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative3.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/introderivative/derivative1.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/introderivative/derivative2.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/introderivative/derivative3.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/limit/limitdef.py create mode 100644 FSF-2020/calculus/intro-to-calculus/limit/limitfin1.py create mode 100644 FSF-2020/calculus/intro-to-calculus/limit/limitfin2.py create mode 100644 FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md create mode 100644 FSF-2020/calculus/intro-to-calculus/riemann-integrals/RiemannRectanglesAnimation.py create mode 100644 FSF-2020/calculus/intro-to-calculus/riemann-integrals/mimi.py create mode 100644 FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect1.py create mode 100644 FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect2.py create mode 100644 FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect3.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/riemannintegrals/README.md delete mode 100644 FSF-2020/calculus/intro-to-calculus/riemannintegrals/RiemannRectanglesAnimation.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/riemannintegrals/mimi.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect1.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect2.py delete mode 100644 FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect3.py diff --git a/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py new file mode 100644 index 0000000..3596c88 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py @@ -0,0 +1,67 @@ +from manimlib.imports import * +class sphere(GraphScene, ThreeDScene): + CONFIG = { + 'x_min': 0, + 'x_max': 10, + 'y_min': -3, + 'y_max': 3, + 'graph_origin': ORIGIN, + "x_axis_width": 10, + "y_axis_height": 10, + "default_graph_style": { + "stroke_width": 2, + "stroke_color": WHITE, + } + } + def construct(self): + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + text1 = TexMobject(r"y=\frac { 1 }{ x }").move_to(np.array([3,2,0])) + text1a = TexMobject(r"y=\frac { 1 }{ x }, x \ge 1").move_to(np.array([3,2,0])) + text2 = TexMobject(r"y=\frac { 1 }{ x }", r"\text{ is rotated in 3-dimensions}").to_corner(UL) + text3 = TextMobject("For calculating volume, consider a disc as shown").to_corner(UL) + text4 = TextMobject("Imagine the disc to move along the length of the horn").to_corner(UL) + text5 = TextMobject("In this way complete volume is covered").to_corner(UL) + arrow = Vector(np.array([0, np.sin(60*DEGREES), np.cos(60*DEGREES)])).shift(1*RIGHT) + text6 = TexMobject(r"\text{Area of circle is }", r"\pi {r}^{2}").to_corner(UL) + text7 = TextMobject("The disc moves along the length of hyperbolic curve").to_corner(UL) + + axes = ThreeDAxes(**self.CONFIG) + self.setup_axes() + graph1 = self.get_graph(lambda x : 1/x, x_min = 1, x_max = 10) + graph2 = self.get_graph(lambda x : 1/x, x_min = 0.1, x_max = 10) + self.play(FadeIn(self.axes)) + self.play(ShowCreation(graph2), FadeIn(text1)) + self.wait(3) + self.play(Transform(graph2, graph1), ReplacementTransform(text1, text1a)) + axes = ThreeDAxes(**self.CONFIG) + self.move_camera(phi = 90*DEGREES, theta=0*DEGREES,distance = 200, run_time=5) + horn2 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 0.1) + self.play(Transform(graph2, horn2), FadeOut(text1), FadeOut(graph2), ShowCreation(text2), FadeOut(text1a)) + self.wait(2) + self.play(FadeOut(text2)) + self.add_fixed_in_frame_mobjects(text3) + self.wait(1) + disc = ParametricSurface(lambda u, v : np.array([0, 1*v*np.sin(TAU*u), 1*v*np.cos(TAU*u)]), fill_opacity = 1, fill_color = PINK).shift(1*RIGHT) + self.play(ShowCreation(disc), ShowCreation(arrow)) + self.play(FadeOut(text3)) + self.add_fixed_in_frame_mobjects(text6) + self.wait(3) + self.play(FadeOut(text6)) + self.add_fixed_in_frame_mobjects(text7) + self.wait(2) + self.move_camera(phi = 60*DEGREES, theta= -45*DEGREES, distance = 200, run_time=5) + #self.play(FadeOut(text6)) + #self.add_fixed_in_frame_mobjects(text7) + k=0 + while k<9: + disc1 = ParametricSurface(lambda u, v : np.array([0, (1/(1+k))*v*np.sin(TAU*u), (1/(1+k))*v*np.cos(TAU*u)]), fill_opacity = 0.5, fill_color = PINK).shift((1+k)*RIGHT) + self.play(FadeIn(disc1), run_time = 0.1) + k = k+0.1 + self.play(FadeOut(text7)) + self.add_fixed_in_frame_mobjects(text5) + self.wait(2) + self.begin_ambient_camera_rotation(rate = 0.4) + self.wait(10) + self.stop_ambient_camera_rotation() \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel2.py b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel2.py new file mode 100644 index 0000000..1e2a820 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel2.py @@ -0,0 +1,43 @@ +from manimlib.imports import * +class surface(GraphScene, ThreeDScene): + CONFIG = { + 'x_min': 0, + 'x_max': 10, + 'y_min': -3, + 'y_max': 3, + 'graph_origin': ORIGIN, + "x_axis_width": 10, + "y_axis_height": 10, + "default_graph_style": { + "stroke_width": 2, + "stroke_color": RED, + } + } + def construct(self): + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + self.setup_axes() + text1 = TexMobject(r"y=\frac { 1 }{ x }").move_to(np.array([3,2,0])) + text2 = TexMobject(r"\int _{ 1 }^{ \infty }{ \frac { 1 }{ x } dx }", r"\text{ diverges}").to_corner(UL) + text3 = TexMobject(r"\text{Hence }", r"\int _{ 1 }^{ \infty }{ \frac { 1 }{ x } dx=\infty }").to_corner(UL) + text4 = TextMobject("Which means surface area is infinity").to_corner(UL) + graph1 = self.get_graph(lambda x : 1/x, x_min = 1, x_max = 10) + self.play(FadeIn(self.axes)) + self.play(ShowCreation(graph1), FadeIn(text1)) + self.wait(5) + axes = ThreeDAxes(**self.CONFIG) + self.move_camera(phi = 60*DEGREES, theta=45*DEGREES,distance = 200, run_time=5) + horn2 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 0.1) + horn3 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 1) + self.play(Transform(graph1, horn2)) + self.play(FadeOut(text1)) + self.add_fixed_in_frame_mobjects(text2) + self.wait(3) + self.play(FadeOut(text2)) + self.add_fixed_in_frame_mobjects(text3) + self.wait(3) + self.play(ShowCreation(horn3)) + self.play(FadeOut(text3)) + self.add_fixed_in_frame_mobjects(text4) + self.wait(5) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel1.py b/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel1.py deleted file mode 100644 index 3596c88..0000000 --- a/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel1.py +++ /dev/null @@ -1,67 +0,0 @@ -from manimlib.imports import * -class sphere(GraphScene, ThreeDScene): - CONFIG = { - 'x_min': 0, - 'x_max': 10, - 'y_min': -3, - 'y_max': 3, - 'graph_origin': ORIGIN, - "x_axis_width": 10, - "y_axis_height": 10, - "default_graph_style": { - "stroke_width": 2, - "stroke_color": WHITE, - } - } - def construct(self): - XTD = self.x_axis_width/(self.x_max- self.x_min) - YTD = self.y_axis_height/(self.y_max- self.y_min) - - text1 = TexMobject(r"y=\frac { 1 }{ x }").move_to(np.array([3,2,0])) - text1a = TexMobject(r"y=\frac { 1 }{ x }, x \ge 1").move_to(np.array([3,2,0])) - text2 = TexMobject(r"y=\frac { 1 }{ x }", r"\text{ is rotated in 3-dimensions}").to_corner(UL) - text3 = TextMobject("For calculating volume, consider a disc as shown").to_corner(UL) - text4 = TextMobject("Imagine the disc to move along the length of the horn").to_corner(UL) - text5 = TextMobject("In this way complete volume is covered").to_corner(UL) - arrow = Vector(np.array([0, np.sin(60*DEGREES), np.cos(60*DEGREES)])).shift(1*RIGHT) - text6 = TexMobject(r"\text{Area of circle is }", r"\pi {r}^{2}").to_corner(UL) - text7 = TextMobject("The disc moves along the length of hyperbolic curve").to_corner(UL) - - axes = ThreeDAxes(**self.CONFIG) - self.setup_axes() - graph1 = self.get_graph(lambda x : 1/x, x_min = 1, x_max = 10) - graph2 = self.get_graph(lambda x : 1/x, x_min = 0.1, x_max = 10) - self.play(FadeIn(self.axes)) - self.play(ShowCreation(graph2), FadeIn(text1)) - self.wait(3) - self.play(Transform(graph2, graph1), ReplacementTransform(text1, text1a)) - axes = ThreeDAxes(**self.CONFIG) - self.move_camera(phi = 90*DEGREES, theta=0*DEGREES,distance = 200, run_time=5) - horn2 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 0.1) - self.play(Transform(graph2, horn2), FadeOut(text1), FadeOut(graph2), ShowCreation(text2), FadeOut(text1a)) - self.wait(2) - self.play(FadeOut(text2)) - self.add_fixed_in_frame_mobjects(text3) - self.wait(1) - disc = ParametricSurface(lambda u, v : np.array([0, 1*v*np.sin(TAU*u), 1*v*np.cos(TAU*u)]), fill_opacity = 1, fill_color = PINK).shift(1*RIGHT) - self.play(ShowCreation(disc), ShowCreation(arrow)) - self.play(FadeOut(text3)) - self.add_fixed_in_frame_mobjects(text6) - self.wait(3) - self.play(FadeOut(text6)) - self.add_fixed_in_frame_mobjects(text7) - self.wait(2) - self.move_camera(phi = 60*DEGREES, theta= -45*DEGREES, distance = 200, run_time=5) - #self.play(FadeOut(text6)) - #self.add_fixed_in_frame_mobjects(text7) - k=0 - while k<9: - disc1 = ParametricSurface(lambda u, v : np.array([0, (1/(1+k))*v*np.sin(TAU*u), (1/(1+k))*v*np.cos(TAU*u)]), fill_opacity = 0.5, fill_color = PINK).shift((1+k)*RIGHT) - self.play(FadeIn(disc1), run_time = 0.1) - k = k+0.1 - self.play(FadeOut(text7)) - self.add_fixed_in_frame_mobjects(text5) - self.wait(2) - self.begin_ambient_camera_rotation(rate = 0.4) - self.wait(10) - self.stop_ambient_camera_rotation() \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel2.py b/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel2.py deleted file mode 100644 index 1e2a820..0000000 --- a/FSF-2020/calculus/intro-to-calculus/gabrielshorn/gabriel2.py +++ /dev/null @@ -1,43 +0,0 @@ -from manimlib.imports import * -class surface(GraphScene, ThreeDScene): - CONFIG = { - 'x_min': 0, - 'x_max': 10, - 'y_min': -3, - 'y_max': 3, - 'graph_origin': ORIGIN, - "x_axis_width": 10, - "y_axis_height": 10, - "default_graph_style": { - "stroke_width": 2, - "stroke_color": RED, - } - } - def construct(self): - XTD = self.x_axis_width/(self.x_max- self.x_min) - YTD = self.y_axis_height/(self.y_max- self.y_min) - - self.setup_axes() - text1 = TexMobject(r"y=\frac { 1 }{ x }").move_to(np.array([3,2,0])) - text2 = TexMobject(r"\int _{ 1 }^{ \infty }{ \frac { 1 }{ x } dx }", r"\text{ diverges}").to_corner(UL) - text3 = TexMobject(r"\text{Hence }", r"\int _{ 1 }^{ \infty }{ \frac { 1 }{ x } dx=\infty }").to_corner(UL) - text4 = TextMobject("Which means surface area is infinity").to_corner(UL) - graph1 = self.get_graph(lambda x : 1/x, x_min = 1, x_max = 10) - self.play(FadeIn(self.axes)) - self.play(ShowCreation(graph1), FadeIn(text1)) - self.wait(5) - axes = ThreeDAxes(**self.CONFIG) - self.move_camera(phi = 60*DEGREES, theta=45*DEGREES,distance = 200, run_time=5) - horn2 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 0.1) - horn3 = ParametricSurface(lambda u, v : np.array([1*u, (1*np.cos(TAU*v))/u,(1*np.sin(TAU*v))/u]), u_min = 1, v_min = 0.001, u_max = 10, fill_opacity = 1) - self.play(Transform(graph1, horn2)) - self.play(FadeOut(text1)) - self.add_fixed_in_frame_mobjects(text2) - self.wait(3) - self.play(FadeOut(text2)) - self.add_fixed_in_frame_mobjects(text3) - self.wait(3) - self.play(ShowCreation(horn3)) - self.play(FadeOut(text3)) - self.add_fixed_in_frame_mobjects(text4) - self.wait(5) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative1.py b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative1.py new file mode 100644 index 0000000..79a6fc6 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative1.py @@ -0,0 +1,55 @@ +from manimlib.imports import * +class derivative1(GraphScene, Scene): + def setup(self): + GraphScene.setup(self) + CONFIG = { + "y_max" : 4, + "y_min" : -2, + "x_max" : 4, + "x_min" : -2, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color" : WHITE, + "num_graph_anchor_points": 3000, #this is the number of points that graph manim + "graph_origin" : ORIGIN+2*DOWN+4*LEFT, + "x_labeled_nums": list(range(-2,5)), + "y_labeled_nums": list(range(-2,5)), + "x_axis_label":"$x$", + "y_axis_label":r"$f(x)=y= 3-\frac { 3 }{ 2 } x$", + "x_axis_width": 5, + "y_axis_height": 5, + } + def construct(self): + #XTD = self.x_axis_width/(self.x_max - self.x_min) + #YTD = self.y_axis_height/(self.y_max - self.y_min) + + text1 = TextMobject("") + text2 = TexMobject("{y}_{2}-{y}_{1}") + text2 = TexMobject("{x}_{2}-{x}_{1}") + text3 = TexMobject(r"m\quad =\frac { { y }_{ 2 }-{ y }_{ 1 } }{ { x }_{ 2 }-{ x }_{ 1 } }").move_to(np.array([3,0,0])) + text4 = TexMobject(r"m\quad =\frac { 3 }{ -2 }").move_to(np.array([3,0,0])) + text5 = TexMobject(r"m\quad =\quad -1.5").move_to(np.array([3,0,0])) + self.setup_axes() + graph_1 = self.get_graph(lambda x : 3-1.5*x, color = GREEN_SCREEN, x_min = -1, x_max = 3) + graph_2 = self.get_graph(lambda x : 3.1-1.5*x, color = ORANGE, x_min = 0, x_max = 2) + dot1 = Dot() + dot2 = SmallDot(self.graph_origin+1.7*RIGHT, color = PINK) + dot3 = SmallDot(self.graph_origin+2.5*UP, color = RED_B) + vec1 = Vector(2.5*DOWN, color = PINK).shift(self.graph_origin+2.5*UP) + vec2 = Vector(1.7*RIGHT, color = RED_B).shift(self.graph_origin) + brace1 = Brace(vec1, LEFT) + brace2 = Brace(vec2, DOWN) + br1text = brace1.get_text(r"${y}_{2}-{y}_{1}$").next_to(brace1, LEFT) + br2text = brace2.get_text(r"${x}_{2}-{x}_{1}$").next_to(brace2, DOWN) + self.play(ShowCreation(graph_1), ShowCreation(dot2), ShowCreation(dot3)) + self.play(MoveAlongPath(dot1, graph_2), ShowCreation(vec1), ShowCreation(vec2), run_time = 3) + self.wait(1) + self.play(ShowCreation(brace1), ShowCreation(brace2)) + self.play(ShowCreation(br1text), ShowCreation(br2text)) + self.wait(2) + self.play(GrowFromCenter(text3)) + self.wait(2.5) + self.play(ReplacementTransform(text3, text4)) + self.wait(2) + self.play(ReplacementTransform(text4, text5)) + self.wait(2) diff --git a/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative2.py b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative2.py new file mode 100644 index 0000000..d6aab15 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative2.py @@ -0,0 +1,78 @@ +from manimlib.imports import * +class derivative2(GraphScene, MovingCameraScene): + def setup(self): + GraphScene.setup(self) + MovingCameraScene.setup(self) + CONFIG = { + "y_max" : 100, + "y_min" : 0, + "x_max" : 10, + "x_min" : 0, + "y_tick_frequency" : 100, + "x_tick_frequency" : 10, + "axes_color" : WHITE, + "num_graph_anchor_points": 3000, #this is the number of points that graph manim + "graph_origin" : ORIGIN, + "x_labeled_nums": None,#list(range(0,11)), + "y_labeled_nums": None,#list(range(0,101))[::10], + "x_axis_label":"$x$", + "y_axis_label":"$f(x)$", + "x_axis_width": 5, + "y_axis_height": 5, + "start_x" : 2, + "start_dx" : 6, + "df_color" : YELLOW, + "dx_color" : GREEN, + "secant_line_color" : MAROON_B, + "zoomed_camera_frame_starting_position": ORIGIN+2*DOWN+6*LEFT, + } + def construct(self): + self.setup() + self.camera_frame.save_state() + self.graph_origin = ORIGIN+2*DOWN+6*LEFT + self.setup_axes() + graph23 = self.get_graph(lambda x : x**2+7, color = GREEN_SCREEN, x_min = 0, x_max = 10) + graph24 = self.get_graph(lambda x : x**2+7, color = GREEN_SCREEN, x_min = 8, x_max = 2.01) + line_1 = DashedVMobject(Line(np.array([-5,-2,0]), np.array([-5,-1.42,0]))) + textdef = TextMobject("") + text1 = TexMobject("{ x }_{ 0 }").move_to(np.array([-5,-2.2,0])) + text2 = TextMobject("The line becomes tangential to the curve").move_to(self.graph_origin+RIGHT+0.5*UP).scale(0.01) + text3 = TexMobject(r"\frac { df }{ dx } =\frac { f({ x }_{ 0 }+h)-f({ x }_{ 0 }) }{ h-0 }").move_to(2*RIGHT) + text4 = TexMobject(r"\frac { df }{ dx } =\lim _{ h\rightarrow 0 }{ \frac { f({ x }_{ 0 }+h)-f({ x }_{ 0 }) }{ h } }").move_to(2*RIGHT) + squareobj = Square(side_length = 15).move_to(self.graph_origin+RIGHT+0.53*UP) + ss_group = self.get_secant_slope_group( + self.start_x, graph23, + dx = self.start_dx, + dx_label = "h", + df_label = "df", + df_line_color = self.df_color, + dx_line_color = self.dx_color, + secant_line_color = self.secant_line_color, + dot_df_top = True, + dot_dx_start = True, + dot_df_top_label = "Q", + dot_dx_start_label = "P", + secant_line_length = 8 + ) + self.play(ShowCreation(graph23)) + self.wait() + self.play(ShowCreation(ss_group.secant_line)) + self.add(text1) + self.play(ShowCreation(line_1)) + self.wait(3) + self.play(ShowCreation(ss_group.dx_line)) + self.play(ShowCreation(ss_group.dx_label)) + self.play(ShowCreation(ss_group.df_line)) + self.play(Write(ss_group.df_label)) + self.play(ShowCreation(ss_group.dot_df_top), ShowCreation(ss_group.dot_dx_start)) + self.play(ShowCreation(ss_group.dot_df_top_label), ShowCreation(ss_group.dot_dx_start_label)) + self.wait() + self.play(ShowCreation(text3)) + self.wait(2) + self.play(ReplacementTransform(text3, text4)) + self.animate_secant_slope_group_change(ss_group, target_dx = 0.01, run_time = 5) + self.wait(2) + self.play(self.camera_frame.set_width,0.2,self.camera_frame.move_to,squareobj,run_time = 2) + self.wait() + self.play(ShowCreation(text2)) + self.wait(3) diff --git a/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative3.py b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative3.py new file mode 100644 index 0000000..ebbacb1 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/derivative3.py @@ -0,0 +1,57 @@ +from manimlib.imports import * +class derivative3(GraphScene, Scene): + def setup(self): + Scene.setup(self) + #ZoomedScene.setup(self) + CONFIG = { + "y_max" : 8, + "y_min" : 0, + "x_max" : 11, + "x_min" : 0, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color" : WHITE, + "num_graph_anchor_points": 3000, #this is the number of points that graph manim + "graph_origin" : ORIGIN+3*DOWN+6.5*LEFT, + "x_labeled_nums": list(range(0,12))[::1], + "y_labeled_nums": list(range(0,9))[::1], + "x_axis_label":"$t$", + "y_axis_label":"$s$", + "x_axis_width": 5, + "y_axis_height": 5, + } + def construct(self): + XTD = self.x_axis_width/(self.x_max - self.x_min) + YTD = self.y_axis_height/(self.y_max - self.y_min) + + self.setup_axes() + graph_1 = self.get_graph(lambda x : -(x-2)**2+4, color = GOLD_A, x_min = 0, x_max = 1.5) + graph_2 = self.get_graph(lambda x : 1*x+2.25, color = GOLD_A, x_min = 1.5, x_max = 5) + graph_3 = self.get_graph(lambda x : 7.25, color = GOLD_A, x_min = 5, x_max = 8) + graph_4 = self.get_graph(lambda x : -3.625*x + 36.25, color = GOLD_A, x_min = 8, x_max = 10) + + self.y_max = 5 + self.x_max = 10 + self.x_min = 0 + self.y_min = -5 + self.x_labeled_nums = list(range(0,11)) + self.y_labeled_nums = list(range(-5,6))[::1] + self.x_axis_label = r"$t$" + self.y_axis_label = r"$v$" + self.y_tick_frequency = 1 + self.x_tick_frequency = 1 + self.graph_origin = ORIGIN+1*RIGHT + self.setup_axes() + graph_5 = self.get_graph(lambda x : 2*(x-2)+4, color = GREEN_SCREEN, x_min = 0, x_max = 1.5) + graph_6 = self.get_graph(lambda x : 3, color = GREEN_SCREEN, x_min = 1.5, x_max = 5) + graph_7 = self.get_graph(lambda x : 0, color = GREEN_SCREEN, x_min = 5, x_max = 8) + graph_8 = self.get_graph(lambda x : -3.625, color = GREEN_SCREEN, x_min = 8, x_max = 10) + line1 = DashedVMobject(Line(self.graph_origin+2.5*RIGHT, self.graph_origin+2.5*RIGHT+1.5*UP)) + line2 = DashedVMobject(Line(self.graph_origin+4*RIGHT, self.graph_origin+4*RIGHT+1.835*DOWN)) + self.play(ShowCreation(graph_1), ShowCreation(graph_5), run_time = 3) + self.play(ShowCreation(graph_2), ShowCreation(graph_6), run_time = 3) + self.add(line1) + self.play(ShowCreation(graph_3), ShowCreation(graph_7), run_time = 3) + self.add(line2) + self.play(ShowCreation(graph_4), ShowCreation(graph_8), run_time = 3) + self.wait(3) diff --git a/FSF-2020/calculus/intro-to-calculus/introderivative/derivative1.py b/FSF-2020/calculus/intro-to-calculus/introderivative/derivative1.py deleted file mode 100644 index 79a6fc6..0000000 --- a/FSF-2020/calculus/intro-to-calculus/introderivative/derivative1.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import * -class derivative1(GraphScene, Scene): - def setup(self): - GraphScene.setup(self) - CONFIG = { - "y_max" : 4, - "y_min" : -2, - "x_max" : 4, - "x_min" : -2, - "y_tick_frequency" : 1, - "x_tick_frequency" : 1, - "axes_color" : WHITE, - "num_graph_anchor_points": 3000, #this is the number of points that graph manim - "graph_origin" : ORIGIN+2*DOWN+4*LEFT, - "x_labeled_nums": list(range(-2,5)), - "y_labeled_nums": list(range(-2,5)), - "x_axis_label":"$x$", - "y_axis_label":r"$f(x)=y= 3-\frac { 3 }{ 2 } x$", - "x_axis_width": 5, - "y_axis_height": 5, - } - def construct(self): - #XTD = self.x_axis_width/(self.x_max - self.x_min) - #YTD = self.y_axis_height/(self.y_max - self.y_min) - - text1 = TextMobject("") - text2 = TexMobject("{y}_{2}-{y}_{1}") - text2 = TexMobject("{x}_{2}-{x}_{1}") - text3 = TexMobject(r"m\quad =\frac { { y }_{ 2 }-{ y }_{ 1 } }{ { x }_{ 2 }-{ x }_{ 1 } }").move_to(np.array([3,0,0])) - text4 = TexMobject(r"m\quad =\frac { 3 }{ -2 }").move_to(np.array([3,0,0])) - text5 = TexMobject(r"m\quad =\quad -1.5").move_to(np.array([3,0,0])) - self.setup_axes() - graph_1 = self.get_graph(lambda x : 3-1.5*x, color = GREEN_SCREEN, x_min = -1, x_max = 3) - graph_2 = self.get_graph(lambda x : 3.1-1.5*x, color = ORANGE, x_min = 0, x_max = 2) - dot1 = Dot() - dot2 = SmallDot(self.graph_origin+1.7*RIGHT, color = PINK) - dot3 = SmallDot(self.graph_origin+2.5*UP, color = RED_B) - vec1 = Vector(2.5*DOWN, color = PINK).shift(self.graph_origin+2.5*UP) - vec2 = Vector(1.7*RIGHT, color = RED_B).shift(self.graph_origin) - brace1 = Brace(vec1, LEFT) - brace2 = Brace(vec2, DOWN) - br1text = brace1.get_text(r"${y}_{2}-{y}_{1}$").next_to(brace1, LEFT) - br2text = brace2.get_text(r"${x}_{2}-{x}_{1}$").next_to(brace2, DOWN) - self.play(ShowCreation(graph_1), ShowCreation(dot2), ShowCreation(dot3)) - self.play(MoveAlongPath(dot1, graph_2), ShowCreation(vec1), ShowCreation(vec2), run_time = 3) - self.wait(1) - self.play(ShowCreation(brace1), ShowCreation(brace2)) - self.play(ShowCreation(br1text), ShowCreation(br2text)) - self.wait(2) - self.play(GrowFromCenter(text3)) - self.wait(2.5) - self.play(ReplacementTransform(text3, text4)) - self.wait(2) - self.play(ReplacementTransform(text4, text5)) - self.wait(2) diff --git a/FSF-2020/calculus/intro-to-calculus/introderivative/derivative2.py b/FSF-2020/calculus/intro-to-calculus/introderivative/derivative2.py deleted file mode 100644 index d6aab15..0000000 --- a/FSF-2020/calculus/intro-to-calculus/introderivative/derivative2.py +++ /dev/null @@ -1,78 +0,0 @@ -from manimlib.imports import * -class derivative2(GraphScene, MovingCameraScene): - def setup(self): - GraphScene.setup(self) - MovingCameraScene.setup(self) - CONFIG = { - "y_max" : 100, - "y_min" : 0, - "x_max" : 10, - "x_min" : 0, - "y_tick_frequency" : 100, - "x_tick_frequency" : 10, - "axes_color" : WHITE, - "num_graph_anchor_points": 3000, #this is the number of points that graph manim - "graph_origin" : ORIGIN, - "x_labeled_nums": None,#list(range(0,11)), - "y_labeled_nums": None,#list(range(0,101))[::10], - "x_axis_label":"$x$", - "y_axis_label":"$f(x)$", - "x_axis_width": 5, - "y_axis_height": 5, - "start_x" : 2, - "start_dx" : 6, - "df_color" : YELLOW, - "dx_color" : GREEN, - "secant_line_color" : MAROON_B, - "zoomed_camera_frame_starting_position": ORIGIN+2*DOWN+6*LEFT, - } - def construct(self): - self.setup() - self.camera_frame.save_state() - self.graph_origin = ORIGIN+2*DOWN+6*LEFT - self.setup_axes() - graph23 = self.get_graph(lambda x : x**2+7, color = GREEN_SCREEN, x_min = 0, x_max = 10) - graph24 = self.get_graph(lambda x : x**2+7, color = GREEN_SCREEN, x_min = 8, x_max = 2.01) - line_1 = DashedVMobject(Line(np.array([-5,-2,0]), np.array([-5,-1.42,0]))) - textdef = TextMobject("") - text1 = TexMobject("{ x }_{ 0 }").move_to(np.array([-5,-2.2,0])) - text2 = TextMobject("The line becomes tangential to the curve").move_to(self.graph_origin+RIGHT+0.5*UP).scale(0.01) - text3 = TexMobject(r"\frac { df }{ dx } =\frac { f({ x }_{ 0 }+h)-f({ x }_{ 0 }) }{ h-0 }").move_to(2*RIGHT) - text4 = TexMobject(r"\frac { df }{ dx } =\lim _{ h\rightarrow 0 }{ \frac { f({ x }_{ 0 }+h)-f({ x }_{ 0 }) }{ h } }").move_to(2*RIGHT) - squareobj = Square(side_length = 15).move_to(self.graph_origin+RIGHT+0.53*UP) - ss_group = self.get_secant_slope_group( - self.start_x, graph23, - dx = self.start_dx, - dx_label = "h", - df_label = "df", - df_line_color = self.df_color, - dx_line_color = self.dx_color, - secant_line_color = self.secant_line_color, - dot_df_top = True, - dot_dx_start = True, - dot_df_top_label = "Q", - dot_dx_start_label = "P", - secant_line_length = 8 - ) - self.play(ShowCreation(graph23)) - self.wait() - self.play(ShowCreation(ss_group.secant_line)) - self.add(text1) - self.play(ShowCreation(line_1)) - self.wait(3) - self.play(ShowCreation(ss_group.dx_line)) - self.play(ShowCreation(ss_group.dx_label)) - self.play(ShowCreation(ss_group.df_line)) - self.play(Write(ss_group.df_label)) - self.play(ShowCreation(ss_group.dot_df_top), ShowCreation(ss_group.dot_dx_start)) - self.play(ShowCreation(ss_group.dot_df_top_label), ShowCreation(ss_group.dot_dx_start_label)) - self.wait() - self.play(ShowCreation(text3)) - self.wait(2) - self.play(ReplacementTransform(text3, text4)) - self.animate_secant_slope_group_change(ss_group, target_dx = 0.01, run_time = 5) - self.wait(2) - self.play(self.camera_frame.set_width,0.2,self.camera_frame.move_to,squareobj,run_time = 2) - self.wait() - self.play(ShowCreation(text2)) - self.wait(3) diff --git a/FSF-2020/calculus/intro-to-calculus/introderivative/derivative3.py b/FSF-2020/calculus/intro-to-calculus/introderivative/derivative3.py deleted file mode 100644 index ebbacb1..0000000 --- a/FSF-2020/calculus/intro-to-calculus/introderivative/derivative3.py +++ /dev/null @@ -1,57 +0,0 @@ -from manimlib.imports import * -class derivative3(GraphScene, Scene): - def setup(self): - Scene.setup(self) - #ZoomedScene.setup(self) - CONFIG = { - "y_max" : 8, - "y_min" : 0, - "x_max" : 11, - "x_min" : 0, - "y_tick_frequency" : 1, - "x_tick_frequency" : 1, - "axes_color" : WHITE, - "num_graph_anchor_points": 3000, #this is the number of points that graph manim - "graph_origin" : ORIGIN+3*DOWN+6.5*LEFT, - "x_labeled_nums": list(range(0,12))[::1], - "y_labeled_nums": list(range(0,9))[::1], - "x_axis_label":"$t$", - "y_axis_label":"$s$", - "x_axis_width": 5, - "y_axis_height": 5, - } - def construct(self): - XTD = self.x_axis_width/(self.x_max - self.x_min) - YTD = self.y_axis_height/(self.y_max - self.y_min) - - self.setup_axes() - graph_1 = self.get_graph(lambda x : -(x-2)**2+4, color = GOLD_A, x_min = 0, x_max = 1.5) - graph_2 = self.get_graph(lambda x : 1*x+2.25, color = GOLD_A, x_min = 1.5, x_max = 5) - graph_3 = self.get_graph(lambda x : 7.25, color = GOLD_A, x_min = 5, x_max = 8) - graph_4 = self.get_graph(lambda x : -3.625*x + 36.25, color = GOLD_A, x_min = 8, x_max = 10) - - self.y_max = 5 - self.x_max = 10 - self.x_min = 0 - self.y_min = -5 - self.x_labeled_nums = list(range(0,11)) - self.y_labeled_nums = list(range(-5,6))[::1] - self.x_axis_label = r"$t$" - self.y_axis_label = r"$v$" - self.y_tick_frequency = 1 - self.x_tick_frequency = 1 - self.graph_origin = ORIGIN+1*RIGHT - self.setup_axes() - graph_5 = self.get_graph(lambda x : 2*(x-2)+4, color = GREEN_SCREEN, x_min = 0, x_max = 1.5) - graph_6 = self.get_graph(lambda x : 3, color = GREEN_SCREEN, x_min = 1.5, x_max = 5) - graph_7 = self.get_graph(lambda x : 0, color = GREEN_SCREEN, x_min = 5, x_max = 8) - graph_8 = self.get_graph(lambda x : -3.625, color = GREEN_SCREEN, x_min = 8, x_max = 10) - line1 = DashedVMobject(Line(self.graph_origin+2.5*RIGHT, self.graph_origin+2.5*RIGHT+1.5*UP)) - line2 = DashedVMobject(Line(self.graph_origin+4*RIGHT, self.graph_origin+4*RIGHT+1.835*DOWN)) - self.play(ShowCreation(graph_1), ShowCreation(graph_5), run_time = 3) - self.play(ShowCreation(graph_2), ShowCreation(graph_6), run_time = 3) - self.add(line1) - self.play(ShowCreation(graph_3), ShowCreation(graph_7), run_time = 3) - self.add(line2) - self.play(ShowCreation(graph_4), ShowCreation(graph_8), run_time = 3) - self.wait(3) diff --git a/FSF-2020/calculus/intro-to-calculus/limit/limitdef.py b/FSF-2020/calculus/intro-to-calculus/limit/limitdef.py deleted file mode 100644 index 15f2845..0000000 --- a/FSF-2020/calculus/intro-to-calculus/limit/limitdef.py +++ /dev/null @@ -1,73 +0,0 @@ -from manimlib.imports import * -class limitdef(GraphScene, Scene): - CONFIG = { - "y_max" : 5, - "y_min" : 0, - "x_max" : 5, - "x_min" : -5, - "y_tick_frequency" : 1, - "x_tick_frequency" : 1, - "axes_color" : WHITE, - "num_graph_anchor_points": 3000, #this is the number of points that graph manim - "graph_origin" : ORIGIN+2*DOWN, - "x_labeled_nums": None,#list(range(-1,2)), - "y_labeled_nums": None,#list(range(0,2)), - "x_axis_label":"$x$", - "y_axis_label":"$f(x)$", - "x_axis_width": 10, - "y_axis_height": 5, - } - def construct(self): - Ldot = MediumDot(self.graph_origin+2.1*UP).set_color(GREEN_SCREEN) - adot = MediumDot(self.graph_origin+3*RIGHT).set_color(PINK) - epline1 = DashedVMobject(Line(self.graph_origin+1*LEFT+2.5*UP, self.graph_origin+4*RIGHT+2.5*UP)) - epline2 = DashedVMobject(Line(self.graph_origin+1*LEFT+1.7*UP, self.graph_origin+4*RIGHT+1.7*UP)) - epline3 = DashedVMobject(Line(self.graph_origin+3.5*RIGHT+0.5*DOWN, self.graph_origin+3.5*RIGHT+2.5*UP)) - epline4 = DashedVMobject(Line(self.graph_origin+2.5*RIGHT+0.5*DOWN, self.graph_origin+2.5*RIGHT+2.5*UP)) - Lline = Line(self.graph_origin+2.1*UP, self.graph_origin+3*RIGHT+2.1*UP).set_color(GREEN_SCREEN) - aline = Line(self.graph_origin+3*RIGHT, self.graph_origin+3*RIGHT+2.1*UP).set_color(PINK) - vertical_rectangle = Rectangle(width = 1, height = 0.8, color = PINK, fill_opacity = 0.5, fill_color = LIGHT_PINK).move_to(self.graph_origin+3*RIGHT+2.1*UP) - horizontal_rectangle = Rectangle(width = 1, height = 0.8, color = GREEN_SCREEN, fill_opacity = 0.5, fill_color = GREEN).move_to(self.graph_origin+3*RIGHT+2.1*UP) - vec1 = Line(self.graph_origin+2.5*UP, self.graph_origin+2.1*UP) - vec2 = Line(self.graph_origin+2.1*UP, self.graph_origin+1.7*UP) - vec3 = Line(self.graph_origin+2.5*RIGHT, self.graph_origin+3*RIGHT) - vec4 = Line(self.graph_origin+3*RIGHT, self.graph_origin+3.5*RIGHT) - brace1 = Brace(vec1, LEFT) - brace2 = Brace(vec2, LEFT) - brace3 = Brace(vec3, DOWN) - brace4 = Brace(vec4, DOWN) - br1text = brace1.get_text(r"$\epsilon$").next_to(brace1, LEFT) - br2text = brace2.get_text(r"$\epsilon$").next_to(brace2, LEFT) - br3text = brace3.get_text(r"$\delta$").next_to(brace3, DOWN) - br4text = brace4.get_text(r"$\delta$").next_to(brace4, DOWN) - epgrp = VGroup(epline1, epline2, Ldot, adot, Lline, aline, epline4, epline3) - recgrp = VGroup(vertical_rectangle, horizontal_rectangle) - epbrgrp = VGroup(brace1, brace2, br1text, br2text) - delbrgrp = VGroup(brace3, brace4, br3text, br4text) - self.setup_axes() - graph_1 = self.get_graph(lambda x :0.1*(x+1)**2 +0.5, x_min = -5, x_max = 5) - graph_2 = self.get_graph(lambda x : 0.1*(x+1)**2 +0.5, x_min = 2.5, x_max = 3.5, color = YELLOW_A) - graph_2.shift(2.5*LEFT) - self.play(ShowCreation(graph_1)) - self.wait(2) - self.play(ShowCreation(epgrp), ShowCreation(horizontal_rectangle), ShowCreation(vertical_rectangle)) - self.wait(2) - self.play(ShowCreation(epbrgrp)) - self.play(ShowCreation(delbrgrp)) - self.wait(2) - self.play(FadeOut(recgrp)) - self.wait(2) - for i in range(0,1): - self.play(ApplyMethod(graph_2.shift, 2.5*RIGHT)) - self.wait(1) - self.play(ApplyMethod(graph_2.shift, 1.7*DOWN)) - self.play(ApplyMethod(graph_2.shift, 1.7*UP)) - self.wait(1) - self.play(ApplyMethod(graph_2.shift, 2.5*LEFT)) - self.play(ApplyMethod(graph_2.shift, 2.5*RIGHT)) - self.wait(1) - self.play(ApplyMethod(graph_2.shift, 1.7*DOWN)) - self.play(ApplyMethod(graph_2.shift, 1.7*UP)) - self.wait(1) - self.play(ApplyMethod(graph_2.shift, 2.5*LEFT)) - self.wait() diff --git a/FSF-2020/calculus/intro-to-calculus/limit/limitfin1.py b/FSF-2020/calculus/intro-to-calculus/limit/limitfin1.py new file mode 100644 index 0000000..ba57a15 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/limit/limitfin1.py @@ -0,0 +1,76 @@ +from manimlib.imports import * +class limitfin1(GraphScene): + CONFIG = { + "x_min" : -8, + "x_max" : 8, + "x_labeled_nums" : list(range(-8, 10, 3)), + "x_axis_width" : FRAME_WIDTH - LARGE_BUFF, + "y_min" : -4, + "y_max" : 4, + "y_labeled_nums" : None, + "y_axis_height" : FRAME_HEIGHT+2*LARGE_BUFF, + "graph_origin" : DOWN, + "graph_color" : BLUE, + "x_axis_width":20, + "y_axis_height":10, + } + def construct(self): + self.setup_axes() + XTD = 10/(8 - (-8)) + YTD = 10/(4 - (-4)) + graph1 = self.get_graph(lambda x: x**3 +1.5, x_min = self.x_min, x_max = -0.1) + graph2 = self.get_graph(lambda x: x**3 +1.5, x_min = 0.1, x_max = self.x_max, color = self.graph_color) + dot2 = Circle(radius = 0.1).move_to(self.graph_origin+1.5*UP*YTD) + text0 = TextMobject("Let L be the value of f(x) at point denoted by circle").move_to(self.graph_origin+2*DOWN) + text1 = TexMobject(r"\text{As }", r"\delta",r"\text{ tends to zero }" ,r"\epsilon" r"\text{ tends to zero}").move_to(self.graph_origin+2*DOWN) + text2 = TexMobject(r"\text{For all values in }", r"(-\delta, +\delta)",r"\text{ you will always find a real and finite value of f(x) in }",r"(L-\epsilon, L+\epsilon)").move_to(self.graph_origin+2*DOWN).scale(0.6) + self.play(ShowCreation(graph1), ShowCreation(graph2), ShowCreation(text0), FadeIn(dot2)) + line1 = DashedVMobject(Line(self.graph_origin+1*DOWN*YTD+1*LEFT*XTD, self.graph_origin+4*UP*YTD+1*LEFT*XTD), num_dashes = 50).set_color(PINK) + line2 = DashedVMobject(Line(self.graph_origin+1*DOWN*YTD+1*RIGHT*XTD, self.graph_origin+4*UP*YTD+1*RIGHT*XTD), num_dashes = 50).set_color(PINK) + line3 = DashedVMobject(Line(self.graph_origin+1.5*UP*YTD+5*LEFT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD) + line4 = DashedVMobject(Line(self.graph_origin+0.5*UP*YTD+5*LEFT*XTD, self.graph_origin+0.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD) + line5 = DashedVMobject(Line(self.graph_origin+2.5*UP*YTD+5*LEFT*XTD, self.graph_origin+2.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD) + self.play(ShowCreation(line1), ShowCreation(line2)) + vec1 = Line(self.graph_origin, self.graph_origin+1*RIGHT*XTD) + vec2 = Line(self.graph_origin, self.graph_origin+1*LEFT*XTD) + vec5 = Line(self.graph_origin+2.5*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD) + vec6 = Line(self.graph_origin+0.5*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD) + brace1 = Brace(vec1, DOWN) + brace2 = Brace(vec2, DOWN) + br1text = brace1.get_text(r"$\delta$").next_to(brace1, DOWN) + br2text = brace2.get_text(r"$\delta$").next_to(brace2, DOWN) + brace5 = Brace(vec5, RIGHT) + brace6 = Brace(vec6, RIGHT) + br5text = brace5.get_text(r"$\epsilon$").next_to(brace5, RIGHT) + br6text = brace6.get_text(r"$\epsilon$").next_to(brace6, RIGHT) + self.wait(3) + self.play(ShowCreation(brace1), ShowCreation(brace2), ShowCreation(br1text), ShowCreation(br2text)) + self.wait(3) + self.play(ReplacementTransform(text0, text1)) + self.play(ShowCreation(line3), ShowCreation(line4), ShowCreation(line5), ShowCreation(brace5), ShowCreation(brace6), ShowCreation(br5text), ShowCreation(br6text)) + vec3 = Line(self.graph_origin, self.graph_origin+0.1*RIGHT*XTD) + vec4 = Line(self.graph_origin, self.graph_origin+0.11*LEFT*XTD) + brace3 = Brace(vec3, DOWN) + brace4 = Brace(vec4, DOWN) + vec7 = Line(self.graph_origin+1.6*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD) + vec8 = Line(self.graph_origin+1.4*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD) + brace7 = Brace(vec7, RIGHT) + brace8 = Brace(vec8, RIGHT) + self.play(Transform(brace1, brace3), Transform(brace2, brace4), ApplyMethod(line2.shift, 0.8*LEFT*XTD), + ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3), + Transform(brace5, brace7), Transform(brace6, brace8), ApplyMethod(line4.shift, 1.8*UP*XTD), + ApplyMethod(line5.shift, 1.8*DOWN*XTD)) + self.wait(3) + self.play(ReplacementTransform(text1, text2)) + self.play(FadeOut(brace5), FadeOut(brace6), FadeOut(brace1), FadeOut(brace2)) + self.play(ApplyMethod(line2.shift, 0.8*RIGHT*XTD), ApplyMethod(line1.shift, 0.8*LEFT*XTD), ApplyMethod(br1text.scale, 10/3), ApplyMethod(br2text.scale, 10/3), + ApplyMethod(line5.shift, 1.8*UP*XTD), ApplyMethod(line4.shift, 1.8*DOWN*XTD)) + for i in range(0,3): + self.play(ApplyMethod(line2.shift, 0.8*LEFT*XTD), ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3), + ApplyMethod(line5.shift, 1.8*DOWN*XTD), ApplyMethod(line4.shift, 1.8*UP*XTD), ApplyMethod(br5text.scale, 0.3), ApplyMethod(br6text.scale, 0.3), run_time = 0.5) + self.play(ApplyMethod(line2.shift, 0.8*RIGHT*XTD), ApplyMethod(line1.shift, 0.8*LEFT*XTD), ApplyMethod(br1text.scale, 10/3), ApplyMethod(br2text.scale, 10/3), + ApplyMethod(line5.shift, 1.8*UP*XTD), ApplyMethod(line4.shift, 1.8*DOWN*XTD), ApplyMethod(br5text.scale, 10/3), ApplyMethod(br6text.scale ,10/3), run_time = 0.5) + self.play(ApplyMethod(line2.shift, 0.8*LEFT*XTD), ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3), + ApplyMethod(line5.shift, 1.8*DOWN*XTD), ApplyMethod(line4.shift, 1.8*UP*XTD),ApplyMethod(br5text.scale, 0.3), ApplyMethod(br6text.scale, 0.3), run_time = 0.5) + + self.wait(5) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/limit/limitfin2.py b/FSF-2020/calculus/intro-to-calculus/limit/limitfin2.py new file mode 100644 index 0000000..36ca388 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/limit/limitfin2.py @@ -0,0 +1,70 @@ +from manimlib.imports import * +class limitfin2(GraphScene): + CONFIG = { + "x_min" : -8, + "x_max" : 8, + "x_labeled_nums" : list(range(-8, 10, 3)), + "x_axis_width" : FRAME_WIDTH - LARGE_BUFF, + "y_min" : -4, + "y_max" : 4, + "y_labeled_nums" : None,#list(range(3,,)), + "y_axis_height" : FRAME_HEIGHT+2*LARGE_BUFF, + "graph_origin" : DOWN, + "graph_color" : BLUE, + "x_axis_width":20, + "y_axis_height":10, + } + def construct(self): + self.setup_axes() + XTD = 10/(8 - (-8)) + YTD = 10/(4 - (-4)) + graph1 = self.get_graph(lambda x: -(-(0.25*x**2)-1), x_min = self.x_min, x_max = -0.1) + graph2 = self.get_graph(lambda x: ((0.25*x**2)+2), x_min = 0.1, x_max = self.x_max, color = self.graph_color) + dot1 = Circle(radius = 0.1).move_to(self.graph_origin+1*UP*YTD) + dot2 = Circle(radius = 0.1).move_to(self.graph_origin+2*UP*YTD) + text1 = TexMobject(r"\text{It doesn't matter how small }", r"\delta",r"\text{ gets, }" r"\epsilon" r"\text{ does not tend to zero}").move_to(self.graph_origin+2*DOWN) + self.play(ShowCreation(graph1), ShowCreation(graph2), ShowCreation(text1), FadeIn(dot1), FadeIn(dot2)) + line1 = DashedVMobject(Line(self.graph_origin+1*DOWN*YTD+1*LEFT*XTD, self.graph_origin+4*UP*YTD+1*LEFT*XTD), num_dashes = 50).set_color(PINK) + line2 = DashedVMobject(Line(self.graph_origin+1*DOWN*YTD+1*RIGHT*XTD, self.graph_origin+4*UP*YTD+1*RIGHT*XTD), num_dashes = 50).set_color(PINK) + line3 = DashedVMobject(Line(self.graph_origin+1.5*UP*YTD+5*LEFT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD) + line4 = DashedVMobject(Line(self.graph_origin+0.5*UP*YTD+5*LEFT*XTD, self.graph_origin+0.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD) + line5 = DashedVMobject(Line(self.graph_origin+2.5*UP*YTD+5*LEFT*XTD, self.graph_origin+2.5*UP*YTD+4*RIGHT*XTD), num_dashes = 50).set_color(GOLD) + self.play(ShowCreation(line1), ShowCreation(line2)) + vec1 = Line(self.graph_origin, self.graph_origin+1*RIGHT*XTD) + vec2 = Line(self.graph_origin, self.graph_origin+1*LEFT*XTD) + vec5 = Line(self.graph_origin+2.5*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD) + vec6 = Line(self.graph_origin+0.5*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD) + brace1 = Brace(vec1, DOWN) + brace2 = Brace(vec2, DOWN) + br1text = brace1.get_text(r"$\delta$").next_to(brace1, DOWN) + br2text = brace2.get_text(r"$\delta$").next_to(brace2, DOWN) + brace5 = Brace(vec5, RIGHT) + brace6 = Brace(vec6, RIGHT) + br5text = brace5.get_text(r"$\epsilon$").next_to(brace5, RIGHT) + br6text = brace6.get_text(r"$\epsilon$").next_to(brace6, RIGHT) + self.wait(3) + self.play(ShowCreation(brace1), ShowCreation(brace2), ShowCreation(br1text), ShowCreation(br2text)) + self.wait(3) + self.play(ShowCreation(line3), ShowCreation(line4), ShowCreation(line5), ShowCreation(brace5), ShowCreation(brace6), ShowCreation(br5text), ShowCreation(br6text)) + vec3 = Line(self.graph_origin, self.graph_origin+0.1*RIGHT*XTD) + vec4 = Line(self.graph_origin, self.graph_origin+0.11*LEFT*XTD) + brace3 = Brace(vec3, DOWN) + brace4 = Brace(vec4, DOWN) + vec7 = Line(self.graph_origin+2.1*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD) + vec8 = Line(self.graph_origin+0.9*UP*YTD+4*RIGHT*XTD, self.graph_origin+1.5*UP*YTD+4*RIGHT*XTD) + brace7 = Brace(vec7, RIGHT) + brace8 = Brace(vec8, RIGHT) + self.play(Transform(brace1, brace3), Transform(brace2, brace4), ApplyMethod(line2.shift, 0.8*LEFT*XTD), + ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3), + Transform(brace5, brace7), Transform(brace6, brace8), ApplyMethod(line4.shift, 0.8*UP*XTD), + ApplyMethod(line5.shift, 0.8*DOWN*XTD)) + + self.play(FadeOut(brace3), FadeOut(brace4), FadeOut(brace1), FadeOut(brace2)) + self.play(ApplyMethod(line2.shift, 0.8*RIGHT*XTD), ApplyMethod(line1.shift, 0.8*LEFT*XTD), ApplyMethod(br1text.scale, 10/3), ApplyMethod(br2text.scale, 10/3)) + for i in range(0,3): + self.play(ApplyMethod(line2.shift, 0.8*LEFT*XTD), ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3), run_time = 0.5) + self.play(ApplyMethod(line2.shift, 0.8*RIGHT*XTD), ApplyMethod(line1.shift, 0.8*LEFT*XTD), ApplyMethod(br1text.scale, 10/3), ApplyMethod(br2text.scale, 10/3), run_time = 0.5) + + self.play(ApplyMethod(line2.shift, 0.8*LEFT*XTD), ApplyMethod(line1.shift, 0.8*RIGHT*XTD), ApplyMethod(br1text.scale, 0.3), ApplyMethod(br2text.scale, 0.3), run_time = 0.5) + + self.wait(5) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md new file mode 100644 index 0000000..a9ad0bb --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md @@ -0,0 +1,18 @@ +rierect1.gif +![rierect1](https://user-images.githubusercontent.com/61246381/87141790-3ad90800-c2c1-11ea-86e4-af05cb93fa2d.gif) + + +rierect2.gif +![rierect2](https://user-images.githubusercontent.com/61246381/87141870-5ba15d80-c2c1-11ea-9307-40acc2884d77.gif) + + +rierect3.gif +![rierect3](https://user-images.githubusercontent.com/61246381/87141949-6e1b9700-c2c1-11ea-9433-4f6be752aa55.gif) + + +RiemannRectanglesAnimation. +![RiemannRectanglesAnimation](https://user-images.githubusercontent.com/61246381/87142531-4a0c8580-c2c2-11ea-8f5e-9e854eae6eec.gif) + + +mimi.gif +![mimi](https://user-images.githubusercontent.com/61246381/87142127-b3d85f80-c2c1-11ea-864e-627e41d87ea2.gif) diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/RiemannRectanglesAnimation.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/RiemannRectanglesAnimation.py new file mode 100644 index 0000000..1757231 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/RiemannRectanglesAnimation.py @@ -0,0 +1,66 @@ +from manimlib.imports import * +class RiemannRectanglesAnimation(GraphScene): + CONFIG = { + "y_max": 5, + "x_max": 6, + "x_min": 0, + "y_min": 0, + "x_axis_width": 5, + "y_axis_height": 5, + "init_dx":0.5, + "graph_origin": ORIGIN+2*DOWN+6*LEFT, + } + def construct(self): + self.setup_axes() + def func(x): + return 0.1*(x)*(x-3)*(x-7)+3 + + graph1=self.get_graph(func,x_min=0,x_max=6) + kwargs = { + "x_min" : 1.5, + "x_max" : 5.5, + "fill_opacity" : 0.75, + "stroke_width" : 0.25, + "input_sample_type": "right", + } + flat_rectangles1 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE),**kwargs) + riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph1,6,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs) + self.add(graph1) + self.graph_origin = ORIGIN+2*DOWN+1*RIGHT + self.setup_axes() + graph2=self.get_graph(func,x_min=0,x_max=6) + kwargs = { + "x_min" : 1.5, + "x_max" : 5.5, + "fill_opacity" : 0.75, + "stroke_width" : 0.25, + "input_sample_type": "left", + } + flat_rectangles2 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE),**kwargs) + riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph2,6,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs) + self.add(graph2) + text1 = TextMobject("Left Riemann sum").move_to(np.array([-3,-2.5,0])) + text2 = TextMobject("Right Riemann sum").move_to(np.array([4,-2.5,0])) + grp1 = VGroup(text1, text2) + text3 = TexMobject(r"n \rightarrow \infty").move_to(np.array([0, -3, 0])) + text4 = TextMobject("Left and Right Riemann sums are equal").move_to(np.array([0, -3, 0])) + text5 = TextMobject("Hence function is Riemann integrable and value of integral equals area covered").move_to(np.array([0, -3, 0])).scale(0.6) + grp2 = VGroup(text1, text2, text3) + # Show Riemann rectangles + self.play(ReplacementTransform(flat_rectangles1,riemann_rectangles_list1[0]), ReplacementTransform(flat_rectangles2, riemann_rectangles_list2[0])) + self.wait() + self.play(ShowCreation(grp1)) + for r in range(1,len(riemann_rectangles_list1)-3): + self.transform_between_riemann_rects(riemann_rectangles_list1[r-1],riemann_rectangles_list1[r],replace_mobject_with_target_in_scene = True,) + self.transform_between_riemann_rects(riemann_rectangles_list2[r-1],riemann_rectangles_list2[r],replace_mobject_with_target_in_scene = True,) + self.play(ShowCreation(text3)) + for r in range(len(riemann_rectangles_list1)-3,len(riemann_rectangles_list1)): + self.transform_between_riemann_rects(riemann_rectangles_list1[r-1],riemann_rectangles_list1[r],replace_mobject_with_target_in_scene = True,) + self.transform_between_riemann_rects(riemann_rectangles_list2[r-1],riemann_rectangles_list2[r],replace_mobject_with_target_in_scene = True,) + self.wait(2) + grp3 = VGroup(graph1, riemann_rectangles_list1[5]) + grp4 = VGroup(graph2, riemann_rectangles_list2[5]) + self.play(ReplacementTransform(grp2, text4)) + self.wait(2) + self.play(ReplacementTransform(text4, text5), ApplyMethod(grp4.shift, 7*LEFT), ApplyMethod(self.axes.shift, 7*LEFT), ) + self.wait(4) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/mimi.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/mimi.py new file mode 100644 index 0000000..2471c87 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/mimi.py @@ -0,0 +1,53 @@ +class mimi(GraphScene): + CONFIG = { + "y_max": 5, + "x_max": 6, + "x_min": 0, + "y_min": 0, + "x_axis_width": 5, + "y_axis_height": 5, + "init_dx":0.5, + "graph_origin": ORIGIN+2*DOWN+6*LEFT, + } + def construct(self): + self.setup_axes() + def func(x): + return 0.1*(x)*(x-3)*(x-7)+3 + + graph=self.get_graph(func,x_min=0,x_max=6) + kwargs = { + "x_min" : 1.5, + "x_max" : 5.5, + "fill_opacity" : 0.5, + "stroke_width" : 0.25, + } + flat_rectangles = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,**kwargs) + riemann_rectangles_list = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "right") + riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "left") + self.add(graph) + self.play(ReplacementTransform(flat_rectangles,riemann_rectangles_list[0]), ReplacementTransform(flat_rectangles,riemann_rectangles_list1[0])) + #self.play(ReplacementTransform(flat_rectangles,riemann_rectangles_list1[0])) + self.wait(2) + kwargs = { + "x_min" : 3, + "x_max" : 3.5, + "fill_opacity" : 0.5, + "stroke_width" : 0.25, + } + riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "right") + riemann_rectangles_list3 = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "left") + #self.play(FadeOut(riemann_rectangles_list[0]), FadeOut(riemann_rectangles_list1[0])) + self.play(ReplacementTransform(flat_rectangles,riemann_rectangles_list2[0]), ReplacementTransform(flat_rectangles,riemann_rectangles_list3[0]), FadeOut(riemann_rectangles_list[0]), FadeOut(riemann_rectangles_list1[0])) + minlim = self.get_vertical_line_to_graph(3,graph,DashedLine) + maxlim = self.get_vertical_line_to_graph(3.5,graph,DashedLine) + line2 = Line(self.graph_origin+2.5*RIGHT, self.graph_origin+2.9*RIGHT) + brace1 = Brace(minlim, LEFT) + brace2 = Brace(line2, DOWN) + brace3 = Brace(maxlim, RIGHT) + br1text = brace1.get_text(r"${M}_{i}$").next_to(brace1, LEFT) + br2text = brace2.get_text(r"$\Delta x$").next_to(brace2, DOWN) + br3text = brace3.get_text(r"${m}_{i}$").next_to(brace3, RIGHT) + text1 = TexMobject(r"\Delta x=(b-a)/n").shift(2*RIGHT) + grp3 = VGroup(br1text, br2text, br3text, brace1, brace2, brace3, text1) + self.play(ShowCreation(grp3)) + self.wait(5) diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect1.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect1.py new file mode 100644 index 0000000..748d766 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect1.py @@ -0,0 +1,31 @@ +from manimlib.imports import * +class rierect1(GraphScene): + CONFIG = { + "y_max" : 6, + "y_min" : 0, + "x_max" : 4, + "x_min" : 0, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color" : WHITE, + "num_graph_anchor_points": 3000, #this is the number of points that graph manim + "graph_origin" : ORIGIN+2*DOWN+4*LEFT, + "x_labeled_nums": None,#list(range(-1,2)), + "y_labeled_nums": None,#list(range(0,2)), + "x_axis_label":"$x$", + "y_axis_label":"$f(x)$", + "x_axis_width": 10, + "y_axis_height": 5, + } + def construct(self): + self.setup_axes() + graph1 = self.get_graph(lambda x : (0.1*(1.5*x+1)**2 +0.5), x_min = 0, x_max = 4) + minlim = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK) + maxlim = self.get_vertical_line_to_graph(3,graph1,DashedLine,color = PINK) + x1 = TexMobject(r"{x}_{1}").next_to(minlim, DOWN) + x2 = TexMobject(r"{x}_{2}").next_to(maxlim, DOWN) + rie1 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.4, input_sample_type = "left", fill_opacity = 1, start_color = YELLOW, end_color = YELLOW) + #rie2 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "right", fill_opacity = 0.5, start_color = PINK, end_color = LIGHT_PINK) + group = VGroup(graph1, minlim, maxlim, x1, x2, rie1) + self.play(ShowCreation(group)) + self.wait(1.5) diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect2.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect2.py new file mode 100644 index 0000000..e300250 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect2.py @@ -0,0 +1,31 @@ +from manimlib.imports import * +class rierect2(GraphScene): + CONFIG = { + "y_max" : 6, + "y_min" : 0, + "x_max" : 4, + "x_min" : 0, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color" : WHITE, + "num_graph_anchor_points": 3000, #this is the number of points that graph manim + "graph_origin" : ORIGIN+2*DOWN+4*LEFT, + "x_labeled_nums": None,#list(range(-1,2)), + "y_labeled_nums": None,#list(range(0,2)), + "x_axis_label":"$x$", + "y_axis_label":"$f(x)$", + "x_axis_width": 10, + "y_axis_height": 5, + } + def construct(self): + self.setup_axes() + graph1 = self.get_graph(lambda x : (0.1*(1.5*x+1)**2 +0.5), x_min = 0, x_max = 4) + minlim = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK) + maxlim = self.get_vertical_line_to_graph(3,graph1,DashedLine,color = PINK) + x1 = TexMobject(r"{x}_{1}").next_to(minlim, DOWN) + x2 = TexMobject(r"{x}_{2}").next_to(maxlim, DOWN) + rie1 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.1, input_sample_type = "left", fill_opacity = 1, start_color = YELLOW, end_color = YELLOW) + #rie2 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "right", fill_opacity = 0.5, start_color = PINK, end_color = LIGHT_PINK) + group = VGroup(graph1, minlim, maxlim, x1, x2, rie1) + self.play(ShowCreation(group)) + self.wait(1.5) diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect3.py b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect3.py new file mode 100644 index 0000000..3542358 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/rierect3.py @@ -0,0 +1,31 @@ +from manimlib.imports import * +class rierect3(GraphScene): + CONFIG = { + "y_max" : 6, + "y_min" : 0, + "x_max" : 4, + "x_min" : 0, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color" : WHITE, + "num_graph_anchor_points": 3000, #this is the number of points that graph manim + "graph_origin" : ORIGIN+2*DOWN+4*LEFT, + "x_labeled_nums": None,#list(range(-1,2)), + "y_labeled_nums": None,#list(range(0,2)), + "x_axis_label":"$x$", + "y_axis_label":"$f(x)$", + "x_axis_width": 10, + "y_axis_height": 5, + } + def construct(self): + self.setup_axes() + graph1 = self.get_graph(lambda x : (0.1*(1.5*x+1)**2 +0.5), x_min = 0, x_max = 4) + minlim = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK) + maxlim = self.get_vertical_line_to_graph(3,graph1,DashedLine,color = PINK) + x1 = TexMobject(r"{x}_{1}").next_to(minlim, DOWN) + x2 = TexMobject(r"{x}_{2}").next_to(maxlim, DOWN) + rie1 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "left", fill_opacity = 1, start_color = YELLOW, end_color = YELLOW) + #rie2 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "right", fill_opacity = 0.5, start_color = PINK, end_color = LIGHT_PINK) + group = VGroup(graph1, minlim, maxlim, x1, x2, rie1) + self.play(ShowCreation(group)) + self.wait(1.5) diff --git a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/README.md b/FSF-2020/calculus/intro-to-calculus/riemannintegrals/README.md deleted file mode 100644 index a9ad0bb..0000000 --- a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/README.md +++ /dev/null @@ -1,18 +0,0 @@ -rierect1.gif -![rierect1](https://user-images.githubusercontent.com/61246381/87141790-3ad90800-c2c1-11ea-86e4-af05cb93fa2d.gif) - - -rierect2.gif -![rierect2](https://user-images.githubusercontent.com/61246381/87141870-5ba15d80-c2c1-11ea-9307-40acc2884d77.gif) - - -rierect3.gif -![rierect3](https://user-images.githubusercontent.com/61246381/87141949-6e1b9700-c2c1-11ea-9433-4f6be752aa55.gif) - - -RiemannRectanglesAnimation. -![RiemannRectanglesAnimation](https://user-images.githubusercontent.com/61246381/87142531-4a0c8580-c2c2-11ea-8f5e-9e854eae6eec.gif) - - -mimi.gif -![mimi](https://user-images.githubusercontent.com/61246381/87142127-b3d85f80-c2c1-11ea-864e-627e41d87ea2.gif) diff --git a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/RiemannRectanglesAnimation.py b/FSF-2020/calculus/intro-to-calculus/riemannintegrals/RiemannRectanglesAnimation.py deleted file mode 100644 index 1757231..0000000 --- a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/RiemannRectanglesAnimation.py +++ /dev/null @@ -1,66 +0,0 @@ -from manimlib.imports import * -class RiemannRectanglesAnimation(GraphScene): - CONFIG = { - "y_max": 5, - "x_max": 6, - "x_min": 0, - "y_min": 0, - "x_axis_width": 5, - "y_axis_height": 5, - "init_dx":0.5, - "graph_origin": ORIGIN+2*DOWN+6*LEFT, - } - def construct(self): - self.setup_axes() - def func(x): - return 0.1*(x)*(x-3)*(x-7)+3 - - graph1=self.get_graph(func,x_min=0,x_max=6) - kwargs = { - "x_min" : 1.5, - "x_max" : 5.5, - "fill_opacity" : 0.75, - "stroke_width" : 0.25, - "input_sample_type": "right", - } - flat_rectangles1 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE),**kwargs) - riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph1,6,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs) - self.add(graph1) - self.graph_origin = ORIGIN+2*DOWN+1*RIGHT - self.setup_axes() - graph2=self.get_graph(func,x_min=0,x_max=6) - kwargs = { - "x_min" : 1.5, - "x_max" : 5.5, - "fill_opacity" : 0.75, - "stroke_width" : 0.25, - "input_sample_type": "left", - } - flat_rectangles2 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE),**kwargs) - riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph2,6,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs) - self.add(graph2) - text1 = TextMobject("Left Riemann sum").move_to(np.array([-3,-2.5,0])) - text2 = TextMobject("Right Riemann sum").move_to(np.array([4,-2.5,0])) - grp1 = VGroup(text1, text2) - text3 = TexMobject(r"n \rightarrow \infty").move_to(np.array([0, -3, 0])) - text4 = TextMobject("Left and Right Riemann sums are equal").move_to(np.array([0, -3, 0])) - text5 = TextMobject("Hence function is Riemann integrable and value of integral equals area covered").move_to(np.array([0, -3, 0])).scale(0.6) - grp2 = VGroup(text1, text2, text3) - # Show Riemann rectangles - self.play(ReplacementTransform(flat_rectangles1,riemann_rectangles_list1[0]), ReplacementTransform(flat_rectangles2, riemann_rectangles_list2[0])) - self.wait() - self.play(ShowCreation(grp1)) - for r in range(1,len(riemann_rectangles_list1)-3): - self.transform_between_riemann_rects(riemann_rectangles_list1[r-1],riemann_rectangles_list1[r],replace_mobject_with_target_in_scene = True,) - self.transform_between_riemann_rects(riemann_rectangles_list2[r-1],riemann_rectangles_list2[r],replace_mobject_with_target_in_scene = True,) - self.play(ShowCreation(text3)) - for r in range(len(riemann_rectangles_list1)-3,len(riemann_rectangles_list1)): - self.transform_between_riemann_rects(riemann_rectangles_list1[r-1],riemann_rectangles_list1[r],replace_mobject_with_target_in_scene = True,) - self.transform_between_riemann_rects(riemann_rectangles_list2[r-1],riemann_rectangles_list2[r],replace_mobject_with_target_in_scene = True,) - self.wait(2) - grp3 = VGroup(graph1, riemann_rectangles_list1[5]) - grp4 = VGroup(graph2, riemann_rectangles_list2[5]) - self.play(ReplacementTransform(grp2, text4)) - self.wait(2) - self.play(ReplacementTransform(text4, text5), ApplyMethod(grp4.shift, 7*LEFT), ApplyMethod(self.axes.shift, 7*LEFT), ) - self.wait(4) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/mimi.py b/FSF-2020/calculus/intro-to-calculus/riemannintegrals/mimi.py deleted file mode 100644 index 2471c87..0000000 --- a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/mimi.py +++ /dev/null @@ -1,53 +0,0 @@ -class mimi(GraphScene): - CONFIG = { - "y_max": 5, - "x_max": 6, - "x_min": 0, - "y_min": 0, - "x_axis_width": 5, - "y_axis_height": 5, - "init_dx":0.5, - "graph_origin": ORIGIN+2*DOWN+6*LEFT, - } - def construct(self): - self.setup_axes() - def func(x): - return 0.1*(x)*(x-3)*(x-7)+3 - - graph=self.get_graph(func,x_min=0,x_max=6) - kwargs = { - "x_min" : 1.5, - "x_max" : 5.5, - "fill_opacity" : 0.5, - "stroke_width" : 0.25, - } - flat_rectangles = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,**kwargs) - riemann_rectangles_list = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "right") - riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "left") - self.add(graph) - self.play(ReplacementTransform(flat_rectangles,riemann_rectangles_list[0]), ReplacementTransform(flat_rectangles,riemann_rectangles_list1[0])) - #self.play(ReplacementTransform(flat_rectangles,riemann_rectangles_list1[0])) - self.wait(2) - kwargs = { - "x_min" : 3, - "x_max" : 3.5, - "fill_opacity" : 0.5, - "stroke_width" : 0.25, - } - riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "right") - riemann_rectangles_list3 = self.get_riemann_rectangles_list(graph,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=ORANGE,**kwargs, input_sample_type = "left") - #self.play(FadeOut(riemann_rectangles_list[0]), FadeOut(riemann_rectangles_list1[0])) - self.play(ReplacementTransform(flat_rectangles,riemann_rectangles_list2[0]), ReplacementTransform(flat_rectangles,riemann_rectangles_list3[0]), FadeOut(riemann_rectangles_list[0]), FadeOut(riemann_rectangles_list1[0])) - minlim = self.get_vertical_line_to_graph(3,graph,DashedLine) - maxlim = self.get_vertical_line_to_graph(3.5,graph,DashedLine) - line2 = Line(self.graph_origin+2.5*RIGHT, self.graph_origin+2.9*RIGHT) - brace1 = Brace(minlim, LEFT) - brace2 = Brace(line2, DOWN) - brace3 = Brace(maxlim, RIGHT) - br1text = brace1.get_text(r"${M}_{i}$").next_to(brace1, LEFT) - br2text = brace2.get_text(r"$\Delta x$").next_to(brace2, DOWN) - br3text = brace3.get_text(r"${m}_{i}$").next_to(brace3, RIGHT) - text1 = TexMobject(r"\Delta x=(b-a)/n").shift(2*RIGHT) - grp3 = VGroup(br1text, br2text, br3text, brace1, brace2, brace3, text1) - self.play(ShowCreation(grp3)) - self.wait(5) diff --git a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect1.py b/FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect1.py deleted file mode 100644 index 748d766..0000000 --- a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect1.py +++ /dev/null @@ -1,31 +0,0 @@ -from manimlib.imports import * -class rierect1(GraphScene): - CONFIG = { - "y_max" : 6, - "y_min" : 0, - "x_max" : 4, - "x_min" : 0, - "y_tick_frequency" : 1, - "x_tick_frequency" : 1, - "axes_color" : WHITE, - "num_graph_anchor_points": 3000, #this is the number of points that graph manim - "graph_origin" : ORIGIN+2*DOWN+4*LEFT, - "x_labeled_nums": None,#list(range(-1,2)), - "y_labeled_nums": None,#list(range(0,2)), - "x_axis_label":"$x$", - "y_axis_label":"$f(x)$", - "x_axis_width": 10, - "y_axis_height": 5, - } - def construct(self): - self.setup_axes() - graph1 = self.get_graph(lambda x : (0.1*(1.5*x+1)**2 +0.5), x_min = 0, x_max = 4) - minlim = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK) - maxlim = self.get_vertical_line_to_graph(3,graph1,DashedLine,color = PINK) - x1 = TexMobject(r"{x}_{1}").next_to(minlim, DOWN) - x2 = TexMobject(r"{x}_{2}").next_to(maxlim, DOWN) - rie1 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.4, input_sample_type = "left", fill_opacity = 1, start_color = YELLOW, end_color = YELLOW) - #rie2 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "right", fill_opacity = 0.5, start_color = PINK, end_color = LIGHT_PINK) - group = VGroup(graph1, minlim, maxlim, x1, x2, rie1) - self.play(ShowCreation(group)) - self.wait(1.5) diff --git a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect2.py b/FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect2.py deleted file mode 100644 index e300250..0000000 --- a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect2.py +++ /dev/null @@ -1,31 +0,0 @@ -from manimlib.imports import * -class rierect2(GraphScene): - CONFIG = { - "y_max" : 6, - "y_min" : 0, - "x_max" : 4, - "x_min" : 0, - "y_tick_frequency" : 1, - "x_tick_frequency" : 1, - "axes_color" : WHITE, - "num_graph_anchor_points": 3000, #this is the number of points that graph manim - "graph_origin" : ORIGIN+2*DOWN+4*LEFT, - "x_labeled_nums": None,#list(range(-1,2)), - "y_labeled_nums": None,#list(range(0,2)), - "x_axis_label":"$x$", - "y_axis_label":"$f(x)$", - "x_axis_width": 10, - "y_axis_height": 5, - } - def construct(self): - self.setup_axes() - graph1 = self.get_graph(lambda x : (0.1*(1.5*x+1)**2 +0.5), x_min = 0, x_max = 4) - minlim = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK) - maxlim = self.get_vertical_line_to_graph(3,graph1,DashedLine,color = PINK) - x1 = TexMobject(r"{x}_{1}").next_to(minlim, DOWN) - x2 = TexMobject(r"{x}_{2}").next_to(maxlim, DOWN) - rie1 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.1, input_sample_type = "left", fill_opacity = 1, start_color = YELLOW, end_color = YELLOW) - #rie2 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "right", fill_opacity = 0.5, start_color = PINK, end_color = LIGHT_PINK) - group = VGroup(graph1, minlim, maxlim, x1, x2, rie1) - self.play(ShowCreation(group)) - self.wait(1.5) diff --git a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect3.py b/FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect3.py deleted file mode 100644 index 3542358..0000000 --- a/FSF-2020/calculus/intro-to-calculus/riemannintegrals/rierect3.py +++ /dev/null @@ -1,31 +0,0 @@ -from manimlib.imports import * -class rierect3(GraphScene): - CONFIG = { - "y_max" : 6, - "y_min" : 0, - "x_max" : 4, - "x_min" : 0, - "y_tick_frequency" : 1, - "x_tick_frequency" : 1, - "axes_color" : WHITE, - "num_graph_anchor_points": 3000, #this is the number of points that graph manim - "graph_origin" : ORIGIN+2*DOWN+4*LEFT, - "x_labeled_nums": None,#list(range(-1,2)), - "y_labeled_nums": None,#list(range(0,2)), - "x_axis_label":"$x$", - "y_axis_label":"$f(x)$", - "x_axis_width": 10, - "y_axis_height": 5, - } - def construct(self): - self.setup_axes() - graph1 = self.get_graph(lambda x : (0.1*(1.5*x+1)**2 +0.5), x_min = 0, x_max = 4) - minlim = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK) - maxlim = self.get_vertical_line_to_graph(3,graph1,DashedLine,color = PINK) - x1 = TexMobject(r"{x}_{1}").next_to(minlim, DOWN) - x2 = TexMobject(r"{x}_{2}").next_to(maxlim, DOWN) - rie1 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "left", fill_opacity = 1, start_color = YELLOW, end_color = YELLOW) - #rie2 = self.get_riemann_rectangles(graph1, x_min = 1, x_max = 3, dx = 0.01, input_sample_type = "right", fill_opacity = 0.5, start_color = PINK, end_color = LIGHT_PINK) - group = VGroup(graph1, minlim, maxlim, x1, x2, rie1) - self.play(ShowCreation(group)) - self.wait(1.5) -- cgit From bf7bb8fceedbbe812385091c3bb5f860db66de6e Mon Sep 17 00:00:00 2001 From: stayaryan Date: Mon, 20 Jul 2020 20:28:31 +0530 Subject: Changes --- .../fundamental1.py | 72 +++++++++++++ .../intro-to-calculus/gabriels-horn/gabriel1.py | 2 - .../infinite-seq-and-series/convergence.py | 57 +++++++++++ .../infinite-seq-and-series/divergence.py | 111 +++++++++++++++++++++ .../infinite-seq-and-series/taylorseries.py | 67 +++++++++++++ .../intro-to-calculus/riemann-integrals/README.md | 4 +- 6 files changed, 309 insertions(+), 4 deletions(-) create mode 100644 FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/fundamental1.py create mode 100644 FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/convergence.py create mode 100644 FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/divergence.py create mode 100644 FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/taylorseries.py diff --git a/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/fundamental1.py b/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/fundamental1.py new file mode 100644 index 0000000..fd40347 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/fundamental1.py @@ -0,0 +1,72 @@ +from manimlib.imports import * + +class funda1(GraphScene, MovingCameraScene): + def setup(self): + MovingCameraScene.setup(self) + GraphScene.setup(self) + CONFIG = { + "y_max": 5, + "x_max": 8, + "x_min": 0, + "y_min": 0, + "x_axis_width": 10, + "y_axis_height": 5, + "init_dx":0.5, + "x_axis_label":"$t$", + "y_axis_label":"$F(x)$", + "graph_origin": ORIGIN+2*DOWN+6*LEFT, + } + def construct(self): + self.setup_axes() + def func(x): + return 0.1*(x)*(x-3)*(x-7)+3 + + graph1 = self.get_graph(func, x_min = 0, x_max = 7) + graph2 = self.get_graph(func, x_min = 5, x_max = 6) + sqr = Square(side_length = 15.0).move_to(np.array([0.5,-1.5,0])) + line1 = self.get_vertical_line_to_graph(1,graph1,DashedLine, color = PINK) + line2 = self.get_vertical_line_to_graph(5,graph1,DashedLine, color = PINK) + line3 = self.get_vertical_line_to_graph(6,graph1,DashedLine, color = PINK) + line4 = self.get_vertical_line_to_graph(5.01,graph1,DashedLine, color = PINK) + t1 = TextMobject("a").next_to(line1, DOWN) + t2 = TextMobject("x").next_to(line2, DOWN) + t3 = TextMobject("x+h").next_to(line3, DOWN) + text1 = TexMobject(r"\int _{ a }^{ x+h }{ f(t)dt }").move_to(np.array([3,2,0])).scale(0.7) + text2 = TexMobject(r"\int _{ a }^{ x }{ f(t)dt }").move_to(np.array([1,2,0])).scale(0.7) + text3 = TexMobject(r"= \int _{ x }^{ x+h }{ f(t)dt }").move_to(np.array([3,2,0])).scale(0.7) + text4 = TexMobject(r"h \rightarrow 0").move_to(np.array([1,-1.5,0])).scale(0.8) + text5 = TexMobject(r"F^{ ' }\left( x \right)=\lim _{ h\rightarrow 0 }{ \frac { f(x).h }{ h } }").move_to(np.array([1,-1.5,0])).scale(0.2) + text6 = TexMobject(r"F^{ ' }\left( x \right)=f(x)").move_to(np.array([1,-1.5,0])).scale(0.2) + minus = TextMobject("-").move_to(np.array([0.2,2,0])) + group = VGroup(line1, line2, line3, t1, t2, t3) + brace1 = Brace(line2, LEFT).scale(0.35) + br1text = brace1.get_text(r"$f(x)$").next_to(brace1, 1.001*LEFT+1*RIGHT).scale(0.1) + brgrp = VGroup(brace1, br1text) + flat_rectangles1 = self.get_riemann_rectangles(self.get_graph(lambda x : 0),dx=self.init_dx,start_color=invert_color(PURPLE),end_color=invert_color(ORANGE)) + riemann_rectangles_list3 = self.get_riemann_rectangles_list(graph1, 8, max_dx=self.init_dx, power_base=2, start_color = GREEN, end_color=GREEN, x_min =1, x_max = 6) + riemann_rectangles_list1 = self.get_riemann_rectangles_list(graph1,8,max_dx=self.init_dx,power_base=2,start_color=PURPLE,end_color=BLUE_A,x_min = 1, x_max = 5) + riemann_rectangles_list2 = self.get_riemann_rectangles_list(graph1,8,max_dx=self.init_dx,power_base=2,start_color=RED,end_color=RED,x_min = 5, x_max = 6) + riemann_rectangles_list4 = self.get_riemann_rectangles_list(graph1,8,max_dx=self.init_dx,power_base=2,start_color=RED,end_color=RED,x_min = 5, x_max = 5.01) + + self.add(graph1) + self.play(ReplacementTransform(flat_rectangles1,riemann_rectangles_list3[7]), ShowCreation(text1)) + self.wait(3) + self.play(ShowCreation(group)) + self.wait(1) + self.play(ReplacementTransform(flat_rectangles1,riemann_rectangles_list2[7]), ReplacementTransform(flat_rectangles1,riemann_rectangles_list1[7])) + self.play(FadeOut(riemann_rectangles_list3[7])) + self.wait(2) + self.play(ApplyMethod(text1.shift, 4*LEFT), ShowCreation(minus), ShowCreation(text2), ShowCreation(text3)) + self.play(FadeOut(riemann_rectangles_list1[7])) + self.wait(3) + self.camera_frame.save_state() + self.play(self.camera_frame.set_width,2.25,self.camera_frame.move_to,sqr,run_time = 2) + self.wait(2) + self.play(ReplacementTransform(riemann_rectangles_list2[7], riemann_rectangles_list4[7]), FadeOut(riemann_rectangles_list2[7]), ReplacementTransform(line3, line4), FadeOut(line3), ShowCreation(text4)) + self.wait(2) + self.play(ShowCreation(brgrp)) + self.wait(2) + self.play(ReplacementTransform(text4, text5)) + self.wait(2) + self.play(ReplacementTransform(text5, text6)) + self.wait(5) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py index 3596c88..16aeba9 100644 --- a/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py +++ b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/gabriel1.py @@ -52,8 +52,6 @@ class sphere(GraphScene, ThreeDScene): self.add_fixed_in_frame_mobjects(text7) self.wait(2) self.move_camera(phi = 60*DEGREES, theta= -45*DEGREES, distance = 200, run_time=5) - #self.play(FadeOut(text6)) - #self.add_fixed_in_frame_mobjects(text7) k=0 while k<9: disc1 = ParametricSurface(lambda u, v : np.array([0, (1/(1+k))*v*np.sin(TAU*u), (1/(1+k))*v*np.cos(TAU*u)]), fill_opacity = 0.5, fill_color = PINK).shift((1+k)*RIGHT) diff --git a/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/convergence.py b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/convergence.py new file mode 100644 index 0000000..fcbcfb4 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/convergence.py @@ -0,0 +1,57 @@ +from manimlib.imports import * +def GetCenters(width,center,n): + d = width / 4 + list = [center + [0,d,0]] + if n > 1: + list.append(center + [-d,-d,0]) + if n > 2: + list.extend(GetCenters(width / 2, center + [d,-d,0],n-2)) + return list +END_CENTERS = [ORIGIN] +END_CENTERS.extend(GetCenters(3, 3 * RIGHT, 24)) +color_list = ['#00931F','#A93226','#D68910','#17A589','#2471A3','#884EA0','#E74C3C','#D4AC0D'] +COLORS = [color_list[i % len(color_list)] for i in range(50)] +class RectangleFromSequence(Rectangle): + CONFIG = { + "sequence_number": 0, + "center": ORIGIN + } + def __init__(self, **kwargs): + digest_config(self, kwargs) + Rectangle.__init__(self,height = 3 * (1/2) ** ((self.sequence_number + 1) // 2),width = 3 * (1/2) ** ((self.sequence_number) // 2),**kwargs) + if self.sequence_number < 6: + if self.sequence_number == 0: + label = TexMobject("1") + else: + label = TexMobject("1/",str(2 ** self.sequence_number)) + label.scale(0.8 ** self.sequence_number) + self.add(label) + self.label = label + self.set_fill(COLORS[self.sequence_number],1) + self.set_stroke(width = 1) + self.move_to(self.center) +equation = TexMobject("\\sum_{n=0}^\\infty \\frac{1}{2^n} =","1","+","\\frac{1}{2}","+","\\frac{1}{4}","+","\\frac{1}{8}","+","\\frac{1}{16}","+ \\ldots","= 2") +class Proof1(Scene): + def construct(self): + equation.to_edge(UL) + self.play(Write(equation[0:-1])) + rects = VGroup(*[RectangleFromSequence(sequence_number = i)for i in range(25)]) + rects.arrange(RIGHT, buff=0.5) + left_center = 5*LEFT + rects.shift(left_center-rects[0].get_center()) + for rect in rects: + rect.shift(DOWN*rect.get_top()+UP*3 / 2) + for i in range(25): + rects[i].generate_target() + rects[i].target.move_to(left_center+END_CENTERS[i]) + self.wait() + for i in range(5): + self.play(GrowFromPoint(rects[i] , equation[2*i+1].get_center())) + self.play(*[GrowFromPoint(rects[i] , equation[-2].get_center())for i in range(5,25)]) + self.wait() + for i in range(1,8): + self.play(MoveToTarget(rects[i])) + self.play(*[MoveToTarget(rects[i]) for i in range(8,25)]) + self.wait(0.5) + self.play(Write(equation[-1])) + self.wait(3) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/divergence.py b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/divergence.py new file mode 100644 index 0000000..4f4bf7c --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/divergence.py @@ -0,0 +1,111 @@ +from manimlib.imports import * +class divergence(GraphScene): + CONFIG = { + "y_max" : 2, + "y_min" : -2, + "x_max" : 20, + "x_min" : 0, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color" : WHITE, + "num_graph_anchor_points": 3000, + "graph_origin" : ORIGIN+6*LEFT, + "x_labeled_nums": None, + "y_labeled_nums": [-2,-1,1,2], + "x_axis_label":r"${(-1)}^{n}$", + "y_axis_label":"$Sum$", + "x_axis_width": 10, + "y_axis_height": 4, + } + def construct(self): + XTD = self.x_axis_width/(self.x_max - self.x_min) + YTD = self.y_axis_height/(self.y_max - self.y_min) + text1 = TextMobject("Consider the series 1-1+1-1+1-1+1-......") + self.add(text1) + self.wait(3) + self.play(FadeOut(text1)) + self.setup_axes() + rangeo = (20)//self.x_axis_width + for i in range(0,2): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+0.5*RIGHT) + self.add(texta) + for i in range(2,4): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+0.65*RIGHT) + self.add(texta) + for i in range(4,6): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+0.8*RIGHT) + self.add(texta) + for i in range(6,8): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+0.95*RIGHT) + self.add(texta) + for i in range(8,10): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.1*RIGHT) + self.add(texta) + for i in range(10,12): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.35*RIGHT) + self.add(texta) + for i in range(12,14): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.5*RIGHT) + self.add(texta) + for i in range(14,16): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.65*RIGHT) + self.add(texta) + for i in range(16,18): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.8*RIGHT) + self.add(texta) + for i in range(18,20): + texta = TextMobject(str((-1)**i)).move_to(self.graph_origin+0.2*(rangeo*i)*RIGHT+0.5*DOWN+1.95*RIGHT) + self.add(texta) + + text2 = TextMobject("Number of purple lines denotes the number of terms added").move_to(1*UP).scale(0.8) + self.play(ShowCreation(text2)) + self.wait(4) + self.play(FadeOut(text2)) + for i in range(0,2): + horline = Line(np.array([-5.5+i,1,0]), np.array([-5+i,1,0]), color = PINK) + verline = DashedVMobject(Line(np.array([-5+i,1,0]), np.array([-5+i,0,0]))) + botline = Line(np.array([-6+i,0,0]), np.array([-5.5+i,0,0]), color = PINK) + upline = DashedVMobject(Line(np.array([-5.5+i,0,0]), np.array([-5.5+i,1,0]))) + self.play(ShowCreation(botline), run_time = 0.2) + self.play(ShowCreation(upline), run_time = 0.2) + self.play(ShowCreation(horline), run_time = 0.2) + self.play(ShowCreation(verline), run_time = 0.2) + + text3 = TextMobject("For even number of terms, sum is 0").move_to(1*UP).scale(0.8) + self.play(FadeIn(text3)) + self.wait(4) + self.play(FadeOut(text3)) + for i in range(2,4): + horline = Line(np.array([-5.5+i,1,0]), np.array([-5+i,1,0]), color = PINK) + verline = DashedVMobject(Line(np.array([-5+i,1,0]), np.array([-5+i,0,0]))) + botline = Line(np.array([-6+i,0,0]), np.array([-5.5+i,0,0]), color = PINK) + upline = DashedVMobject(Line(np.array([-5.5+i,0,0]), np.array([-5.5+i,1,0]))) + self.play(ShowCreation(botline), run_time = 0.2) + self.play(ShowCreation(upline), run_time = 0.2) + self.play(ShowCreation(horline), run_time = 0.2) + self.play(ShowCreation(verline), run_time = 0.2) + botline = Line(np.array([-6+4,0,0]), np.array([-5.5+4,0,0]), color = PINK) + upline = DashedVMobject(Line(np.array([-5.5+4,0,0]), np.array([-5.5+4,1,0]))) + self.play(ShowCreation(botline)) + self.play(ShowCreation(upline)) + text4 = TextMobject("For odd number of terms, sum is 1").move_to(1.5*UP).scale(0.8) + self.play(FadeIn(text4)) + self.wait(3) + for i in range(4,10): + horline = Line(np.array([-5.5+i,1,0]), np.array([-5+i,1,0]), color = PINK) + verline = DashedVMobject(Line(np.array([-5+i,1,0]), np.array([-5+i,0,0]))) + botline = Line(np.array([-6+i,0,0]), np.array([-5.5+i,0,0]), color = PINK) + upline = DashedVMobject(Line(np.array([-5.5+i,0,0]), np.array([-5.5+i,1,0]))) + self.play(ShowCreation(botline), run_time = 0.2) + self.play(ShowCreation(upline), run_time = 0.2) + self.play(ShowCreation(horline), run_time = 0.2) + self.play(ShowCreation(verline), run_time = 0.2) + text5 = TextMobject("The sum is oscillating between 1 and 0").move_to(1.5*UP).scale(0.8) + self.play(ReplacementTransform(text4, text5)) + self.wait(4) + text6 = TextMobject("It does not coerce to a particular finite value").move_to(1.5*UP).scale(0.8) + self.play(ReplacementTransform(text5, text6)) + self.wait(4) + text7 = TextMobject("Hence it diverges").move_to(1.5*UP).scale(0.8) + self.play(ReplacementTransform(text6, text7)) + self.wait(3) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/taylorseries.py b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/taylorseries.py new file mode 100644 index 0000000..2e9d423 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/taylorseries.py @@ -0,0 +1,67 @@ +from manimlib.imports import * +class conv(GraphScene): + CONFIG = { + "y_max" : 10, + "y_min" : 0, + "x_max" : 5, + "x_min" : -1, + "y_tick_frequency" : 5, + "x_tick_frequency" : 1, + "axes_color" : WHITE, + "num_graph_anchor_points": 3000, + "graph_origin" : ORIGIN+2*DOWN+6*LEFT, + "x_labeled_nums": list(range(0,6)), + "y_labeled_nums": list(range(0,11))[::1], + "x_axis_label":"x", + "y_axis_label":"$f(x)$", + "x_axis_width": 9, + "y_axis_height": 5, + } + def construct(self): + XTD = self.x_axis_width/(self.x_max - self.x_min) + YTD = self.y_axis_height/(self.y_max - self.y_min) + texta = TexMobject(r"\text{Expressing }", r"{e}^{x}", r"\text{ as its Taylor series}") + self.play(FadeIn(texta)) + self.wait(3) + self.play(FadeOut(texta)) + self.setup_axes() + graph1 = self.get_graph(lambda x : (np.e)**x, x_min = -1, x_max = 5, color = PINK) + graph2 = self.get_graph(lambda x : 1+x, x_min = -1, x_max = 5, color = GREEN_SCREEN) + graph3 = self.get_graph(lambda x : 1+(x)+(x**2)/2, x_min = -1, x_max = 5, color = GREEN_SCREEN) + graph4 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6, x_min = -1, x_max = 5, color = GREEN_SCREEN) + graph5 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6+(x**4)/24, x_min = -1, x_max = 5, color = GREEN_SCREEN) + graph6 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6+(x**4)/24+(x**5)/120, x_min = -1, x_max = 5, color = GREEN_SCREEN) + graph7 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6+(x**4)/24+(x**5)/120+(x**6)/720, x_min = -1, x_max = 5, color = GREEN_SCREEN) + graph8 = self.get_graph(lambda x : 1+(x)+(x**2)/2+(x**3)/6+(x**4)/24+(x**5)/120+(x**6)/720+(x**7)/5040, x_min = -1, x_max = 5, color = GREEN_SCREEN) + texta = TexMobject(r"{e}^{x}").move_to(self.graph_origin+ 1*RIGHT+2*UP) + textb = TexMobject(r"\therefore {e}^{x}=").move_to(3.5*LEFT+0.5*DOWN) + text1 = TexMobject(r"1+x").move_to(4*RIGHT) + text2 = TexMobject(r"+\frac{{x}^{2}}{2!}").move_to(4*RIGHT) + text3 = TexMobject(r"+\frac{{x}^{3}}{3!}").move_to(4*RIGHT) + text4 = TexMobject(r"+\frac{{x}^{4}}{4!}").move_to(4*RIGHT) + text5 = TexMobject(r"+\frac{{x}^{5}}{5!}").move_to(4*RIGHT) + text6 = TexMobject(r"+\frac{{x}^{6}}{6!}").move_to(4*RIGHT) + text7 = TexMobject(r"+\frac{{x}^{7}}{7!}+...").move_to(4.5*RIGHT) + + self.play(ShowCreation(texta)) + self.play(ShowCreation(graph1)) + self.wait(3) + self.play(FadeOut(texta)) + self.play(ShowCreation(graph2)) + self.play(ShowCreation(text1)) + self.wait(3) + self.play(ReplacementTransform(graph2, graph3), ApplyMethod(text1.shift, 1*LEFT), ShowCreation(text2)) + self.wait(3) + self.play(ReplacementTransform(graph3, graph4), ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ShowCreation(text3)) + self.wait(3) + self.play(ReplacementTransform(graph4, graph5), ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ApplyMethod(text3.shift, 1*LEFT), ShowCreation(text4)) + self.wait(3) + self.play(ReplacementTransform(graph5, graph6), ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ApplyMethod(text3.shift, 1*LEFT), ApplyMethod(text4.shift, 1*LEFT), ShowCreation(text5)) + self.wait(3) + self.play(ReplacementTransform(graph6, graph7), ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ApplyMethod(text3.shift, 1*LEFT), ApplyMethod(text4.shift, 1*LEFT), ApplyMethod(text5.shift, 1*LEFT), ShowCreation(text6)) + self.wait(3) + self.play(ReplacementTransform(graph7, graph8),ApplyMethod(text1.shift, 1*LEFT), ApplyMethod(text2.shift, 1*LEFT), ApplyMethod(text3.shift, 1*LEFT), ApplyMethod(text4.shift, 1*LEFT), ApplyMethod(text5.shift, 1*LEFT), ApplyMethod(text6.shift, 1*LEFT), ShowCreation(text7)) + self.wait(3) + grp = VGroup(text1, text2, text3, text4, text5, text6, text7) + self.play(ApplyMethod(grp.shift, 0.5*DOWN), FadeIn(textb)) + self.wait(5) \ No newline at end of file diff --git a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md index a9ad0bb..de6df0f 100644 --- a/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md +++ b/FSF-2020/calculus/intro-to-calculus/riemann-integrals/README.md @@ -10,8 +10,8 @@ rierect3.gif ![rierect3](https://user-images.githubusercontent.com/61246381/87141949-6e1b9700-c2c1-11ea-9433-4f6be752aa55.gif) -RiemannRectanglesAnimation. -![RiemannRectanglesAnimation](https://user-images.githubusercontent.com/61246381/87142531-4a0c8580-c2c2-11ea-8f5e-9e854eae6eec.gif) +RiemannRectanglesAnimation.gif +![RiemannRectanglesAnimation](https://user-images.githubusercontent.com/61246381/87952202-2c5fcd00-cac7-11ea-8b14-a0c522886714.gif) mimi.gif -- cgit From dd30e0c7fec736b8a9713848612559cc2f0a2c1c Mon Sep 17 00:00:00 2001 From: stayaryan Date: Tue, 21 Jul 2020 00:14:39 +0530 Subject: update2 --- .../fundamental-theorem-of-calculus/README.md | 3 +++ .../calculus/intro-to-calculus/gabriels-horn/README.md | 8 ++++++++ .../infinite-seq-and-series/README.md | 8 ++++++++ .../intro-to-calculus/intro-to-derivative/README.md | 8 ++++++++ FSF-2020/calculus/intro-to-calculus/limit/README.md | 18 ++++++++++++++++++ 5 files changed, 45 insertions(+) create mode 100644 FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/README.md create mode 100644 FSF-2020/calculus/intro-to-calculus/gabriels-horn/README.md create mode 100644 FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/README.md create mode 100644 FSF-2020/calculus/intro-to-calculus/intro-to-derivative/README.md create mode 100644 FSF-2020/calculus/intro-to-calculus/limit/README.md diff --git a/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/README.md b/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/README.md new file mode 100644 index 0000000..c77d886 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/fundamental-theorem-of-calculus/README.md @@ -0,0 +1,3 @@ +funda1 +![funda1](https://user-images.githubusercontent.com/61246381/87968966-e31b7780-cade-11ea-8b94-361460261a21.gif) + diff --git a/FSF-2020/calculus/intro-to-calculus/gabriels-horn/README.md b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/README.md new file mode 100644 index 0000000..ed548cb --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/gabriels-horn/README.md @@ -0,0 +1,8 @@ +horn +![horn](https://user-images.githubusercontent.com/61246381/87972654-e9145700-cae4-11ea-80d8-06fde63b2a41.gif) + +volume +![volume](https://user-images.githubusercontent.com/61246381/87972967-722b8e00-cae5-11ea-86eb-99ef7acd21b3.gif) + +surface area +![surface](https://user-images.githubusercontent.com/61246381/87970986-4064f800-cae2-11ea-89b0-632864285e4b.gif) diff --git a/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/README.md b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/README.md new file mode 100644 index 0000000..1a735f9 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/infinite-seq-and-series/README.md @@ -0,0 +1,8 @@ +convergence +![convergence](https://user-images.githubusercontent.com/61246381/87969916-9cc71800-cae0-11ea-8792-fd44b5823279.gif) + +divergence +![divergence](https://user-images.githubusercontent.com/61246381/87970033-cbdd8980-cae0-11ea-9ba6-47f48898dab2.gif) + +taylor series +![taylor](https://user-images.githubusercontent.com/61246381/87970112-e9125800-cae0-11ea-9a19-edcaaf91d7b6.gif) diff --git a/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/README.md b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/README.md new file mode 100644 index 0000000..294f716 --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/intro-to-derivative/README.md @@ -0,0 +1,8 @@ +derivative1 +![derivative1](https://user-images.githubusercontent.com/61246381/87973783-aeabb980-cae6-11ea-8b7a-e0dd089ebf09.gif) + +derivative2 +![derivative2](https://user-images.githubusercontent.com/61246381/87973861-c5eaa700-cae6-11ea-87e7-4915d68ab04f.gif) + +derivative3 +![derivative3](https://user-images.githubusercontent.com/61246381/87973900-d69b1d00-cae6-11ea-9459-c51564dbc35d.gif) diff --git a/FSF-2020/calculus/intro-to-calculus/limit/README.md b/FSF-2020/calculus/intro-to-calculus/limit/README.md new file mode 100644 index 0000000..d56950e --- /dev/null +++ b/FSF-2020/calculus/intro-to-calculus/limit/README.md @@ -0,0 +1,18 @@ +Test1 +![Test1](https://user-images.githubusercontent.com/61246381/87964777-57065180-cad8-11ea-8938-8758481ea38f.gif) + +Test2 +![Test2](https://user-images.githubusercontent.com/61246381/87964839-6daca880-cad8-11ea-9b8e-9b60b3d162ae.gif) + +limit1 +![limit1](https://user-images.githubusercontent.com/61246381/87966913-9b472100-cadb-11ea-8d9b-ce469f8d1379.gif) + +limit3 +![limit3](https://user-images.githubusercontent.com/61246381/87967364-51ab0600-cadc-11ea-9e1e-fd89f6db8f9d.gif) + +limitfin1 +![limitfin1](https://user-images.githubusercontent.com/61246381/87964053-46091080-cad7-11ea-8bae-7affe799ffbf.gif) + +limitfin2 +![limitfin2](https://user-images.githubusercontent.com/61246381/87964169-7355be80-cad7-11ea-8682-2e8cdd403426.gif) + -- cgit