diff options
Diffstat (limited to 'FSF-2020/calculus-of-several-variables')
83 files changed, 2149 insertions, 22 deletions
diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/README.md new file mode 100644 index 0000000..5bd9cc5 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/README.md @@ -0,0 +1,32 @@ +<h1><div align=”center”><b>SubTopic: Critical Points</b></h1></div> +<br/></br> + +<tab>file1_Critical_Point_of_a_function + +![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +<br/></br> +<br/></br> + +<tab>file2_Traces_and_Tangent + +![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) +<br/></br> +<br/></br> + +<tab>file3_Tangent_plane_at_extrema_of_a_function + +![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) +<br/></br> +<br/></br> + +<tab>file4_Types_of_critical_points + +![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) +<br/></br> +<br/></br> + +<tab>file5_f(x,y)=(y-x)(1-2x-3y) + +![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) +<br/></br> +<br/></br> diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif Binary files differnew file mode 100644 index 0000000..ca3989c --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py new file mode 100644 index 0000000..e8cb08d --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py @@ -0,0 +1,77 @@ +from manimlib.imports import* +import math as m + +#---- case 1: parial derivatives exist at critical point of the function +class firstScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #---- f(x,y) = e^(-10x^2-10y^2) + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + m.exp(-10*u**2-10*v**2) + ]),u_min = -1, u_max = 1, v_min = -1, v_max = 1, checkerboard_colors = [TEAL_E,TEAL_D,TEAL_C,TEAL_B]).fade(0.6).scale(3.5).shift([0,0,1.5]) + + l1 = Line([0,0,3.75],[0,0,0],color = '#800000') + + d = Dot([0,0,3.75],color = '#800000') #---- critical point + + d_text = TextMobject("$\\frac{\\partial f}{\\partial x}=\\frac{\\partial f}{\\partial y} = 0$").scale(0.8).to_corner(UL) + + f_text = TextMobject("Critical Point ",color = YELLOW).shift(3.4*UP).scale(0.5) + + self.set_camera_orientation(phi = 45*DEGREES, theta = 40*DEGREES) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.add_fixed_in_frame_mobjects(d_text) + self.begin_ambient_camera_rotation(rate = 0.2) + self.play(Write(surface)) + self.wait(1) + self.play(Write(l1)) + self.play(Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(3) + self.play(FadeOut(f_text),FadeOut(surface),FadeOut(axes),FadeOut(d_text),FadeOut(d),FadeOut(l1),FadeOut(label_x),FadeOut(label_y)) + + +#---- case 2: parial derivatives do not exist at critical point of the function +class secondScene(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #---- g(x,y)= |x|+|y| + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + abs(u)+abs(v) + ]),u_min = -1.5, u_max = 1.5, v_min = -1.5, v_max = 1.5, checkerboard_colors = [TEAL_E,TEAL_D,TEAL_C,TEAL_B]) + + d2 = Dot([0,0,0],color = '#800000') #---- critical point + + d2_text = TextMobject("$\\frac{\\partial f}{\\partial x}$ and/or $\\frac{\\partial f}{\\partial y}$ does not exist").scale(0.7).to_corner(UL) + + g_text = TextMobject("Critical Point",color = YELLOW).shift(1.2*RIGHT).scale(0.6) + + self.set_camera_orientation(phi = 60*DEGREES, theta = 40*DEGREES) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.add_fixed_in_frame_mobjects(d2_text) + self.begin_ambient_camera_rotation(rate = 0.2) + self.wait(1) + self.play(Write(surface2)) + self.wait(1) + self.play(Write(d2)) + self.wait(1) + self.add_fixed_in_frame_mobjects(g_text) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif Binary files differnew file mode 100644 index 0000000..84acf2e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py new file mode 100644 index 0000000..4b020e1 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py @@ -0,0 +1,88 @@ +from manimlib.imports import* +import math as m + +#---- tangent to the trace with x constant +class firstScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes().scale(1) + label_x = TextMobject("$x$").shift([5.8,-0.5,0]) + label_y = TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) + + #---- graph of f(x,y) = -x^2-y^2 + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(1.5).shift([0,0,2]).rotate(0.2) + + #---- curve(trace) along y axis + curve = ParametricSurface( + lambda u, v: np.array([ + u*0.4, + v, + -v**2 + ]),v_min =-1 , v_max =1 , u_min = -0.1, u_max = 0.1).scale(1.6).shift([0.02,0.1,2.3]).set_color("#800000").rotate(0.1) + + d = Dot(color =YELLOW).shift([-0.05,-0.2,2.3]) #---- critical point + + x_text = TextMobject("Tangent to the trace with $x$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) + + tangent_line = Line([-0.05,-1.5,2.3],[-0.05,1.5,2.3],color = '#228B22') + + self.add(axes) + self.set_camera_orientation(phi = 40 * DEGREES, theta = 55 * DEGREES) + self.begin_ambient_camera_rotation(rate = 0.1) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.add_fixed_in_frame_mobjects(x_text) + self.add(curve) + self.wait(1) + self.play(Write(tangent_line),Write(d)) + self.wait(1) + + + +#---- tangent to the trace with y constant +class secondScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes().scale(1) + label_x = TextMobject("$x$").shift([5.8,-0.5,0]) + label_y = TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) + + #---- graph of f(x,y) = -x^2-y^2 + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),u_min = -1, u_max = 1, v_min = -1, v_max = 1, checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D,PURPLE_E]).scale(1.5).shift([0,0,2]).rotate(0.2) + + #---- curve(trace) along x axis + curve = ParametricSurface( + lambda u, v: np.array([ + u, + v*0.4, + -u**2 + ]),v_min = -0.1, v_max = 0.1, u_min = -1, u_max = 1).scale(1.6).shift([0.07,0.1,2.3]).set_color("#800000") + + d = Dot(color = YELLOW).shift([0,-0.2,2.3]) #---- critical point + + tangent_line = Line(color = '#228B22').scale(1).shift([0,-0.2,2.3]).rotate(m.radians(190),LEFT) + + y_text = TextMobject("Tangent to the trace with $y$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) + + self.add(axes) + self.set_camera_orientation(phi = 40 * DEGREES, theta = 55 * DEGREES) + self.add(label_x) + self.add(label_y) + self.begin_ambient_camera_rotation(rate = 0.1) + self.play(Write(surface)) + self.add_fixed_in_frame_mobjects(y_text) + self.add(curve) + self.wait(1.5) + self.play(Write(tangent_line),Write(d)) + self.wait(0.5) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif Binary files differnew file mode 100644 index 0000000..14fb318 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py new file mode 100644 index 0000000..e674113 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py @@ -0,0 +1,73 @@ +from manimlib.imports import* + +#---- tangent plane to minima of the function +class firstScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #---- parabola: f(x,y) = x**2 + y**2 + parabola = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_E,GREEN_D,GREEN_C,GREEN_B], resolution = (20, 20)).scale(1) + + d = Dot(np.array([0,0,0]), color = '#800000') # ---- critical point + + tangent_plane = Rectangle(fill_color = '#C0C0C0', fill_opacity = 0.3).move_to(ORIGIN).fade(0.7) # ----tangent plane + + parabola_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = 45 * DEGREES) + self.begin_ambient_camera_rotation(rate = 0.2) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.add_fixed_in_frame_mobjects(parabola_text) + self.wait(1) + self.play(Write(parabola)) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(tangent_plane)) + self.wait(2) + self.play(FadeOut(parabola_text),FadeOut(parabola),FadeOut(tangent_plane),FadeOut(d),FadeOut(label_x),FadeOut(label_y),FadeOut(axes)) + + +#---- tangent plane to maxima of the function +class secondScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #----parabola: g(x,y) = -x**2-y**2 + parabola = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [BLUE_E,BLUE_D,BLUE_C,BLUE_B], resolution = (20, 20)).scale(1) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + tangent_plane = Rectangle(fill_color = '#C0C0C0',fill_opacity = 0.3).move_to(ORIGIN).fade(0.7) #---- tangent plane + + parabola_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = 45 * DEGREES) + self.begin_ambient_camera_rotation(rate = 0.2) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.add_fixed_in_frame_mobjects(parabola_text) + self.wait(1) + self.play(Write(parabola)) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(tangent_plane)) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif Binary files differnew file mode 100644 index 0000000..91e7084 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py new file mode 100644 index 0000000..656fb68 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py @@ -0,0 +1,134 @@ +from manimlib.imports import* + + +#---- Relative Maxima +class firstScene(ThreeDScene): + def construct(self): + + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #----graph of the function f(x,y) = -x**2-y**2 + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E]).scale(1.5).shift([0,0,-0.51]).fade(0.3) + + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + d = Dot(color = "#800000").shift([0,0,0]) #---- critical point + + self.set_camera_orientation(phi = 75 * DEGREES, theta = 45 * DEGREES) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.begin_ambient_camera_rotation(rate = 0.1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(surface),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(surface),FadeOut(f_text),FadeOut(d),FadeOut(label_x),FadeOut(label_y)) + + +#---- Relative Minima +class secondScene(ThreeDScene): + def construct(self): + + r2_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #----graph of the function g(x,y) = x**2+y**2 + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors =[TEAL_B,TEAL_C,TEAL_D,TEAL_E]).scale(1.5).shift([0,0,0.55]).fade(0.1) + + d = Dot(color = "#800000").shift([0,0,0]) #---- critical point + + g_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = 45 * DEGREES) + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.play(FadeOut(r2_text)) + self.begin_ambient_camera_rotation(rate = 0.1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(surface),Write(d)) + self.add_fixed_in_frame_mobjects(g_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(surface),FadeOut(g_text),FadeOut(d),FadeOut(label_x),FadeOut(label_y)) + + + +#---- Saddle Point +class thirdScene(ThreeDScene): + def construct(self): + + r3_text = TextMobject("Saddle Point", color = '#87CEFA') + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #---- graph of function h(x,y) = -x^2 + y^2 + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1,checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D,PURPLE_E]).scale(1.5).shift([0,0,0]) + + #---- curve(trace) along x axis + curve_x = ParametricSurface( + lambda u, v: np.array([ + u*0.4, + v, + v**2 + ]),v_min = -1, v_max = 1, u_min = -0.2, u_max = 0.2).shift([0,0,0.34]).scale(1.5).set_color("#800000") + + #---- curve(trace) along y axis + curve_y = ParametricSurface( + lambda u, v: np.array([ + u, + v*0.4, + -u**2 + ]),v_min = -0.2, v_max = 0.2, u_min = -1, u_max = 1).scale(1.6).shift([0,0,-0.1]).set_color("#800000") + + d = Dot(color = GREEN).shift([0,0,0.1]) #---- critical point + + h_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + self.add_fixed_in_frame_mobjects(r3_text) + self.wait(1) + self.set_camera_orientation(phi = 50 * DEGREES,theta = 45 * DEGREES) + self.play(FadeOut(r3_text)) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.begin_ambient_camera_rotation(rate = 0.3) + self.add_fixed_in_frame_mobjects(h_text) + self.play(Write(surface)) + self.wait(1) + self.add(curve_y) + self.add(d) + self.wait(1) + self.play(FadeOut(curve_y)) + self.wait(1) + self.add(curve_x) + self.wait(1) + self.add(d) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif Binary files differnew file mode 100644 index 0000000..4bc92f8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py new file mode 100644 index 0000000..41c3b61 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py @@ -0,0 +1,29 @@ +from manimlib.imports import* + +#---- visualization of the function +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #---- f(x,y) = (y-x)(1-2x-3y) + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (v-u)*(1-2*u-3*v) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D, PURPLE_E]).scale(1).fade(0.2).shift([0.2,0.2,0]) + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + + self.set_camera_orientation(phi = 60 * DEGREES, theta = 75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.1) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.wait(1) + self.play(Write(f)) + self.wait(4) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.gif Binary files differnew file mode 100644 index 0000000..1e1782e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py new file mode 100644 index 0000000..17f31ac --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py @@ -0,0 +1,53 @@ +from manimlib.imports import* + +class firstScene(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2+u**3-v**3 + ]),u_min=-0.5,u_max=0.5, v_min=-0.5,v_max=0.5).scale(5).shift([0,1,2.5]).set_color('#F0FFFF').fade(0.4) + + c = Circle().set_color('#FF00FF').shift([-0.4,0,1.5]).rotate(1.9,UP).scale(0.7) + + minima = Dot(color = '#4169E1').shift([-0.5,0.5,1]).rotate(1.571,UP) + maxima = Dot(color = '#4169E1').shift([0.1,0,2.2]).rotate(1.571,UP) + + l1 = DashedLine([-0.5,0.5,0.9],[-0.5,0.5,0],color = '#F08080') + l2 = DashedLine([0.1,0,2.1],[0.1,0,0],color = '#F08080') + + c2 = Circle(fill_opacity= 0.5).shift([-0.3,0.2,0]).scale(0.4) + + minima_refl = Dot(color = '#4682B4').shift([-0.5,0.5,0]).rotate(1.571,UP) + maxima_refl = Dot(color = '#4682B4').shift([0.1,0,0]).rotate(1.571,UP) + + max_text = TextMobject("maximum over $g(x,y)=k$",color = '#FFA074').shift([-1.7,0,0]).scale(0.5).shift(2.2*UP) + min_text = TextMobject("minimum over $g(x,y)=k$",color = '#FFA074').shift([2.5,0.5,1]).scale(0.5).shift(0.5*UP) + label_f = TextMobject("$z=f(x,y)$",color = '#8A2BE2').scale(0.5).shift(3*UP+3*RIGHT) + label_g = TextMobject("$g(x,y)=k$",color = '#8A2BE2').scale(0.5).shift(2*RIGHT) + + + self.add(axes) + self.set_camera_orientation(phi=75*DEGREES,theta=45*DEGREES) + self.play(Write(surface)) + self.add_fixed_in_frame_mobjects(label_f) + self.wait(2) + self.play(Write(c)) + self.wait(1) + self.play(Write(maxima)) + self.add_fixed_in_frame_mobjects(max_text) + self.wait(1) + self.play(Write(minima)) + self.add_fixed_in_frame_mobjects(min_text) + self.wait(1) + self.play(ShowCreation(l1),ShowCreation(l2)) + self.play(Write(c2)) + self.add_fixed_in_frame_mobjects(label_g) + self.wait(1) + self.play(Write(maxima_refl)) + self.play(Write(minima_refl)) + self.wait(1) + + diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.gif Binary files differnew file mode 100644 index 0000000..b22afb3 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.py new file mode 100644 index 0000000..4374ff7 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.py @@ -0,0 +1,68 @@ +from manimlib.imports import* + +class firstScene(ThreeDScene): + def construct(self): + axes = ThreeDAxes().scale(0.7).rotate(math.radians(180)) + surface = ParametricSurface( + lambda u, v: np.array([ + 1*np.sin(u)*np.cos(v), + 1*np.sin(u)*np.sin(v), + -1*np.sin(u)*np.sin(u)+2 + ]),u_min=0,u_max=PI/2,v_min=0,v_max=2*PI,checkerboard_colors=[GREEN_C, GREEN_E]).scale(1).shift([-1.5,-1.5,0]) + + d = Dot([-2,-2.55,0],color = '#800000') + a_df = Arrow(color = '#00FFFF').rotate(-2).shift(3.2*DOWN+2.3*LEFT) #---- f parallel to g + a_dg = Arrow(color = '#FF00FF').scale(0.8).shift(3.2*DOWN+2.3*LEFT).rotate(-2) #---- f parallel to g + + b_df = Arrow(color = '#00FFFF').rotate(1.1).shift(0.82*LEFT+0.15*UP) #---- f parallel to g + b_dg = Arrow(color = '#FF00FF').scale(0.6).rotate(-2).shift(1.43*LEFT+1.1*DOWN) #---- f parallel to g + + + qd = Dot(color = '#800000').shift(1.2*LEFT+0.6*DOWN) + + l1 = Line([-1,-3.1,0],[-4,-3.1,0],color = PINK).rotate(-0.3).fade(0.6) + l2 = Line([-0.9,-2.9,0],[-4,-2.9,0],color = PINK).rotate(-0.3).fade(0.6) + l3= Line([-0.8,-2.7,0],[-4,-2.7,0],color = PINK).rotate(-0.3).fade(0.6) + l4= Line([-0.7,-2.45,0],[-4,-2.45,0],color = PINK).rotate(-0.3).fade(0.6) + l5= Line([-0.6,-2.2,0],[-4,-2.25,0],color = PINK).rotate(-0.3).fade(0.6) + l6 = Line([-0.5,-2,0],[-4,-2,0],color = PINK).rotate(-0.3).fade(0.6) + l7 = Line([-0.4,-1.8,0],[-4,-1.8,0],color = PINK).rotate(-0.3).fade(0.6) + l8 = Line([-0.3,-1.6,0],[-4,-1.6,0],color = PINK).rotate(-0.3).fade(0.6) + l9= Line([-0.2,-1.4,0],[-4,-1.4,0],color = PINK).rotate(-0.3).fade(0.6) + l10= Line([-0.1,-1.2,0],[-4,-1.2,0],color = PINK).rotate(-0.3).fade(0.6) + l11 = Line([-0,-1,0],[-4,-1,0],color = PINK).rotate(-0.3).fade(0.6) + l12 = Line([-0,-0.8,0],[-4,-0.8,0],color = PINK).rotate(-0.3).fade(0.6) + l13= Line([-0,-0.55,0],[-4,-0.55,0],color = PINK).rotate(-0.3).fade(0.6) + l14= Line([-0,-0.35,0],[-4,-0.35,0],color = PINK).rotate(-0.3).fade(0.6) + l15= Line([-0.,-0.15,0],[-4,-0.15,0],color = PINK).rotate(-0.3).fade(0.6) + + level_Curve = VGroup(l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14,l15) + + rel_text = TextMobject("$\\nabla f = \\lambda \\nabla g$",color = TEAL).shift([3,3.2,0]).scale(0.5) + + f_text = TextMobject("$\\nabla f$",color = '#800000').shift([1,1,0]).scale(0.5) + g_text = TextMobject("$\\nabla g$").shift([1.2,-0.8,0]).scale(0.5) + + p_text= TextMobject("$P$").shift([1.8,2.6,0]).scale(0.5) + + + + self.add(axes) + self.set_camera_orientation(phi=0 * DEGREES, theta = 90*DEGREES) + self.play(Write(surface)) + self.wait(1) + self.play(ShowCreation(level_Curve)) + self.wait(1) + self.play(ShowCreation(a_df),ShowCreation(a_dg),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(rel_text) + self.add_fixed_in_frame_mobjects(p_text) + self.wait(1) + self.play(Write(qd)) + self.wait(1) + self.play(ShowCreation(b_df)) + self.play(ShowCreation(b_dg)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f_text) + self.add_fixed_in_frame_mobjects(g_text) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.gif Binary files differnew file mode 100644 index 0000000..9602283 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.py new file mode 100644 index 0000000..bf75dd8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.py @@ -0,0 +1,29 @@ +from manimlib.imports import* + +class firstScene(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + cylinder = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2 * (u) + ]),checkerboard_colors=[YELLOW_C,YELLOW_D,YELLOW_E] + ).fade(0.4) #Resolution of the surfaces + + plane = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u+v + ]),checkerboard_colors=[TEAL_C,TEAL_D,TEAL_E] + ).scale(2.5) + self.add(axes) + self.set_camera_orientation(phi=75*DEGREES,theta=45*DEGREES) + self.play(Write(cylinder)) + self.play(Write(plane)) + self.wait(1) + self.begin_ambient_camera_rotation(rate=0.7) + self.wait(5) + self.move_camera(phi=35*DEGREES,theta=-45*DEGREES) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif Binary files differnew file mode 100644 index 0000000..2b8bf5f --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py new file mode 100644 index 0000000..4c17f90 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py @@ -0,0 +1,50 @@ +from manimlib.imports import* + +#---- tangent plane is parallel to the surface of the funtion at a point +class firstScene(ThreeDScene): + def construct(self): + + s1_text=TextMobject("Suppose, the point $(x,y)$ lies on the surface of the function.").scale(0.5).shift(2*UP) + s2_text=TextMobject("When zooming on that point, the surface would appear more and more like a plane.").scale(0.5).shift(1*UP) + s3_text=TextMobject("This plane is called the tangent plane.").scale(0.5) + + #---- graph of function f(x,y) = -x^2-y^2 + + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E]).shift([0,0,0]).scale(1) + + + d = Dot([0,0,0],color = '#800000') #---- critical point + + r = Rectangle(color = PURPLE,fill_opacity=0.2).shift([0.1,0,0]).scale(0.3) #---- tangent plane + + s = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E]).shift([0,0,0]).scale(3.5) + + d2 = Dot([0,0,2.5],color = '#800000') #---- changing position of critical point + + r2 = Rectangle(color = PURPLE,fill_opacity=0.5).shift([0.1,0,2.5]).scale(0.3) #---- changing position of tangent plane + + self.set_camera_orientation(phi = 50 * DEGREES, theta = 45 * DEGREES) + self.add_fixed_in_frame_mobjects(s1_text) + self.add_fixed_in_frame_mobjects(s2_text) + self.add_fixed_in_frame_mobjects(s3_text) + self.wait(2) + self.play(FadeOut(s1_text)) + self.play(FadeOut(s2_text)) + self.play(FadeOut(s3_text)) + self.wait(1) + self.play(Write(f)) + self.play(Write(d)) + self.play(Write(r)) + self.wait(2) + self.play(ReplacementTransform(f,s),ReplacementTransform(d,d2),ReplacementTransform(r,r2)) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.gif Binary files differnew file mode 100644 index 0000000..d23405d --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py new file mode 100644 index 0000000..d1ecf8c --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py @@ -0,0 +1,74 @@ +from manimlib.imports import* + +#---- tangent plane is parallel to the x-y plane +class MaximaScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes().scale(1.2) + label_x= TextMobject("$x$").shift([5.4,-0.5,0]) #---- x axis + label_y= TextMobject("$y$").shift([-0.5,5.2,0]).rotate(-4.5) #---- y axis + + #---- graph of the function + s = ParametricSurface( + lambda u, v: np.array([ + 1.5*np.cos(u)*np.cos(v), + 1.5*np.cos(u)*np.sin(v), + 1.5*np.sin(u) + ]),u_min=0,u_max=PI,v_min=PI,v_max=2*PI,checkerboard_colors=[BLUE_B,BLUE_C,BLUE_D,BLUE_E]).scale(1.5).shift([-0.8,0.5,1.5]) + + d1 = Dot([0.2,2.01,2.24],color = '#800000').rotate(1.1,LEFT) #---- point(x_0,y_0) + d1_copy = Dot([1.1,2.2,-0.45],color = '#800000') #---- projection of point(x_0,y_0) on x-y plane + d1_text = TextMobject("$(x_0,y_0)$",color = "#8B0000").scale(0.4).shift(1.3*RIGHT+1.1*UP) + + d2 = Dot([1.1,2.2,2.7],color = '#800000').rotate(1,LEFT) #---- point(x,y) + d2_copy = Dot([0.1,1.95,0.4],color = '#800000') #---- projection of point(x,y) on x-y plane + d2_text = TextMobject("$(x,y)$",color = "#8B0000").scale(0.4).shift(0.6*RIGHT+0.8*UP) + + t_plane = Rectangle(color = PURPLE, fill_opacity=0.3).scale(0.4).rotate(1,LEFT).shift([1.1,2.5,2.9]) #---- tangent plane + + t_text= TextMobject("Tangent Plane",color = RED).scale(0.5).shift(0.3*RIGHT+1.3*UP).rotate(math.radians(5),LEFT) + + l1 = Line([1.1,2.2,2.6],[1.1,2.2,-0.45]).fade(0.2) + l2 = Line([0.1,1.95,2.05],[0.1,1.95,0.4]).fade(0.2) + + a1 = Line([0.1,1.95,0.4],[1.1,2.2,-0.45],color ="#00FF7F") + a_x = Line([0.1,1.95,0.4],[1.7,1.95,0.4],color ="#9400D3") + a_y = Line([0.1,1.95,0.4],[0.1,2.75,0.4],color ="#8B4513") + a2 = Line([1.7,1.95,0.4],[1.7,2.75,0.4]) + a3 = Line([0.1,2.75,0.4],[1.7,2.75,0.4]) + + #---- transition of tangent plane + + t2_plane = Rectangle(color = PURPLE, fill_opacity=0.3).scale(0.4).rotate(1,LEFT).shift([1.1,2.5,2]) + t3_plane = Rectangle(color = PURPLE, fill_opacity=0.3).scale(0.4).rotate(math.radians(180),LEFT).shift([1.1,2.5,2]) + t4_plane = Rectangle(color = PURPLE, fill_opacity=0.3).scale(0.4).rotate(math.radians(180),LEFT).shift([0.9,2.35,0.4]) + + #------------------------------------------- + self.set_camera_orientation(phi = 50 * DEGREES, theta = 45 * DEGREES) + self.wait(1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(s)) + self.wait(1) + self.play(Write(d1)) + self.add_fixed_in_frame_mobjects(d1_text) + self.play(ShowCreation(t_plane)) + self.add_fixed_in_frame_mobjects(t_text) + self.wait(1) + self.play(FadeOut(t_text),Write(d2)) + self.add_fixed_in_frame_mobjects(d2_text) + self.wait(1) + self.play(Write(l1),Write(l2)) + self.play(Write(d2_copy),Write(d1_copy)) + self.wait(1) + self.play(Write(a1),Write(a_x),Write(a_y)) + self.wait(1) + self.play(Write(a2),Write(a3)) + self.wait(1) + self.play(ReplacementTransform(t_plane,t2_plane)) + self.wait(1) + self.play(ReplacementTransform(t2_plane,t3_plane)) + self.wait(1) + self.play(ReplacementTransform(t3_plane,t4_plane)) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_Non_Differentiable_Function.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_Non_Differentiable_Function.gif Binary files differnew file mode 100644 index 0000000..7581a33 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_Non_Differentiable_Function.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_Non_Differentiable_Function.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_Non_Differentiable_Function.py new file mode 100644 index 0000000..79d0948 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_Non_Differentiable_Function.py @@ -0,0 +1,47 @@ +from manimlib.imports import* +import math + +#---- tangent plane does not exists for f(x,y): sqrt(x**2+y**2) at origin + +class TangenttoSurface(ThreeDScene): + def construct(self): + axes = ThreeDAxes().rotate(2.3) + axes2 = ThreeDAxes().scale(2).rotate(2.3).shift([0,0,1.3]) + + #----f(x,y): sqrt(x**2+y**2) + p = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -math.sqrt(u**2+v**2) + ]),v_min = -1,v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_C,TEAL_D], + resolution = (20, 20)).scale(1) + + #----size increased of f(x,y): sqrt(x**2+y**2) + p2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -math.sqrt(u**2+v**2) + ]),v_min = -1,v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_C,TEAL_D], + resolution = (20, 20)).scale(3).shift([0,0,0]) + + self.set_camera_orientation(phi = 75 * DEGREES,theta = 40*DEGREES) + + d = Dot([0,0,0],color = '#800000') #---- critical point + d2 = Dot([0,0,1.5],color = '#800000').scale(2) #---- size increased of critical point + + f_text = TextMobject("$f$ is not differentiable at origin,because the surface").scale(0.5).to_corner(UL) + f2_text = TextMobject("is not flat when zoomed in at the origin.").scale(0.5).to_corner(UL).shift(0.5*DOWN) + + self.add(axes) + self.wait(1) + self.play(Write(p),Write(d)) + self.wait(1) + self.move_camera(phi = 50 * DEGREES,theta = 40*DEGREES) + self.wait(1) + self.play(ReplacementTransform(axes,axes2),ReplacementTransform(p,p2),ReplacementTransform(d,d2)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f_text) + self.add_fixed_in_frame_mobjects(f2_text) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_extrema_and_saddle_point.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_extrema_and_saddle_point.gif Binary files differnew file mode 100644 index 0000000..cfe054b --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_extrema_and_saddle_point.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent_plane_at_extrema_and_saddle_point.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent_plane_at_extrema_and_saddle_point.py new file mode 100644 index 0000000..d129213 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent_plane_at_extrema_and_saddle_point.py @@ -0,0 +1,62 @@ +from manimlib.imports import* + +class TangenttoSurface(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + #----graph of first function f(x,y) = -x**2-y**2 + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_D, YELLOW_E], + resolution = (20, 20)).scale(1) + f_text = TextMobject("Tangent plane at relative maxima").to_corner(UL).scale(0.5) + + #----graph of second function f(x,y) = -x**2+y**2 + f2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_D, RED_E], + resolution = (20, 20)).scale(1) + f2_text = TextMobject("Tangent plane at saddle point").to_corner(UL).scale(0.5) + + #----graph of third function f(x,y) = x**2+y**2 + f3 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_D, GREEN_E], + resolution = (20, 20)).scale(1) + f3_text = TextMobject("Tangent plane at relative minima").to_corner(UL).scale(0.5) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + r = Rectangle(height = 2,breadth = 1,color = PURPLE).scale(0.5) + + self.begin_ambient_camera_rotation(rate = 0.3) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f_text) + self.play(ShowCreation(r)) + self.wait(1) + self.play(FadeOut(r),FadeOut(f),FadeOut(d),FadeOut(f_text)) + self.wait(1) + self.play(Write(f2),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f2_text) + self.play(ShowCreation(r)) + self.wait(1) + self.play(FadeOut(r),FadeOut(f2),FadeOut(d),FadeOut(f2_text)) + self.wait(1) + self.play(Write(f3),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f3_text) + self.play(ShowCreation(r)) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif Binary files differnew file mode 100644 index 0000000..3471e4d --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py new file mode 100644 index 0000000..84052cc --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py @@ -0,0 +1,78 @@ +from manimlib.imports import* + +#---- graphs of second-order partial derivatives of a function +class SurfacesAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + x_label = TextMobject('$x$').shift([5,0.5,0]) #---- x axis + y_label = TextMobject('$y$').shift([0.5,4,0]).rotate(-4.5) #---- y axis + + #---- surface of function: f(x,y) = (x^2+y^2)^2 + surface_f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + ((u**2)+(v**2))**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[GREEN_D, GREEN_E]).scale(1) + + #---- surface of second-order partial derivative f_xx + surface_fxx = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (3*u**2)+(v**2) + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[YELLOW_D, YELLOW_E]).shift([0,0,0]).scale(0.6) + + #---- surface of second-order partial derivative f_yy + surface_fyy = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (u**2)+(3*v**2) + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[PURPLE_D, PURPLE_E]).scale(0.6).shift([0,0,0]) + + #---- surface of second-order partial derivative f_xy = f_yx + surface_fxy = ParametricSurface( + lambda u, v: np.array([ + u, + v, + 8*u*v + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_D, TEAL_E]).scale(0.6) + + f_text= TextMobject("$f(x,y) = (x^2+y^2)^2$",color = GREEN).scale(0.7).to_corner(UL) + + fxx_text= TextMobject("$f_{xx} = 12x^2+4y^2$ (Concavity along x axis)",color = YELLOW).scale(0.5).to_corner(UL) + + fyy_text= TextMobject("$f_{yy} = 4x^2+12y^2$(Concavity along y axis)",color = PURPLE).scale(0.5).to_corner(UL) + + fxy_text= TextMobject("$f_{xy} = f_{yx} = 8xy$ (Twisting of the function)",color = TEAL).scale(0.5).to_corner(UL) + + + self.set_camera_orientation(phi = 40 * DEGREES, theta = 45 * DEGREES) + self.begin_ambient_camera_rotation(rate = 0.1) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.add(x_label) + self.add(y_label) + self.wait(1) + self.play(Write(surface_f)) + self.wait(2) + self.play(FadeOut(f_text)) + + + self.play(ReplacementTransform(surface_f,surface_fxx)) + + self.add_fixed_in_frame_mobjects(fxx_text) + self.wait(2) + self.play(FadeOut(fxx_text)) + + self.play(ReplacementTransform(surface_fxx,surface_fyy)) + self.add_fixed_in_frame_mobjects(fyy_text) + self.wait(2) + self.play(FadeOut(fyy_text)) + + self.play(ReplacementTransform(surface_fyy,surface_fxy)) + self.move_camera(phi = 35 * DEGREES, theta = 80 * DEGREES) + self.add_fixed_in_frame_mobjects(fxy_text) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.gif Binary files differnew file mode 100644 index 0000000..d49cdd5 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py new file mode 100644 index 0000000..c1e3516 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py @@ -0,0 +1,52 @@ +from manimlib.imports import* + +class firstscene(Scene): + def construct(self): + + h_text = TextMobject("Degenerate Hessian Matrix", color = RED).scale(1).shift(UP) + + + f_text = TextMobject("$f(x,y) = 2x^3+y^3$", color = TEAL).scale(1).to_corner(UL) + c_text = TextMobject("Critical Point: $(0,0)$", color = TEAL).scale(1).next_to(f_text).shift(DOWN+4.3*LEFT) + m_text = TextMobject("\\begin{equation*} D_2(x,y)= \\begin{vmatrix} 12x\\space & 0\\space \\\\ 0 & 6y \\end{vmatrix} \\end{equation*}",color = YELLOW) + d_text = TextMobject("\\begin{equation*} D_2(0,0)= \\begin{vmatrix} 0 \\space & 0\\space \\\\ 0 & 0 \\end{vmatrix} \\end{equation*}",color = PURPLE) + + + t_text = TextMobject("$D_2 = 0$(Inconclusive)", color = TEAL).scale(1).shift(2*DOWN) + + self.play(ShowCreation(h_text)) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.play(ShowCreation(f_text)) + self.wait(1) + self.play(ShowCreation(c_text)) + self.wait(1) + self.play(ShowCreation(m_text)) + self.wait(2) + self.play(ReplacementTransform(m_text,d_text)) + self.wait(1) + self.play(ShowCreation(t_text)) + self.wait(2) + + +class SecondScene(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (2*u**3)+v**3 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_C,YELLOW_D,BLUE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=25 * DEGREES,theta = 80*DEGREES) + self.begin_ambient_camera_rotation(rate=0.1) + + f_text = TextMobject("$f(x,y) = 2x^3+y^3$",color = ORANGE).shift(2*DOWN+2*RIGHT).scale(0.8) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.play(Write(f)) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.gif Binary files differnew file mode 100644 index 0000000..2b0acb3 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py new file mode 100644 index 0000000..3056842 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py @@ -0,0 +1,145 @@ +from manimlib.imports import* + +class firstScene(Scene): + def construct(self): + + e_text = TextMobject("Case 3: One positive and one negative eigenvalue", color = YELLOW).scale(1).shift(3*UP+1*LEFT) + f_text = TextMobject("$f(x,y) = x^2-2y^2-2x$").scale(0.8).next_to(e_text).shift(6*LEFT+DOWN) + c_text = TextMobject("Critical Point: $(1,0)$").scale(0.8).next_to(f_text).shift(DOWN+4*LEFT) + d_text = TextMobject("\\begin{equation*} D_2(1,0)= \\begin{vmatrix} 2 \\space & 0\\space \\\\ 0 & -4 \\end{vmatrix} \\end{equation*}",color = GREEN).scale(0.9) + + t_text = TextMobject("$D_2 = -8<0$ (Saddle Point)", color = BLUE).scale(0.9).shift(2*DOWN) + + self.play(ShowCreation(e_text)) + self.wait(1) + self.play(ShowCreation(f_text)) + self.wait(1) + self.play(ShowCreation(c_text)) + self.wait(1) + self.play(ShowCreation(d_text)) + self.wait(1) + self.play(ShowCreation(t_text)) + self.wait(2) + +class SaddlePoint(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2-2*v**2-2*u + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[RED_C,PURPLE_D,YELLOW_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=35 * DEGREES,theta=80*DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + f_text = TextMobject("$f(x,y) = x^2-2y^2-2x$",color = GREEN).shift(2*DOWN+2*RIGHT).scale(0.8) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.play(Write(f)) + self.wait(3) + + +class secondScene(Scene): + def construct(self): + + h_text = TextMobject("NonDegenerate Hessian Matrix", color = GREEN).scale(1).shift(UP) + e_text = TextMobject("Case 1: Two positive eigenvalues", color = PINK).scale(1).shift(3*UP+2*LEFT) + f_text = TextMobject("$f(x,y) = 2x^2+3y^2-2yx$",color = TEAL).scale(0.8).next_to(e_text).shift(6*LEFT+DOWN) + c_text = TextMobject("Critical Point: $(0,0)$",color = TEAL).scale(0.8).next_to(f_text).shift(DOWN+4.5*LEFT) + d_text = TextMobject("\\begin{equation*} D_2(0,0)= \\begin{vmatrix} 4 \\space & -2\\space \\\\ -2 & 6 \\end{vmatrix} \\end{equation*}",color = PINK).scale(0.9) + + t_text = TextMobject("$D_2 = 20>0$ (Relative Maxima or Relative Minima)", color = YELLOW).scale(0.9).shift(1*DOWN) + tm_text = TextMobject("$D_1 = \\frac{\\partial^2 f}{\\partial x^2} =4 >0$ (Relative Minima)", color = YELLOW).scale(0.9).shift(2*DOWN) + + + self.play(ShowCreation(h_text)) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.play(ShowCreation(e_text)) + self.wait(1) + self.play(ShowCreation(f_text)) + self.wait(1) + self.play(ShowCreation(c_text)) + self.wait(1) + self.play(ShowCreation(d_text)) + self.wait(1) + self.play(ShowCreation(t_text)) + self.wait(1) + self.play(ShowCreation(tm_text)) + self.wait(2) + self.play(FadeOut(e_text),FadeOut(f_text),FadeOut(c_text),FadeOut(d_text),FadeOut(t_text),FadeOut(tm_text)) + +class Minima(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + 2*u**2+3*v**2-2*v*u + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[BLUE_C,YELLOW_D,GREEN_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=10 * DEGREES,theta=90*DEGREES) + self.begin_ambient_camera_rotation(rate=0.2) + + f_text = TextMobject("$f(x,y) = 2x^2+3y^2-2yx$",color = PURPLE).shift(2*DOWN+3*RIGHT).scale(0.8) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.play(Write(f)) + self.wait(2) + + +class thirdScene(Scene): + def construct(self): + + + e_text = TextMobject("Case 2: Two negative eigenvalues", color = RED).scale(1).shift(3*UP+2*LEFT) + f_text = TextMobject("$f(x,y) = -x^2-4y^2$",color = BLUE).scale(0.8).next_to(e_text).shift(6*LEFT+DOWN) + c_text = TextMobject("Critical Point: $(0,0)$",color = BLUE).scale(0.8).next_to(f_text).shift(DOWN+3.8*LEFT) + d_text = TextMobject("\\begin{equation*} D_2(0,0)= \\begin{vmatrix} -2 \\space & 0\\space \\\\ 0 & -8 \\end{vmatrix} \\end{equation*}",color = TEAL).scale(0.9) + + t_text = TextMobject("$D_2 = 16>0$ (Relative Maxima or Relative Minima)" ).scale(0.9).shift(1*DOWN) + tm_text = TextMobject("$D_1 = \\frac{\\partial^2 f}{\\partial x^2} =-2 <0$ (Relative Maxima)").scale(0.9).shift(2*DOWN) + + + self.play(ShowCreation(e_text)) + self.wait(1) + self.play(ShowCreation(f_text)) + self.wait(1) + self.play(ShowCreation(c_text)) + self.wait(1) + self.play(ShowCreation(d_text)) + self.wait(1) + self.play(ShowCreation(t_text)) + self.wait(1) + self.play(ShowCreation(tm_text)) + self.wait(2) + self.play(FadeOut(e_text),FadeOut(f_text),FadeOut(c_text),FadeOut(d_text),FadeOut(t_text),FadeOut(tm_text)) + + +class Maxima(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-4*v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[BLUE_C,PURPLE_D,TEAL_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + f_text = TextMobject("$f(x,y) = -x^2-4y^2$",color = YELLOW).shift(2*DOWN+3*RIGHT).scale(0.8) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.play(Write(f)) + self.wait(1) + self.move_camera(phi=30*DEGREES,theta=45*DEGREES,run_time=5) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif Binary files differnew file mode 100644 index 0000000..129fedc --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py new file mode 100644 index 0000000..d3084e2 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py @@ -0,0 +1,120 @@ +from manimlib.imports import* + +#---- contour diagram animation +class ContourDiagram(ThreeDScene): + def construct(self): + + heading = TextMobject("CONTOUR DIAGRAM", color = YELLOW).scale(1) + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #---- surface of a paraboloid + surface = ParametricSurface( + lambda u, v: np.array([ + np.cos(v)*u, + np.sin(v)*u, + u**2 + ]),v_min = -2, v_max = 2, u_min = -2, u_max = 2, checkerboard_colors = [GREEN_B,GREEN_C,GREEN_D,GREEN_E]).shift([0,0,0]).scale(0.5) + + #---- first contour projection + contour1 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 2.5*u) + ])).fade(0.5).scale(0.21).shift([0,0,1.01]) + + #---- first contour line + c_1 = Circle(color = BLUE).scale(0.21).shift([0,0,0]).rotate(0.1,DOWN) + + #------------------------------------------------- + + #---- second contour projection + contour2 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 1.6*u) + ])).fade(0.5).scale(0.41).shift([0,0,0.3]).set_color(RED) + + #---- second contour line + c_2 = Circle(color = RED).scale(0.41).shift([0,0,0]).rotate(0.1,DOWN) + + #------------------------------------------------- + + #---- third contour projection + contour3 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 1.5*u) + ])).fade(0.5).scale(0.61).shift([0,0,0.4]).set_color(YELLOW) + + #---- third contour line + c_3 = Circle(color = YELLOW).scale(0.61).shift([0,0,0]) + + #------------------------------------------------- + + #---- fourth contour projection + contour4 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 1.5*u) + ])).fade(0.7).scale(0.81).shift([0,0,0.7]).set_color(PINK) + + #---- fourth contour line + c_4 = Circle(color = PINK).scale(0.81).shift([0,0,0]) + + #------------------------------------------------- + + #---- fifth contour projection + contour5 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 1.5*u) + ])).fade(0.7).scale(1.01).shift([0,0,1]).set_color(PURPLE) + + #---- fifth contour line + c_5 = Circle(color = PURPLE).scale(1.01).shift([0,0,0]) + + c_text= TextMobject("Contour Lines").scale(0.5).shift(2*DOWN) + s = Square().scale(1.3) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = 10 * DEGREES) + self.add_fixed_in_frame_mobjects(heading) + self.wait(1) + self.play(FadeOut(heading)) + self.wait(1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.wait(1) + self.add(contour1) + self.wait(1) + self.play(Write(c_1)) + self.play(ReplacementTransform(contour1,contour2)) + self.wait(1) + self.play(Write(c_2)) + self.play(ReplacementTransform(contour2,contour3)) + self.wait(1) + self.play(Write(c_3)) + self.play(ReplacementTransform(contour3,contour4)) + self.wait(1) + self.play(Write(c_4)) + self.play(ReplacementTransform(contour4,contour5)) + self.wait(1) + self.play(Write(c_5)) + self.wait(1) + self.play(FadeOut(contour5),FadeOut(axes),FadeOut(label_x),FadeOut(label_y),FadeOut(surface),FadeOut(contour5),FadeOut(contour4),FadeOut(contour3),FadeOut(contour2),FadeOut(contour1)) + self.wait(1) + self.move_camera(phi=0 * DEGREES,theta= 90*DEGREES) + self.wait(1) + self.add_fixed_in_frame_mobjects(c_text) + self.wait(1) + self.play(ShowCreation(s),FadeOut(c_text)) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif Binary files differnew file mode 100644 index 0000000..e00a946 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.py new file mode 100644 index 0000000..a097a96 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.py @@ -0,0 +1,53 @@ +from manimlib.imports import* + + +class firstScene(ThreeDScene): + + def construct(self): + + axes = ThreeDAxes().rotate(1.571) + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),u_min=-1,u_max=1, v_min=-1,v_max=1).set_color("#FF69B4").fade(0.6).scale(2).shift(3*UP+1*LEFT) + + d = Dot([1.4,1.75,1],color = '#00FFFF').rotate(1.571,UP) + d2 = Dot([2,2,1],color = '#00FFFF').rotate(1.571,UP) + + p1 = TextMobject("$P_1$",color ='#ADFF2F').scale(0.6).shift(2*RIGHT+1*UP) + p2 = TextMobject("$P_2$",color = '#ADFF2F').scale(0.6).shift(2.6*RIGHT+0.9*UP) + + l = DashedLine(color = '#800000').rotate(1.571,UP).scale(1).shift(1.7*UP+1.6*RIGHT) + l2 = DashedLine(color = '#800000').rotate(1.571,UP).scale(0.8).shift(2.26*UP+1.2*RIGHT) + + l_text = TextMobject("$(x_1,y_1)$",color = '#ADFF2F').scale(0.6).shift(2*RIGHT+1.6*DOWN) + l2_text = TextMobject("$(x_2,y_2)$",color = '#ADFF2F').scale(0.6).shift(2.7*RIGHT+1.2*DOWN) + + a = Arrow(color = '#FFFACD').scale(0.7).rotate(1.38,RIGHT).shift(2.5*LEFT+3.1*UP) + + a_text = TextMobject("$dz$",color='#800000').scale(0.5).shift(2.3*RIGHT+0.5*UP) + + plane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(3).shift(1*RIGHT+3*UP).fade(0.9) + + label = TextMobject("$z = f(x,y)$").scale(0.6).shift(3.5*RIGHT+1.8*UP) + + self.add(axes) + self.set_camera_orientation(phi=75*DEGREES,theta=-10*DEGREES) + self.wait(1) + self.play(Write(plane)) + self.play(Write(surface)) + self.add_fixed_in_frame_mobjects(label) + self.wait(1) + self.play(ShowCreation(l),ShowCreation(l2),Write(d),Write(d2)) + self.wait(1) + self.add_fixed_in_frame_mobjects(p1) + self.add_fixed_in_frame_mobjects(p2) + self.wait(1) + self.add_fixed_in_frame_mobjects(l_text) + self.add_fixed_in_frame_mobjects(l2_text) + self.play(ShowCreation(a)) + self.wait(1) + self.add_fixed_in_frame_mobjects(a_text) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif Binary files differnew file mode 100644 index 0000000..620b49e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.py new file mode 100644 index 0000000..b40be70 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.py @@ -0,0 +1,72 @@ +from manimlib.imports import* + + +class firstScene(ThreeDScene): + + def construct(self): + + axes = ThreeDAxes() + + s = Rectangle(color = '#00FF7F',fill_opacity=0.3).shift(2.3*UP+3.9*LEFT).scale(1).rotate(0.2,UP) #----surface z = f(x,y) + + label_y = TextMobject("$y$").shift(5*RIGHT+0.4*DOWN).rotate(1.571) + label_x = TextMobject("$x$").shift(-0.1*UP+5.6*RIGHT).scale(0.5) + + plane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(3).shift(-1*RIGHT+3*UP).fade(0.9) + + d = Dot([1,2,1],color = '#9400D3').rotate(1.571,UP) + d2 = Dot([2,2.9,1],color = '#9400D3').rotate(1.571,UP) + + p1 = TextMobject("$P_1$",color ='#ADFF2F').scale(0.6).shift(2*RIGHT+1*UP) + p2 = TextMobject("$P_2$",color = '#ADFF2F').scale(0.6).shift(2.6*RIGHT+0.4*UP) + + + l1 = DashedLine(color = '#00BFFF').scale(1.6).shift(3.5*UP+3.25*LEFT).rotate(1.571) + l2 = DashedLine(color = '#00BFFF').scale(1).shift(4*UP+2*LEFT).rotate(1.571) + + label_dz= TextMobject("$dz$").scale(0.4).shift(5.3*RIGHT+0.4*UP) + + + l3 = Line(color = '#FFDAB9').scale(0.8).shift(1.95*UP+0.7*RIGHT).rotate(1.571,DOWN).fade(0.7) + l4 = Line(color = '#FFDAB9').scale(0.6).shift(2.86*UP+0.9*RIGHT).rotate(1.571,DOWN).fade(0.7) + + line_y1 = DashedLine(color = '#00BFFF').scale(1.3).shift(0.82*UP+3.25*RIGHT).rotate(1.571) + line_y2 = DashedLine(color = '#00BFFF').scale(1.7).shift(1.2*UP+2.8*RIGHT).rotate(1.571) + + label_dy= TextMobject("$dy$").scale(0.6).shift(3*RIGHT+0.8*DOWN).rotate(math.radians(90)) + + line_x1 = DashedLine(color = '#00BFFF').scale(1.5).shift(2.2*UP+1.6*RIGHT).rotate(1.571,RIGHT) + line_x2 = DashedLine(color = '#00BFFF').scale(1.2).shift(2.9*UP+1.6*RIGHT).rotate(1.571,RIGHT) + + label_dx= TextMobject("$dx$").scale(0.4).shift(-0.4*UP+2.5*RIGHT) + + label = TextMobject("$f(x,y)$").scale(0.6).shift(4*RIGHT+3*UP) + + + self.add(axes) + self.set_camera_orientation(phi=75*DEGREES,theta=10*DEGREES) + self.play(Write(plane)) + self.play(ShowCreation(label_y)) + self.add_fixed_in_frame_mobjects(label_x) + self.play(Write(s)) + self.add_fixed_in_frame_mobjects(label) + self.wait(1) + self.play(Write(d),Write(d2)) + self.add_fixed_in_frame_mobjects(p1) + self.add_fixed_in_frame_mobjects(p2) + self.wait(1) + self.play(Write(l1)) + self.play(Write(l2)) + self.add_fixed_in_frame_mobjects(label_dz) + self.wait(1) + self.play(Write(l3)) + self.play(Write(l4)) + self.wait(1) + self.play(Write(line_y1)) + self.play(Write(line_y2)) + self.play(ShowCreation(label_dy)) + self.wait(1) + self.play(Write(line_x1)) + self.play(Write(line_x2)) + self.add_fixed_in_frame_mobjects(label_dx) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif Binary files differnew file mode 100644 index 0000000..5aae2a1 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.py new file mode 100644 index 0000000..b29a7a3 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.py @@ -0,0 +1,91 @@ +from manimlib.imports import* + +class firstScene(ThreeDScene): + def construct(self): + axes = ThreeDAxes().fade(0.5) + plane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(3).shift(-1*RIGHT+3*UP).fade(0.9) + label_x = TextMobject("$x$").shift(5*RIGHT+0.4*DOWN).rotate(1.571) + label_y = TextMobject("$y$").shift(0.3*DOWN+5.6*RIGHT).scale(0.5) + label_z = TextMobject("$z$").shift(3.5*UP+0.2*LEFT).scale(0.5) + + s1 = Square(color = '#00FF00',fill_opacity=0.4).shift([1,1,0]) + s2 = Square(color = '#00FF00',fill_opacity=0.4).shift([1,1,3]).scale(0.95) + + l1 = Line([2,0,3],[2,0,0],color = '#FFFACD') + l2 = Line([0,2,3],[0,2,0],color = '#FFFACD') + l3 = Line([2,1.95,3],[2,2,0],color = '#FFFACD') + + d1 = Dot([2,0,1.5],color = '#FFD700').rotate(1.571,UP) + d1_text = TextMobject("$P1$").scale(0.4).shift(1.2*LEFT+1.1*UP) + + d2 = Dot([0,2,3],color = '#FFD700').rotate(1.571,UP) + d2_text = TextMobject("$P2$").scale(0.4).shift(2.3*RIGHT+3.1*UP) + + d3 = Dot([2,2,2],color = '#FFD700').rotate(1.571,UP) + d3_text = TextMobject("$Q$").scale(0.4).shift([1.6,-1,0]+2.5*UP) + + s3 = Square().shift([1,1,1.5]).scale(0.95) + s4 = Square().shift([1,1,2]).scale(0.95) + + m1_line = DashedLine([2,0,1.5],[2,2,2],color = '#87CEEB') + m2_line = DashedLine([2,2,2],[0,2,3],color = '#87CEEB') + + dx_line = Line([2,2,0],[4,2,0],color = '#00FF7F') + dy_line = Line([2,2,0],[2,4,0],color = '#00FF7F') + + dx = DashedLine([3.5,0,0],[3.5,2,0],color = '#87CEEB') + dy = DashedLine([0,3.5,0],[2,3.5,0],color = '#87CEEB') + + dx_text = TextMobject("$dx$").scale(0.8).shift([4,1,0]).rotate(1.571) + dy_text = TextMobject("$dy$").scale(0.8).shift([1,3.8,0]).rotate(math.radians(180)) + + parx_line = Line([0,2,1.5],[0,5,1.5],color = '#00FF7F') + parm_line = Line([0,2,2],[0,5,2],color = '#00FF7F') + pary_line = Line([0,2.1,3],[0,5,3],color = '#00FF7F') + + delx = DashedLine([0,4,2],[0,4,1.5],color = '#F0F8FF') + dely = DashedLine([0,4,3],[0,4,2],color = '#FAEBD7') + + dely_text = TextMobject("$\\frac{\\partial z}{\\partial y}dy$").shift(4.6*RIGHT+2.3*UP).scale(0.4) + delx_text = TextMobject("$\\frac{\\partial z}{\\partial x}dx$").shift(4.6*RIGHT+1.4*UP).scale(0.4) + + + self.set_camera_orientation(phi=75*DEGREES,theta=20*DEGREES) + self.add(axes) + self.play(Write(plane)) + self.play(ShowCreation(label_x)) + self.add_fixed_in_frame_mobjects(label_y) + self.add_fixed_in_frame_mobjects(label_z) + self.wait(1) + self.play(Write(s2)) + self.wait(1) + self.play(Write(l1),Write(l2),Write(l3)) + self.wait(1) + self.play(Write(s1)) + self.wait(1) + self.play(ShowCreation(d1)) + self.add_fixed_in_frame_mobjects(d1_text) + self.play(ShowCreation(d2)) + self.add_fixed_in_frame_mobjects(d2_text) + self.wait(1) + self.play(ShowCreation(d3)) + self.add_fixed_in_frame_mobjects(d3_text) + self.play(ShowCreation(m1_line)) + self.play(ShowCreation(m2_line)) + self.wait(1) + self.play(ShowCreation(dx_line),ShowCreation(dx),ShowCreation(dx_text)) + self.wait(1) + self.play(ShowCreation(dy_line),ShowCreation(dy),ShowCreation(dy_text)) + self.wait(2) + self.play(Write(s3)) + self.play(Write(s4)) + self.wait(1) + self.play(ShowCreation(parx_line),ShowCreation(parm_line),ShowCreation(pary_line)) + self.wait(1) + self.play(ShowCreation(dely)) + self.add_fixed_in_frame_mobjects(dely_text) + self.wait(1) + self.play(ShowCreation(delx)) + self.add_fixed_in_frame_mobjects(delx_text) + self.wait(1) + diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.gif Binary files differnew file mode 100644 index 0000000..f2227a8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.py new file mode 100644 index 0000000..78e41a2 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.py @@ -0,0 +1,54 @@ +from manimlib.imports import* + + +class firstScene(ThreeDScene): + + def construct(self): + + axes = ThreeDAxes() + + s = Rectangle(color = '#F08080',fill_opacity=1).fade(0.7).shift(1.9*UP+5*LEFT).scale(0.9)#----surface z = f(x,y) + + s2= Rectangle(color = '#F08080',fill_opacity=1).fade(0.7).shift(2.4*UP+3.1*RIGHT).scale(0.6) #----reflection of the surface on the x-y plane + + l1 = DashedLine(color = '#AFEEEE').rotate(1.571,UP).scale(1).shift(1.53*UP+1.5*RIGHT) + l2 = DashedLine(color = '#AFEEEE').rotate(1.571,UP).scale(1).shift(2.9*UP+1.4*RIGHT) + l3 = DashedLine(color = '#AFEEEE').rotate(1.571,UP).scale(1).shift(1.5*UP-1.6*RIGHT) + l4 = DashedLine(color = '#AFEEEE').rotate(1.571,UP).scale(1).shift(2.9*UP-1.75*RIGHT) + + + l1_text = TextMobject("$(x+\\triangle x,y)$").shift(RIGHT+1.7*DOWN).scale(0.4) + l2_text = TextMobject("$(x+\\triangle x,y+\\triangle y)$").shift(3*RIGHT+1.8*DOWN).scale(0.4) + l3_text = TextMobject("$f(x,y)$").shift(1.6*RIGHT+1.5*UP).scale(0.4) + l4_text = TextMobject("$(x,y+\\triangle y)$").shift(3.5*RIGHT+0.7*DOWN).scale(0.4) + + label_x = TextMobject("$x$").shift(5*RIGHT+0.4*DOWN) + label_y = TextMobject("$y$").shift(5*UP-0.6*RIGHT) + + self.add(axes) + self.set_camera_orientation(phi=75*DEGREES,theta=10*DEGREES) + self.wait(1) + self.play(ShowCreation(label_x),ShowCreation(label_y)) + self.play(Write(s)) + self.wait(1) + self.add_fixed_in_frame_mobjects(l3_text) + self.wait(1) + self.play(Write(l3)) + self.wait(1) + self.play(Write(l1)) + self.add_fixed_in_frame_mobjects(l1_text) + self.wait(1) + self.play(Write(l2)) + self.add_fixed_in_frame_mobjects(l2_text) + self.wait(1) + self.play(Write(l4)) + self.add_fixed_in_frame_mobjects(l4_text) + self.wait(1) + self.play(Write(s2)) + self.wait(1) + + + + + + diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif Binary files differnew file mode 100644 index 0000000..4f4627d --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.py new file mode 100644 index 0000000..83017ed --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.py @@ -0,0 +1,48 @@ +from manimlib.imports import* + + +class firstScene(ThreeDScene): + + def construct(self): + + axes = ThreeDAxes().rotate(1.571) + surface = ParametricSurface( + lambda u, v: np.array([ + np.sin(u), + v, + -u**2-v + ]),u_min=-1,u_max=1, v_min=-1,v_max=1).set_color("#00008B").scale(2).shift(3.8*UP+2*LEFT) + + d = Dot([1.4,1.75,1],color = '#00FFFF').rotate(1.571,UP) + d2 = Dot([2,2,1],color = '#00FFFF').rotate(1.571,UP) + + l = DashedLine(color = '#800000').rotate(1.571,UP).scale(1).shift(1.7*UP+1.6*RIGHT) + l2 = DashedLine(color = '#800000').rotate(1.571,UP).scale(0.8).shift(2.26*UP+1.2*RIGHT) + + l_text = TextMobject("$(x_1,y_1)$",color = '#ADFF2F').scale(0.6).shift(2*RIGHT+1.6*DOWN) + l2_text = TextMobject("$(x_2,y_2)$",color = '#ADFF2F').scale(0.6).shift(2.7*RIGHT+1.2*DOWN) + + plane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(3).shift(1*RIGHT+3*UP).fade(0.9) + + tangentplane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(1.1).shift(2*LEFT+3.4*UP).fade(0.5).rotate(0.8,RIGHT) + tangentplane_text = TextMobject("Tangent Plane").scale(0.4).shift(3*RIGHT+1*UP) + + label = TextMobject("$z = f(x,y)$").scale(0.6).shift(4*RIGHT+3*UP) + + + self.add(axes) + self.set_camera_orientation(phi=75*DEGREES,theta=-10*DEGREES) + self.wait(1) + self.play(Write(plane)) + self.wait(1) + self.play(Write(surface)) + self.add_fixed_in_frame_mobjects(label) + self.wait(1.5) + self.play(ShowCreation(l),ShowCreation(l2),Write(d),Write(d2)) + self.wait(1) + self.add_fixed_in_frame_mobjects(l_text) + self.add_fixed_in_frame_mobjects(l2_text) + self.wait(1) + self.play(Write(tangentplane)) + self.add_fixed_in_frame_mobjects(tangentplane_text) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/README.md b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/README.md index b50200d..7ff6b61 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/README.md +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/README.md @@ -4,6 +4,6 @@ Github Account : <a href="https://github.com/nishanpoojary">nishanpoojary</a> ## Sub-Topics Covered:
+ Scalar Functions
+ Multivariable Functions
-+ Limits and continuity of Multivariable Function
++ Limits and Continuity of Multivariable Functions
+ Partial Derivatives
+ Directonal Derivatives
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves.gif Binary files differdeleted file mode 100644 index 2df2fde..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves.gif +++ /dev/null diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves2.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves2.gif Binary files differdeleted file mode 100644 index 724c27d..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves2.gif +++ /dev/null diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/Limits_and_Continuity_of_Multivariable_Function_Quiz.pdf b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/Limits_and_Continuity_of_Multivariable_Function_Quiz.pdf Binary files differnew file mode 100644 index 0000000..99918e5 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/Limits_and_Continuity_of_Multivariable_Function_Quiz.pdf diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_epsilon_delta_defn.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_epsilon_delta_defn.py new file mode 100644 index 0000000..63b6165 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_epsilon_delta_defn.py @@ -0,0 +1,120 @@ +from manimlib.imports import *
+
+class EpsilonDelta(ThreeDScene):
+ def construct(self):
+ axes = ThreeDAxes() # creates a 3D Axis
+
+
+ sphere = ParametricSurface(
+ lambda u, v: np.array([
+ 2*np.sin(u)*np.cos(v),
+ 2*np.sin(u)*np.sin(v),
+ 2*np.cos(u)
+ ]),u_min=0,u_max=PI/4,v_min=0,v_max=PI/2,checkerboard_colors=[RED_D, RED_E],
+ resolution=(15, 32)).scale(2)
+ #sphere.shift(0.5*RIGHT+0.5*UP)
+
+ #self.set_camera_orientation(phi=0*DEGREES,theta=270*DEGREES)
+ self.set_camera_orientation(phi=75 * DEGREES)
+
+
+
+ circle = Circle(radius= 0.4,color = GREEN)
+ circle.shift(0.5*RIGHT+0.5*UP)
+
+ line1 = DashedLine(np.array([0.5, 0.1,0]), np.array([0.5, 0.1,2.1]), color = BLUE_E)
+ line2 = DashedLine(np.array([0.5, 0.9,0]), np.array([0.5, 0.9,1.7]), color = BLUE_E)
+ line3 = DashedLine(np.array([0, 0,2.1]), np.array([0.5, 0.1,2.1]), color = YELLOW_C)
+ line4 = DashedLine(np.array([0, 0,1.7]), np.array([0.5, 0.9,1.7]), color = YELLOW_C)
+
+ dot1 = Sphere()
+ dot1.scale(0.01)
+ dot1.move_to(np.array([0,0,1.9]))
+ dot1.set_fill(BLUE_E)
+
+ temp_func1 = TextMobject(r"$L$")
+ temp_func1.scale(0.6)
+ temp_func1.set_color(BLUE_E)
+
+ dot2 = Sphere()
+ dot2.scale(0.01)
+ dot2.move_to(np.array([0,0,1.7]))
+ dot2.set_fill(PURPLE)
+
+ temp_func2 = TextMobject(r"$L - \epsilon$")
+ temp_func2.scale(0.6)
+ temp_func2.set_color(PURPLE)
+
+ dot3 = Sphere()
+ dot3.scale(0.01)
+ dot3.move_to(np.array([0,0,2.1]))
+ dot3.set_fill(PURPLE)
+
+ temp_func3 = TextMobject(r"$L + \epsilon$")
+ temp_func3.scale(0.6)
+ temp_func3.set_color(PURPLE)
+
+ self.add(axes)
+
+ self.play(ShowCreation(dot1))
+ self.add_fixed_in_frame_mobjects(temp_func1)
+ temp_func1.move_to(1.9*UP)
+ self.play(Write(temp_func1))
+
+ self.play(ShowCreation(dot2))
+ self.add_fixed_in_frame_mobjects(temp_func2)
+ temp_func2.move_to(1.7*UP)
+ self.play(Write(temp_func2))
+
+ self.play(ShowCreation(dot3))
+ self.add_fixed_in_frame_mobjects(temp_func3)
+ temp_func3.move_to(2.1*UP)
+ self.play(Write(temp_func3))
+
+
+ circle_center = Sphere()
+ circle_center.scale(0.05)
+ circle_center.move_to(np.array([0.5,0.5,0]))
+ circle_center.set_fill(GREEN)
+
+ temp_circle_center = TextMobject(r"$(a,b,0)$")
+ temp_circle_center.scale(0.5)
+ temp_circle_center.set_color(GREEN)
+
+ curve_circle_center = Sphere()
+ curve_circle_center.scale(0.05)
+ curve_circle_center.move_to(np.array([0.5,0.5,1.9]))
+ curve_circle_center.set_fill(BLUE_E)
+
+ temp_curve_circle_center = TextMobject(r"$(a,b,L)$")
+ temp_curve_circle_center.scale(0.5)
+ temp_curve_circle_center.set_color(BLUE)
+
+ delta_lab = TextMobject(r"$\delta - disk$")
+ delta_lab.scale(0.5)
+ delta_lab.set_color(PINK)
+
+ self.play(ShowCreation(circle_center))
+ self.add_fixed_in_frame_mobjects(temp_circle_center)
+ temp_circle_center.move_to(1.5*RIGHT)
+ self.play(Write(temp_circle_center))
+
+ self.play(ShowCreation(curve_circle_center))
+ self.add_fixed_in_frame_mobjects(temp_curve_circle_center)
+ temp_curve_circle_center.move_to(1.9*UP+1*RIGHT)
+ self.play(Write(temp_curve_circle_center))
+
+
+ self.add_fixed_in_frame_mobjects(delta_lab)
+ delta_lab.move_to(0.4*DOWN+1.7*RIGHT)
+ self.play(Write(delta_lab))
+
+
+
+
+
+ self.begin_ambient_camera_rotation(rate=0.2)
+ self.play(Write(sphere))
+ self.play(ShowCreation(circle), ShowCreation(line1), ShowCreation(line2))
+ self.play(ShowCreation(line3), ShowCreation(line4))
+ self.wait(8)
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Limits and Continuity of Multivariable Functions/limit_approach_point.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file2_limit_approach_point.py index 57d1d45..57d1d45 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Limits and Continuity of Multivariable Functions/limit_approach_point.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file2_limit_approach_point.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file3_limit_func.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file3_limit_func.py new file mode 100644 index 0000000..02e00e8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file3_limit_func.py @@ -0,0 +1,30 @@ +from manimlib.imports import *
+
+class LimitFunc(ThreeDScene):
+ def construct(self):
+ axes = ThreeDAxes()
+
+ text3d = TextMobject(r"$f(x,y) = \frac{x^2 - y^2}{x^2 + y^2}$")
+ self.add_fixed_in_frame_mobjects(text3d)
+
+ text3d.to_corner(UL)
+
+ text3d.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+
+ self.play(Write(text3d))
+ self.wait(1)
+
+ limit_func = ParametricSurface(
+ lambda u, v: np.array([
+ u*np.cos(v),
+ u*np.sin(v),
+ (np.cos(v)*np.cos(v) - np.sin(v)*np.sin(v))/3
+ ]),u_min=-3,u_max=3,v_min=0,v_max=2*PI,checkerboard_colors=[YELLOW_C, YELLOW_E],
+ resolution=(15, 32)).scale(2)
+
+ self.set_camera_orientation(phi=80 * DEGREES)
+ self.begin_ambient_camera_rotation(rate=0.3)
+
+ self.add(axes)
+ self.play(Write(limit_func))
+ self.wait(10)
\ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file4_continuity_func.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file4_continuity_func.py new file mode 100644 index 0000000..551c8a8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file4_continuity_func.py @@ -0,0 +1,32 @@ +from manimlib.imports import *
+
+class ContinuityFunc(ThreeDScene):
+ def construct(self):
+ axes = ThreeDAxes()
+
+ text3d = TextMobject(r"$f(x,y) = \frac{3x^2y}{x^2 + y^2}$")
+ self.add_fixed_in_frame_mobjects(text3d)
+
+ text3d.to_corner(UL)
+
+ text3d.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+
+ self.play(Write(text3d))
+ self.wait(1)
+
+ continuity_func = ParametricSurface(
+ lambda u, v: np.array([
+ u*np.cos(v),
+ u*np.sin(v),
+ 3*u*np.cos(v)*np.cos(v)*np.sin(v)
+ ]),u_min=-1.5,u_max=1.5,v_min=0,v_max=2*PI,checkerboard_colors=[YELLOW_C, YELLOW_E],
+ resolution=(15, 32)).scale(2)
+
+
+
+ self.set_camera_orientation(phi=80 * DEGREES)
+ self.begin_ambient_camera_rotation(rate=0.3)
+
+ self.add(axes)
+ self.play(Write(continuity_func))
+ self.wait(8)
\ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_epsilon_delta_defn.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_epsilon_delta_defn.gif Binary files differnew file mode 100644 index 0000000..68f637e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_epsilon_delta_defn.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Limits and Continuity of Multivariable Functions/gifs/limit_approach_point.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file2_limit_approach_point.gif Binary files differindex 830b6f1..830b6f1 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Limits and Continuity of Multivariable Functions/gifs/limit_approach_point.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file2_limit_approach_point.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file3_limit_func.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file3_limit_func.gif Binary files differnew file mode 100644 index 0000000..07b23be --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file3_limit_func.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file4_continuity_func.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file4_continuity_func.gif Binary files differnew file mode 100644 index 0000000..560e0f1 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file4_continuity_func.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/Multivariable_Functions_Quiz.pdf b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/Multivariable_Functions_Quiz.pdf Binary files differindex 7895843..7895843 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/Multivariable_Functions_Quiz.pdf +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/Multivariable_Functions_Quiz.pdf diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_respresntation.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivariable_func_respresentation.py index 4bfcf21..4bfcf21 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_respresntation.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivariable_func_respresentation.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_examples.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_examples.py index 7322e47..7322e47 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_examples.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_examples.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_plot_sphere.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py index baf08b1..baf08b1 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_plot_sphere.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_vectorvf_sine.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py index 06e225e..06e225e 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_vectorvf_sine.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_derivative_vectorvf.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_derivative_vectorvf.py index 466e389..466e389 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_derivative_vectorvf.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_derivative_vectorvf.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_respresntation.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivariable_func_respresentation.gif Binary files differindex a173bda..a173bda 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_respresntation.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivariable_func_respresentation.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_examples.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_examples.gif Binary files differindex 11f66f1..11f66f1 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_examples.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_examples.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_plot_sphere.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_plot_sphere.gif Binary files differindex ad7582c..ad7582c 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_plot_sphere.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_plot_sphere.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_vectorvf_sine.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif Binary files differindex 4f6b931..4f6b931 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_vectorvf_sine.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_derivative_vectorvf.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_derivative_vectorvf.gif Binary files differindex a94de90..a94de90 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_derivative_vectorvf.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_derivative_vectorvf.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/Scalar_Function_Quiz.pdf b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/Scalar_Function_Quiz.pdf Binary files differindex 6d94a2c..6d94a2c 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/Scalar_Function_Quiz.pdf +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/Scalar_Function_Quiz.pdf diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_domain_range.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file1_domain_range.py index 9b1ca7b..9b1ca7b 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_domain_range.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file1_domain_range.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_application.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file2_scalar_function_application.py index 56b3e53..56b3e53 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_application.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file2_scalar_function_application.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_parabola_example.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file3_parabola_example.py index 74dc063..74dc063 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_parabola_example.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file3_parabola_example.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_neural_nets.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file4_neural_nets.py index eb6bf45..eb6bf45 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_neural_nets.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file4_neural_nets.py diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/domain_range.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file1_domain_range.gif Binary files differindex d0351e5..d0351e5 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/domain_range.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file1_domain_range.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_application.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file2_scalar_function_application.gif Binary files differindex 831ec8e..831ec8e 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_application.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file2_scalar_function_application.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_parabola_example.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file3_parabola_example.gif Binary files differindex 3fdecf4..3fdecf4 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_parabola_example.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file3_parabola_example.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_neural_nets.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file4_neural_nets.gif Binary files differindex 9d24688..9d24688 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_neural_nets.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file4_neural_nets.gif diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md index e69de29..0af7aa1 100644 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md @@ -0,0 +1,8 @@ +**file1_flux_through_sphere.py** +![file1_flux_through_sphere](file1_flux_through_sphere.gif) +**file2_mobius_strip.py** +![file2_mobius_strip](file2_mobius_strip.gif) +**file3_normal_vector.py** +![file3_normal_vector](file3_normal_vector.gif) +**file4_cube_surface.py** +![file4_cube_surface](file4_cube_surface.gif) diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py index 5963996..9301a00 100644 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py @@ -43,29 +43,186 @@ class cuber(ThreeDScene): n1.rotate(PI/2,axis=RIGHT) n1.shift(3*RIGHT+1.3*OUT+DOWN) + spaceloc = [[0,0,2],[1,0,2],[-1,0,2],[2,0,2],[-2,0,2],[3,0,2],[-3,0,2], + [0,1,2],[1,1,2],[-1,1,2],[2,1,2],[-2,1,2],[3,1,2],[-3,1,2], + [0,-1,2],[1,-1,2],[-1,-1,2],[2,-1,2],[-2,-1,2],[3,-1,2],[-3,-1,2], + [0,2,2],[1,2,2],[-1,2,2],[2,2,2],[-2,2,2],[3,2,2],[-3,2,2], + [0,-2,2],[1,-2,2],[-1,-2,2],[2,-2,2],[-2,-2,2],[3,-2,2],[-3,-2,2], + [0,3,2],[1,3,2],[-1,3,2],[2,3,2],[-2,3,2],[3,3,2],[-3,3,2], + [0,3,2],[1,3,2],[-1,3,2],[2,3,2],[-2,3,2],[3,3,2],[-3,3,2], + [0,4,2],[1,4,2],[-1,4,2],[2,4,2],[-2,4,2],[3,4,2],[-3,4,2], + [0,4,2],[1,4,2],[-1,4,2],[2,4,2],[-2,4,2],[3,4,2],[-3,4,2], + [0,5,2],[1,5,2],[-1,5,2],[2,5,2],[-2,5,2],[3,5,2],[-3,5,2], + [0,5,2],[1,5,2],[-1,5,2],[2,5,2],[-2,5,2],[3,5,2],[-3,5,2], + [0,6,2],[1,6,2],[-1,6,2],[2,6,2],[-2,6,2],[3,6,2],[-3,6,2], + [0,1.5,2],[1,1.5,2],[-1,1.5,2],[2,1.5,2],[-2,1.5,2],[3,1.5,2],[-3,1.5,2], + [0,3,2],[1,3,2],[-1,3,2],[2,3,2],[-2,3,2],[3,3,2],[-3,3,2]] + + + veclist1=[Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E)] + + + + + + [veclist1[i].rotate(PI/4,axis=RIGHT) for i in range(10,30,1)] + [veclist1[i].rotate(PI/4,axis=RIGHT) for i in range(40,80,2)] + [veclist1[i].rotate(PI/6,axis=OUT) for i in range(98)] + [veclist1[i].rotate(PI/8,axis=DOWN) for i in range(98)] + vectorfield1=VGroup(*veclist1) + [veclist1[i].shift(spaceloc[i]) for i in range(98)] - self.set_camera_orientation(phi=75 * DEGREES,theta=-15*DEGREES) + + + veclist2=[Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E), + Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E),Vector(color=GOLD_E)] + + + + + + [veclist2[i].rotate(PI/4,axis=RIGHT) for i in range(10,30,1)] + [veclist2[i].rotate(PI/4,axis=RIGHT) for i in range(40,80,2)] + [veclist2[i].rotate(PI/6,axis=OUT) for i in range(98)] + [veclist2[i].rotate(PI/8,axis=DOWN) for i in range(98)] + vectorfield2=VGroup(*veclist2) + [veclist2[i].shift(spaceloc[i]) for i in range(98)] + + + + veclist3=[Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector()] + + + + + + [veclist3[i].rotate(PI/4,axis=RIGHT) for i in range(10,30,1)] + [veclist3[i].rotate(PI/4,axis=RIGHT) for i in range(40,80,2)] + [veclist3[i].rotate(PI/6,axis=OUT) for i in range(98)] + [veclist3[i].rotate(PI/8,axis=DOWN) for i in range(98)] + vectorfield3=VGroup(*veclist3) + [veclist3[i].shift(spaceloc[i]) for i in range(98)] + + + + + veclist4=[Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector(), + Vector(color=RED),Vector(color=GREEN),Vector(color=BLUE),Vector(color=PINK),Vector(color=MAROON),Vector(color=GREEN),Vector()] + + + + + + [veclist4[i].rotate(PI/4,axis=RIGHT) for i in range(10,30,1)] + [veclist4[i].rotate(PI/4,axis=RIGHT) for i in range(40,80,2)] + [veclist4[i].rotate(PI/6,axis=OUT) for i in range(98)] + [veclist4[i].rotate(PI/8,axis=DOWN) for i in range(98)] + vectorfield4=VGroup(*veclist4) + [veclist4[i].shift(spaceloc[i]) for i in range(98)] + + + vectorfield1.shift(1.5*DOWN) + vectorfield2.shift(IN+1.5*DOWN) + vectorfield3.shift(2*IN+1.5*DOWN) + vectorfield4.shift(3*IN+1.5*DOWN) + + vectors=[vectorfield1,vectorfield2,vectorfield3,vectorfield4] + vectorfield=VGroup(*vectors) + vectorfield.scale(1.25) + + fv=[Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE), + Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE), + Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE), + Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE),Vector(color=ORANGE), + ] + + spaceloc2 = [[1.5,0.5,0.5],[1.5,1,0.5],[1.5,1.5,0.5],[1.5,2,0.5], + [1.5,0.5,1],[1.5,1,1],[1.5,1.5,1],[1.5,2,1], + [1.5,0.5,1.5],[1.5,1,1.5],[1.5,1.5,1.5],[1.5,2,1.5], + [1.5,0.5,2],[1.5,1,2],[1.5,1.5,2],[1.5,2,2]] + + [fv[i].rotate(PI/4,axis=RIGHT) for i in range(1)] + [fv[i].rotate(PI/6,axis=OUT) for i in range(16)] + [fv[i].rotate(PI/8,axis=DOWN) for i in range(16)] + [fv[i].shift(spaceloc2[i]) for i in range(16)] + fvfield=VGroup(*fv) + fvfield.shift(0.5*IN+2*DOWN) + + flux=TextMobject("Flux through one side of the cube").set_color(ORANGE) + flux.shift(3*UP+1.5*LEFT) + + + + + + self.set_camera_orientation(phi=70 * DEGREES,theta=-75*DEGREES) self.play(ShowCreation(axes),ShowCreation(axis_label)) - self.play(ShowCreation(cube, run_time=3)) - self.begin_ambient_camera_rotation(rate=-0.2) - # self.move_camera(phi=150*DEGREES,theta=-45*DEGREES, run_time=3) + self.play(ShowCreation(vectorfield)) + self.add(fvfield) + self.begin_ambient_camera_rotation(rate=0.01) + + self.play(ShowCreation(cube, run_time=1)) + self.wait(1) self.play(ShowCreation(sq3)) - self.wait(1) - self.play(ShowCreation(v1),ShowCreation(n1)) + self.play(FadeOut(cube)) + self.play(FadeOut(vectorfield)) + self.add_fixed_in_frame_mobjects(flux) + # self.play(ShowCreation(flux)) self.wait(1) - self.stop_ambient_camera_rotation() - self.wait(2) - - - # self.play(Write(t1)) - # self.play(Transform(vg,t1)) - # self.wait(3) - # self.play(ReplacementTransform(t1,t2)) - # self.wait(3) - # # self.move_camera(phi=50*DEGREES,theta=-45*DEGREES,run_time=3) - # self.wait(8) - # self.move_camera(phi=75 * DEGREES, run_time=3) - # self.wait(3) + self.play(ShowCreation(v1),ShowCreation(n1)) + self.wait(6) + # self.stop_ambient_camera_rotation() + diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/README.md b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/README.md index df307cd..a1de8b5 100644 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/README.md +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/README.md @@ -1,2 +1,10 @@ -**Test**
-![Cube](cube.gif)
+**file1_projection.py** +![file1_projection](projection.gif) +**file2_cube.py** +![file2_cube](cube.gif) +**file3_cube_sideC.py** +![file3_cube_sideC](sideC.gif) +**file4_pauseandponder.py** +![file4_pauseandponder](pauseandponder.gif) +**file5_surface.py** +![file5_surface](file5_surface.gif) diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file5_surface.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file5_surface.gif Binary files differnew file mode 100644 index 0000000..27dcac8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file5_surface.gif diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file5_surface.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file5_surface.py new file mode 100644 index 0000000..3c2e145 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file5_surface.py @@ -0,0 +1,237 @@ +from manimlib.imports import * + +class Surf(ThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": 0, + "x_max": 8, + "y_min": 0, + "y_max": 8, + "z_min": 0, + "z_max": 6, + "a":2 ,"b": 6, "c":1 , "d":6, + "axes_shift":-3*OUT + 5*LEFT, + "x_axis_config": { + "tick_frequency": 1, + # "include_tip": False, + }, + "y_axis_config": { + "tick_frequency": 1, + # "include_tip": False, + }, + "z_axis_config": { + "tick_frequency": 1, + # "include_tip": False, + }, + "num_axis_pieces": 1, + }, + "default_graph_style": { + "stroke_width": 2, + "stroke_color": WHITE, + }, + "default_surface_config": { + "fill_opacity": 0.5, + "checkerboard_colors": [LIGHT_GREY], + "stroke_width": 0.5, + "stroke_color": WHITE, + "stroke_opacity": 0.5, + }, + "Func": lambda x,y: 2+y/4+np.sin(x) + } + + + def construct(self): + + self.setup_axes() + self.set_camera_orientation(distance=35, + phi=80 * DEGREES, + theta=-80 * DEGREES, + ) + + fn_text=TextMobject("$S$").set_color(BLUE) + self.add_fixed_in_frame_mobjects(fn_text) + fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) + + R=TextMobject("D").set_color(BLACK).scale(3) + R.move_to(self.axes.input_plane,IN) + self.add(R) + + #get the surface + surface= self.get_surface( + self.axes, lambda x , y: + self.Func(x,y) + ) + surface.set_style( + fill_opacity=0.8, + fill_color=YELLOW, + stroke_width=0.8, + stroke_color=WHITE, + ) + + + self.begin_ambient_camera_rotation(rate=0.05) + self.play(Write(surface)) + # self.play(LaggedStart(ShowCreation(surface))) + + self.get_lines() + # self.play(FadeIn(self.axes.input_plane)) + self.wait(2) + self.stop_ambient_camera_rotation() + self.wait(1) + + def get_surface(self,axes, func, **kwargs): + config = { + "u_min": axes.c, + "u_max": axes.d, + "v_min": axes.a, + "v_max": axes.b, + "resolution": ( + (axes.y_max - axes.y_min) // axes.y_axis.tick_frequency, + (axes.x_max - axes.x_min) // axes.x_axis.tick_frequency, + ), + } + + config.update(self.default_surface_config) + config.update(kwargs) + return ParametricSurface( + lambda x,y : axes.c2p( + x, y, func(x, y) + ), + **config + ) + + def get_lines(self): + axes = self.axes + labels=[axes.x_axis.n2p(axes.a), axes.x_axis.n2p(axes.b), axes.y_axis.n2p(axes.c), + axes.y_axis.n2p(axes.d)] + + + surface_corners=[] + for x,y,z in self.region_corners: + surface_corners.append([x,y,self.Func(x,y)]) + + lines=VGroup() + for start , end in zip(surface_corners, + self.region_corners): + lines.add(self.draw_lines(start,end,"WHITE")) + + for start , end in zip(labels, + self.region_corners): + # lines.add(self.draw_lines(start,end,"BLUE")) + # print (start,end) + pass + self.play(ShowCreation(lines)) + + + def draw_lines(self,start,end,color): + start=self.axes.c2p(*start) + end=self.axes.c2p(*end) + line=DashedLine(start,end,color=color) + + return line + + def get_three_d_axes(self, include_labels=True, include_numbers=True, **kwargs): + config = dict(self.axes_config) + config.update(kwargs) + axes = ThreeDAxes(**config) + axes.set_stroke(width=2) + + if include_numbers: + self.add_axes_numbers(axes) + + if include_labels: + self.add_axes_labels(axes) + + # Adjust axis orientation + axes.x_axis.rotate( + 90 * DEGREES, RIGHT, + about_point=axes.c2p(0, 0, 0), + ) + axes.y_axis.rotate( + 90 * DEGREES, UP, + about_point=axes.c2p(0, 0, 0), + ) + + # Add xy-plane + input_plane = self.get_surface( + axes, lambda x, t: 1e-5 + ) + input_plane.set_style( + fill_opacity=0.5, + fill_color=TEAL, + stroke_width=0, + stroke_color=WHITE, + ) + + axes.input_plane = input_plane + + self.region_corners=[ + input_plane.get_corner(pos) for pos in (DL,DR,UR,UL)] + + return axes + + + def setup_axes(self): + axes = self.get_three_d_axes(include_labels=True) + axes.add(axes.input_plane) + axes.scale(1) + # axes.center() + axes.shift(axes.axes_shift) + + self.add(axes) + self.axes = axes + + def add_axes_numbers(self, axes): + x_axis = axes.x_axis + y_axis = axes.y_axis + tex_vals_x = [ + ("a", axes.a), + ("b", axes.b), + ] + tex_vals_y=[ + ("c", axes.c), + ("d", axes.d) + ] + x_labels = VGroup() + y_labels = VGroup() + for tex, val in tex_vals_x: + label = TexMobject(tex) + label.scale(1) + label.next_to(x_axis.n2p(val), DOWN) + x_labels.add(label) + x_axis.add(x_labels) + x_axis.numbers = x_labels + + for tex, val in tex_vals_y: + label = TexMobject(tex) + label.scale(1.5) + label.next_to(y_axis.n2p(val), LEFT) + label.rotate(90 * DEGREES) + y_labels.add(label) + + y_axis.add(y_labels) + y_axis.numbers = y_labels + + return axes + + def add_axes_labels(self, axes): + x_label = TexMobject("X") + x_label.next_to(axes.x_axis.get_end(), RIGHT) + axes.x_axis.label = x_label + + y_label = TextMobject("Y") + y_label.rotate(90 * DEGREES, OUT) + y_label.next_to(axes.y_axis.get_end(), UP) + axes.y_axis.label = y_label + + z_label = TextMobject("Z") + z_label.rotate(90 * DEGREES, RIGHT) + z_label.next_to(axes.z_axis.get_zenith(), RIGHT) + axes.z_axis.label = z_label + for axis in axes: + axis.add(axis.label) + return axes + ######Code_by_Somnath_Pandit_https://github.com/panditsomnath10016git######### + + diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/README.md b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/README.md index e69de29..2166a79 100644 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/README.md +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/README.md @@ -0,0 +1,6 @@ +**file1_3D_crossproduct.py** +![file1_3D_crossproduct](file1_3D_crossproduct.gif) +**file2_cylindrical_coordinates.py** +![file2_cylindrical_coordinates](file2_cylindrical_coordinates.gif) +**file2_spherical_coordinates.py** +![file2_spherical_coordinates](file2_spherical_coordinates.gif) diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif Binary files differindex 6dc8b17..e913750 100644 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_spherical_coordinates.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_spherical_coordinates.gif Binary files differnew file mode 100644 index 0000000..6dc8b17 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_spherical_coordinates.gif |