From dec03b51ad54f9a869a5db0a0bdad2f5b1d2313a Mon Sep 17 00:00:00 2001 From: stayaryan Date: Mon, 20 Jul 2020 17:38:44 +0530 Subject: pull request --- .../introderivative/derivative1.py | 55 --------------- .../introderivative/derivative2.py | 78 ---------------------- .../introderivative/derivative3.py | 57 ---------------- 3 files changed, 190 deletions(-) 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 (limited to 'FSF-2020/calculus/intro-to-calculus/introderivative') 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) -- cgit