From ef2e803f955cc03a4de1034dca2b204460eafacc Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 11:56:09 +0530 Subject: Update and rename FSF-2020/approximations-and-optimizations/Critical Points/example.py to FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py --- .../Critical Points/example.py | 32 ---------------------- .../file 4- f(x,y) = (y-x)(1-2x-3y).py | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/example.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/example.py b/FSF-2020/approximations-and-optimizations/Critical Points/example.py deleted file mode 100644 index 3a41be7..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/example.py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = 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_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py new file mode 100644 index 0000000..72c93b1 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py @@ -0,0 +1,32 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point + d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 + r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) + + #----f(x,y) = (y-x)(1-2x-3y) + f = 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_D, PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.5) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(d_text) + self.wait(1) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(3) -- cgit From 035733edd4208514f9112f3446b79f92824a84b1 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 11:58:31 +0530 Subject: Delete motivation.py --- .../Critical Points/motivation.py | 30 ---------------------- 1 file changed, 30 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/motivation.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/motivation.py b/FSF-2020/approximations-and-optimizations/Critical Points/motivation.py deleted file mode 100644 index 27354ef..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/motivation.py +++ /dev/null @@ -1,30 +0,0 @@ -from manimlib.imports import* - -class MotivationAnimation(Scene): - def construct(self): - - r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip - b = Brace(r,UP) - r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) - m_text = TextMobject("Metal Strip").shift(3*DOWN) - a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) - a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) - START = [1,0,0] - END = [0,3,0] - l = Line(START,END,color = RED).shift(0.9*DOWN) - a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) - - group1 = VGroup(r_text,b,a,l,a2,a2_text) - f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) - - ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip - - self.play(Write(r)) - self.wait(1) - self.play(ShowCreation(m_text)) - self.wait(1) - self.play(Write(group1)) - self.wait(2) - self.play(FadeOut(group1)) - self.wait(1) - self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) -- cgit From 3c659b3c55cc39fed44a08554ca457ed9ec4cbb3 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 11:58:39 +0530 Subject: Delete theorem.py --- .../Critical Points/theorem.py | 55 ---------------------- 1 file changed, 55 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/theorem.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/theorem.py b/FSF-2020/approximations-and-optimizations/Critical Points/theorem.py deleted file mode 100644 index 7c82aa9..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/theorem.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import* - -class TheoremAnimation(ThreeDScene): - def construct(self): - - axes = ThreeDAxes() - - #----parabola: x**2+y**2 - parabola1 = 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_E], - resolution = (20, 20)).scale(1) - - #----parabola: -x**2-y**2 - parabola2 = 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_E,PURPLE_E], - resolution = (20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate = 0.4) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color = '#C0C0C0',fill_opacity = 0.3).move_to(ORIGIN) #----tangent plane - - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) - - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) - - self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) - self.wait(1) - self.play(Write(parabola1)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) - - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) -- cgit From 783a5e218275f3d01b243cc8e7f793208bcfe4f9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 11:58:47 +0530 Subject: Delete types_of_cp.py --- .../Critical Points/types_of_cp.py | 70 ---------------------- 1 file changed, 70 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py b/FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py deleted file mode 100644 index f9055e6..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py +++ /dev/null @@ -1,70 +0,0 @@ -from manimlib.imports import * - -class TypescpAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - - #----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) - - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) - - #----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) - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----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) - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r3_text) - self.wait(1) - self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) -- cgit From 322d35f52839c38f3df5bbb71544ce0b8361b8f8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:04:55 +0530 Subject: Add files via upload --- .../file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 | Bin 0 -> 2542434 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 new file mode 100644 index 0000000..b01d279 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 differ -- cgit From 206e13c581fc949943434e5d0a66626b5732da62 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:08:11 +0530 Subject: Rename file 4- f(x,y) = (y-x)(1-2x-3y).py to file 4_f(x,y) = (y-x)(1-2x-3y).py --- .../file 4- f(x,y) = (y-x)(1-2x-3y).py | 32 ---------------------- .../file 4_f(x,y) = (y-x)(1-2x-3y).py | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py deleted file mode 100644 index 72c93b1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = 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_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py new file mode 100644 index 0000000..72c93b1 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py @@ -0,0 +1,32 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point + d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 + r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) + + #----f(x,y) = (y-x)(1-2x-3y) + f = 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_D, PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.5) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(d_text) + self.wait(1) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(3) -- cgit From 11fa5f7cbb945530999a2f0f8957fadbcd8a1419 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:12:15 +0530 Subject: Create file 3_Visualization of types of critical points.py --- ... 3_Visualization of types of critical points.py | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py new file mode 100644 index 0000000..f9055e6 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py @@ -0,0 +1,70 @@ +from manimlib.imports import * + +class TypescpAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + #----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) + + r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + #----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) + + r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + #----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) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.play(FadeOut(r2_text)) + self.add(axes) + self.play(Write(f2),Write(d)) + self.add_fixed_in_frame_mobjects(f2_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r3_text) + self.wait(1) + self.play(FadeOut(r3_text)) + self.add(axes) + self.play(Write(f3),Write(d)) + self.add_fixed_in_frame_mobjects(f3_text) + self.wait(2) -- cgit From 33f8da2e2df30ee550010d7186ce56821181fd59 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:14:25 +0530 Subject: Add files via upload --- ..._Visualization of types of critical points.gif.mp4 | Bin 0 -> 1035267 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 new file mode 100644 index 0000000..ea6b781 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 differ -- cgit From f4d67bbc33ae30992bf3b66ccdb4c8110ed8700b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:16:41 +0530 Subject: Create file 2_Tangent plane at extrema of a function.py --- ...ile 2_Tangent plane at extrema of a function.py | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py new file mode 100644 index 0000000..6889a52 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py @@ -0,0 +1,55 @@ +from manimlib.imports import* + +class TheoremAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + + #----parabola: x**2+y**2 + parabola1 = 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_E], + resolution=(20, 20)).scale(1) + + #----parabola: -x**2-y**2 + parabola2 = 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_E,PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane + + parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.add(axes) + self.add_fixed_in_frame_mobjects(parabola2_text) + self.wait(1) + self.play(Write(parabola1)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) + self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + + self.wait(1) + self.add_fixed_in_frame_mobjects(parabola1_text) + self.wait(1) + self.play(Write(parabola2)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) -- cgit From b6de789e96b766e899195c8915017f76698380fa Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:17:06 +0530 Subject: Delete scalar_function_parabola_example.py --- .../scalar_function_parabola_example.py | 35 ---------------------- 1 file changed, 35 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_parabola_example.py (limited to 'FSF-2020') 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/scalar_function_parabola_example.py deleted file mode 100644 index 74dc063..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_parabola_example.py +++ /dev/null @@ -1,35 +0,0 @@ -from manimlib.imports import * - -class Parabola(ThreeDScene): - def construct(self): - axes = ThreeDAxes() # creates a 3D Axis - - paraboloid = ParametricSurface( - lambda u, v: np.array([ - 2*np.cosh(u)*np.cos(v), - 2*np.cosh(u)*np.sin(v), - 2*np.sinh(u) - ]),v_min=0,v_max=TAU,u_min=0,u_max=2,checkerboard_colors=[YELLOW_D, YELLOW_E], - resolution=(15, 32)) - - text3d = TextMobject(r"Plot of $f: \mathbb{R}^2 \rightarrow \mathbb{R}$", "z = f(x,y)") - self.add_fixed_in_frame_mobjects(text3d) - text3d[0].move_to(4*LEFT+2*DOWN) - text3d[1].next_to(text3d[0], DOWN) - text3d[0].set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) - text3d[1].set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE) - - #self.set_camera_orientation(phi=0 * DEGREES,theta=270*DEGREES) - self.move_camera(phi=110* DEGREES,theta=45*DEGREES) - self.add(axes) - self.play(ShowCreation(paraboloid)) - self.play(Write(text3d[0])) - self.play(Write(text3d[1])) - self.begin_ambient_camera_rotation(rate=0.2) - self.wait(3) - self.move_camera(phi=0 * DEGREES,theta=180*DEGREES,run_time=3) - self.wait(3) - self.move_camera(phi=110* DEGREES,theta=90*DEGREES,run_time=3) - self.wait(3) - - \ No newline at end of file -- cgit From d6f6012145d9b00b1a4b9c569e7dcffb92eb9d56 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:17:16 +0530 Subject: Delete scalar_function_neural_nets.py --- .../scalar_function_neural_nets.py | 177 --------------------- 1 file changed, 177 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_neural_nets.py (limited to 'FSF-2020') 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/scalar_function_neural_nets.py deleted file mode 100644 index eb6bf45..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_neural_nets.py +++ /dev/null @@ -1,177 +0,0 @@ -from manimlib.imports import * - -class SigmoidFunc(GraphScene): - CONFIG = { - "x_min": -4, - "x_max": 4, - "y_min": -1, - "y_max": 1, - "graph_origin": ORIGIN + 0.8*DOWN, - "x_labeled_nums": list(range(-4, 5)), - "y_labeled_nums": list(range(-1, 2)), - "y_axis_height": 4.5, - } - def construct(self): - XTD = self.x_axis_width/(self.x_max- self.x_min) - YTD = self.y_axis_height/(self.y_max- self.y_min) - - topic = TextMobject("Sigmoid Function") - topic.move_to(3.2*UP) - topic.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) - - self.setup_axes(animate = True) - sigmoid_func = self.get_graph(lambda x : (1/(1 + np.exp(-x))), x_min = -4, x_max = 4) - sigmoid_lab = self.get_graph_label(sigmoid_func, label = r"\frac{1}{1 + e^{-z}}") - - - - - self.play(ShowCreation(sigmoid_func),Write(sigmoid_lab)) - self.play(Write(topic)) - self.wait(2) - self.play(FadeOut(sigmoid_func), FadeOut(sigmoid_lab)) - self.wait(1) - - - -class NeuralNet(GraphScene): - def construct(self): - - sigmoid_exp = TextMobject(r"g(z) = g($\theta^T$ X) = $\frac{1}{1 + e^{-z}}$") - sigmoid_exp.move_to(3*UP + 4*LEFT) - sigmoid_exp.scale(0.8) - sigmoid_exp.set_color(BLUE) - sigmoid_exp1 = TextMobject(r"Predict: 'y = 1'",r"When g(z) $\geq$ 0.5, z $\geq$ 0, $\theta^T$ X $\geq$ 0") - sigmoid_exp2 = TextMobject(r"Predict: 'y = 0'", r"When g(z) $\leq$ 0.5, z $\leq$ 0, $\theta^T$ X $\leq$ 0") - sigmoid_exp1.scale(0.5) - sigmoid_exp2.scale(0.5) - sigmoid_exp1.set_color(PURPLE) - sigmoid_exp2.set_color(PURPLE) - - sigmoid_exp1[0].next_to(sigmoid_exp, 1.5*DOWN) - sigmoid_exp1[1].next_to(sigmoid_exp1[0], DOWN) - sigmoid_exp2[0].next_to(sigmoid_exp1[1], 1.5*DOWN) - sigmoid_exp2[1].next_to(sigmoid_exp2[0], DOWN) - - - self.play(Write(sigmoid_exp)) - self.play(Write(sigmoid_exp1[0]), Write(sigmoid_exp1[1])) - self.play(Write(sigmoid_exp2[0]), Write(sigmoid_exp2[1])) - self.wait(2) - - - neuron1 = Circle() - neuron1.set_fill(YELLOW_A, opacity = 0.5) - - neuron2 = Circle() - neuron2.set_fill(ORANGE, opacity = 0.5) - - neuron3 = Circle() - neuron3.set_fill(GREEN_E, opacity = 0.5) - - neuron1.move_to(2*UP+RIGHT) - neuron2.move_to(2*DOWN+RIGHT) - neuron3.move_to(4*RIGHT) - - arrow1 = Arrow(neuron1.get_right(),neuron3.get_left(),buff=0.1) - arrow1.set_color(RED) - arrow2 = Arrow(neuron2.get_right(),neuron3.get_left(),buff=0.1) - arrow2.set_color(RED) - - arrow3 = Arrow(neuron3.get_right(),7*RIGHT,buff=0.1) - arrow3.set_color(RED) - - - sign1 = TextMobject("+1") - sign1.move_to(2*UP+RIGHT) - sign1.scale(2) - sign2 = TextMobject(r"$x_1$") - sign2.move_to(2*DOWN+RIGHT) - sign2.scale(2) - sign3 = TextMobject(r"$h_{\theta}(x)$") - sign3.move_to(6*RIGHT+0.4*DOWN) - sign3.scale(0.7) - sign4 = TextMobject(r"$= g(10 - 20x_1)$") - sign4.next_to(sign3,DOWN) - sign4.scale(0.5) - sign5 = TextMobject(r"$= g(10 - 20x_1)$") - sign5.next_to(sign3,DOWN) - sign5.scale(0.5) - sign6 = TextMobject(r"$= g(10 - 20x_1)$") - sign6.next_to(sign3,DOWN) - sign6.scale(0.5) - - - weight1 = TextMobject("10") - weight1.next_to(arrow1,UP) - weight2 = TextMobject("-20") - weight2.next_to(arrow2,DOWN) - - gate = TextMobject("NOT GATE") - gate.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) - gate.scale(1.5) - gate.move_to(3*RIGHT+3.5*UP) - - - - truth_table = TextMobject(r"\begin{displaymath}\begin{array}{|c|c|} x & y\\ \hline 1 & 0 \\0 & 1 \\\end{array}\end{displaymath}") - truth_table.next_to(sigmoid_exp2[1], 3*DOWN) - - values = TextMobject("1", "0") - values.scale(2) - - sign4_trans1 = TextMobject(r"$= g(10 - 20(1))$") - sign4_trans2 = TextMobject(r"$= g(10 - 20(0))$") - sign4_trans1.next_to(sign3,DOWN) - sign4_trans2.next_to(sign3,DOWN) - sign4_trans1.scale(0.5) - sign4_trans2.scale(0.5) - - - - output1 = TextMobject("y = 0") - output2 = TextMobject("y = 1") - output1.next_to(sign4,DOWN) - output2.next_to(sign4,DOWN) - output1.scale(1.5) - output2.scale(1.5) - - - - self.play(ShowCreation(neuron1),ShowCreation(neuron2)) - self.play(ShowCreation(neuron3)) - self.play(ShowCreation(sign1),ShowCreation(sign2)) - self.wait(1) - - self.play(GrowArrow(arrow1)) - self.play(GrowArrow(arrow2)) - self.play(ShowCreation(weight1),ShowCreation(weight2)) - - - - self.play(GrowArrow(arrow3)) - self.play(Write(sign3),Write(sign4)) - - self.play(Write(gate)) - self.play(ShowCreation(truth_table)) - - self.play(ApplyMethod(values[0].move_to, 2*DOWN+RIGHT)) - self.play(FadeOut(values[0])) - self.play(Transform(sign4,sign4_trans1)) - self.play(Write(output1)) - self.wait(1) - self.play(FadeOut(output1)) - self.play(Transform(sign4, sign5)) - - - self.play(ApplyMethod(values[1].move_to, 2*DOWN+RIGHT)) - self.play(FadeOut(values[1])) - self.play(Transform(sign4,sign4_trans2)) - self.play(Write(output2)) - self.wait(1) - self.play(FadeOut(output2)) - self.play(Transform(sign4, sign6)) - - self.wait(2) - - -- cgit From 8bbc08351b26bff772c5a7b3e17aec3ee0d3392e Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:17:24 +0530 Subject: Delete scalar_function_domain_range.py --- .../scalar_function_domain_range.py | 132 --------------------- 1 file changed, 132 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_domain_range.py (limited to 'FSF-2020') 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/scalar_function_domain_range.py deleted file mode 100644 index 9b1ca7b..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_domain_range.py +++ /dev/null @@ -1,132 +0,0 @@ -# Plotting Graphs -from manimlib.imports import * - -class PlotGraphs(GraphScene): - CONFIG = { - "x_min": -5, - "x_max": 5, - "y_min": 0, - "y_max": 4, - "graph_origin": ORIGIN + 2.5* DOWN, - "x_labeled_nums": list(range(-5, 6)), - "y_labeled_nums": list(range(0, 5)), - } - def construct(self): - - topic = TextMobject("Domain and Range") - topic.scale(2) - topic.set_color(YELLOW) - self.play(Write(topic)) - self.play(FadeOut(topic)) - self.wait(1) - - - XTD = self.x_axis_width/(self.x_max- self.x_min) - YTD = self.y_axis_height/(self.y_max- self.y_min) - - self.setup_axes(animate = True) - - graphobj = self.get_graph(lambda x : np.sqrt(x + 4), x_min = -4, x_max = 5) - graph_lab = self.get_graph_label(graphobj, label = r"\sqrt{x + 4}") - - - rangeline1 = Arrow(self.graph_origin+2.2*YTD*UP+5*XTD*LEFT, self.graph_origin+4.1*YTD*UP+5*XTD*LEFT) - rangeline2 = Arrow(self.graph_origin+1.7*YTD*UP+5*XTD*LEFT, self.graph_origin+5*XTD*LEFT) - rangeline1.set_color(RED) - rangeline2.set_color(RED) - - rangeMsg = TextMobject(r"Range: $y \geq 0$") - rangeMsg.move_to(self.graph_origin+2*YTD*UP+5*XTD*LEFT) - rangeMsg.scale(0.5) - rangeMsg.set_color(YELLOW) - - domainline1 = Line(self.graph_origin+0.6*YTD*DOWN+1.2*XTD*LEFT, self.graph_origin+0.6*YTD*DOWN + 4*XTD*LEFT) - domainline2 = Arrow(self.graph_origin+0.6*YTD*DOWN+1.1*XTD*RIGHT, self.graph_origin+0.6*YTD*DOWN + 5.3*XTD*RIGHT) - domainline1.set_color(PINK) - domainline2.set_color(PINK) - - domainMsg = TextMobject(r"Domain: $x \geq -4$") - domainMsg.move_to(self.graph_origin+0.6*YTD*DOWN) - domainMsg.scale(0.5) - domainMsg.set_color(GREEN) - - - - - self.play(ShowCreation(graphobj)) - self.play(ShowCreation(graph_lab)) - self.wait(1) - self.play(GrowArrow(rangeline1)) - self.play(GrowArrow(rangeline2)) - self.play(Write(rangeMsg)) - self.wait(1) - self.play(GrowArrow(domainline1)) - self.play(GrowArrow(domainline2)) - self.play(Write(domainMsg)) - self.wait(3) - - self.wait(2) - - - - -class PlotSineGraphs(GraphScene): - CONFIG = { - "x_min": -8, - "x_max": 8, - "y_min": -1, - "y_max": 1, - "graph_origin": ORIGIN, - "x_labeled_nums": list(range(-8, 9)), - "y_labeled_nums": list(range(-1, 2)), - } - def construct(self): - - - - XTD = self.x_axis_width/(self.x_max- self.x_min) - YTD = self.y_axis_height/(self.y_max- self.y_min) - - self.setup_axes(animate = True) - - sineobj = self.get_graph(lambda x : np.sin(x), x_min = -7, x_max = 8) - sine_lab = self.get_graph_label(sineobj, label = "\\sin(x)") - - - rangeline1 = Line(8*XTD*LEFT,1*YTD*UP+8*XTD*LEFT) - rangeline2 = Line(8*XTD*LEFT,1*YTD*DOWN+8*XTD*LEFT) - rangeline1.set_color(RED) - rangeline2.set_color(RED) - - rangeMsg = TextMobject(r"Range: $-1 \leq y \leq 1$") - rangeMsg.move_to(1.1*YTD*UP+8.5*XTD*LEFT) - rangeMsg.scale(0.5) - rangeMsg.set_color(YELLOW) - - - domainline1 = Arrow(1.1*YTD*DOWN+2*XTD*LEFT, 1.1*YTD*DOWN + 8.5*XTD*LEFT) - domainline2 = Arrow(1.1*YTD*DOWN+2*XTD*RIGHT, 1.1*YTD*DOWN + 8.5*XTD*RIGHT) - domainline1.set_color(PINK) - domainline2.set_color(PINK) - - domainMsg = TextMobject(r"Domain: $[-\infty, \infty]$") - domainMsg.move_to(1.1*YTD*DOWN) - domainMsg.scale(0.5) - domainMsg.set_color(GREEN) - - - - self.play(ShowCreation(sineobj)) - self.play(ShowCreation(sine_lab)) - self.wait(1) - self.play(GrowArrow(rangeline1)) - self.play(GrowArrow(rangeline2)) - self.play(Write(rangeMsg)) - self.wait(1) - self.play(GrowArrow(domainline1)) - self.play(GrowArrow(domainline2)) - self.play(Write(domainMsg)) - self.wait(3) - - - \ No newline at end of file -- cgit From 54f1ced7c719db38c5f0801a097e360c459d1637 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:17:32 +0530 Subject: Delete scalar_function_application.py --- .../scalar_function_application.py | 129 --------------------- 1 file changed, 129 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_application.py (limited to 'FSF-2020') 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/scalar_function_application.py deleted file mode 100644 index 56b3e53..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/scalar_function_application.py +++ /dev/null @@ -1,129 +0,0 @@ -from manimlib.imports import * - -class ScalarApplication(ThreeDScene): - def construct(self): - axes = ThreeDAxes() # creates a 3D Axis - - cube = Cube() - cube.set_fill(YELLOW_E, opacity = 0.1) - cube.scale(2) - self.set_camera_orientation(phi=0 * DEGREES,theta=270*DEGREES) - self.play(ShowCreation(cube),ShowCreation(axes)) - - dot = Sphere() - dot.scale(0.1) - dot.move_to(np.array([1,0.5,1])) - dot.set_fill(RED) - - #dot = Dot(np.array([1,0.5,1]), color = RED) - temp_func = TextMobject("T(x,y,z)") - temp_func.next_to(dot,RIGHT) - temp_func.set_color(RED) - temp_func_trans = TextMobject("T(1,0.5,1)") - temp_func_trans.next_to(dot,RIGHT) - temp_func_trans.set_color(RED) - temp = TextMobject(r"$36 ^\circ$") - temp.next_to(dot,RIGHT) - temp.set_color(RED_E) - - - self.play(ShowCreation(dot)) - self.play(ShowCreation(temp_func)) - self.play(Transform(temp_func, temp_func_trans)) - self.wait(1) - self.play(Transform(temp_func, temp)) - - - - - dot1 = Sphere() - dot1.scale(0.1) - dot1.move_to(np.array([-1,-0.8,-1.5])) - dot1.set_fill(BLUE_E) - #dot1 = Dot(np.array([-1,-0.8,-1.5]), color = BLUE) - temp_func1 = TextMobject("T(x,y,z)") - temp_func1.next_to(dot1,LEFT) - temp_func1.set_color(BLUE) - temp_func_trans1 = TextMobject("T(-1,-0.8,-1.5)") - temp_func_trans1.next_to(dot1,LEFT) - temp_func_trans1.set_color(BLUE) - temp1 = TextMobject(r"$24 ^\circ$") - temp1.next_to(dot1,LEFT) - temp1.set_color(BLUE) - - self.play(ShowCreation(dot1)) - self.play(ShowCreation(temp_func1)) - self.play(Transform(temp_func1, temp_func_trans1)) - self.wait(1) - self.play(Transform(temp_func1, temp1)) - - self.play(FadeOut(temp_func)) - self.play(FadeOut(temp_func1)) - - - self.move_camera(phi=80* DEGREES,theta=45*DEGREES,run_time=3) - - self.begin_ambient_camera_rotation(rate=0.2) - self.wait(4) - self.stop_ambient_camera_rotation() - self.wait(2) - - - - -class AddTempScale(Scene): - def construct(self): - temp_scale = ImageMobject("tempscale.png") - temp_scale.scale(4) - temp_scale.move_to(2*RIGHT) - self.play(ShowCreation(temp_scale)) - - - temp_func = TextMobject("T(x,y,z)") - temp_func.move_to(3*UP +2*LEFT) - temp_func.set_color(RED) - temp_func_trans = TextMobject("T(1,0.5,1)") - temp_func_trans.move_to(3*UP +2*LEFT) - temp_func_trans.set_color(RED) - temp = TextMobject(r"$36 ^\circ$") - temp.set_color(RED) - temp.move_to(3*UP +2*LEFT) - temp.scale(0.7) - - self.play(ShowCreation(temp_func)) - self.play(Transform(temp_func, temp_func_trans)) - self.wait(1) - self.play(Transform(temp_func, temp)) - self.play(ApplyMethod(temp_func.move_to, 1.8*UP +1.8*RIGHT)) - - - temp_func1 = TextMobject("T(x,y,z)") - temp_func1.move_to(2*UP +2*LEFT) - temp_func1.set_color(BLUE) - temp_func_trans1 = TextMobject("T(-1,-0.8,-1.5)") - temp_func_trans1.move_to(2*UP +2*LEFT) - temp_func_trans1.set_color(BLUE) - temp1 = TextMobject(r"$24 ^\circ$") - temp1.set_color(BLUE) - temp1.move_to(2*UP +2*LEFT) - temp1.scale(0.7) - - self.play(ShowCreation(temp_func1)) - self.play(Transform(temp_func1, temp_func_trans1)) - self.wait(1) - self.play(Transform(temp_func1, temp1)) - self.play(ApplyMethod(temp_func1.move_to, 0.6*UP +1.8*RIGHT)) - - - - transtext = TextMobject("Scalar Function Transform:") - transtext.set_color(GREEN) - transtext1 = TextMobject(r"$\mathbb{R}^3 \rightarrow \mathbb{R}$") - transtext1.set_color(YELLOW_E) - transtext.move_to(3*UP +3*LEFT) - transtext1.next_to(transtext,DOWN) - self.play(Write(transtext)) - self.play(Write(transtext1)) - self.wait(2) - - -- cgit From 58ddbb958fc1ac480567f2350ecbdecc63a3fd95 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:17:40 +0530 Subject: Delete Scalar_Function_Quiz.pdf --- .../Scalar Functions/Scalar_Function_Quiz.pdf | Bin 87455 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/Scalar_Function_Quiz.pdf (limited to 'FSF-2020') 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 deleted file mode 100644 index 6d94a2c..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/Scalar_Function_Quiz.pdf and /dev/null differ -- cgit From 3aa621d1008073c3c49a33b1bffedb6e9983fd03 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:18:04 +0530 Subject: Delete scalar_function_parabola_example.gif --- .../gifs/scalar_function_parabola_example.gif | Bin 905534 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_parabola_example.gif (limited to 'FSF-2020') 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/scalar_function_parabola_example.gif deleted file mode 100644 index 3fdecf4..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_parabola_example.gif and /dev/null differ -- cgit From dd9043d91bbbf2b0cf6b5a4a632a671cb8a2d929 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:18:13 +0530 Subject: Delete scalar_function_neural_nets.gif --- .../gifs/scalar_function_neural_nets.gif | Bin 95828 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_neural_nets.gif (limited to 'FSF-2020') 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/scalar_function_neural_nets.gif deleted file mode 100644 index 9d24688..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_neural_nets.gif and /dev/null differ -- cgit From c622a0175e0a017cb05fb7af8d130f882fa83ae2 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:18:21 +0530 Subject: Delete scalar_function_level_curves2.gif --- .../gifs/scalar_function_level_curves2.gif | Bin 893426 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves2.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 724c27d..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves2.gif and /dev/null differ -- cgit From 18313c23484ba13001b2d149f1702173ed7a8140 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:18:30 +0530 Subject: Delete scalar_function_level_curves.gif --- .../gifs/scalar_function_level_curves.gif | Bin 245384 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 2df2fde..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_level_curves.gif and /dev/null differ -- cgit From 1a9c20fd31274791c8a8d493a1e0a8d93e1ee9a1 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:18:40 +0530 Subject: Delete scalar_function_application.gif --- .../gifs/scalar_function_application.gif | Bin 225144 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_application.gif (limited to 'FSF-2020') 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/scalar_function_application.gif deleted file mode 100644 index 831ec8e..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/scalar_function_application.gif and /dev/null differ -- cgit From 7e4f501a3873b76a6c14586fb6f14f210243a67b Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:18:49 +0530 Subject: Delete domain_range.gif --- .../Scalar Functions/gifs/domain_range.gif | Bin 74879 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/domain_range.gif (limited to 'FSF-2020') 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/domain_range.gif deleted file mode 100644 index d0351e5..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Scalar Functions/gifs/domain_range.gif and /dev/null differ -- cgit From 80dd36e43b3f884b7b352af7e0cebb9cb5275452 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:19:07 +0530 Subject: Delete multivariable_func_vectorvf_sine.py --- .../multivariable_func_vectorvf_sine.py | 91 ---------------------- 1 file changed, 91 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_vectorvf_sine.py (limited to 'FSF-2020') 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/multivariable_func_vectorvf_sine.py deleted file mode 100644 index 06e225e..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_vectorvf_sine.py +++ /dev/null @@ -1,91 +0,0 @@ -from manimlib.imports import * - -class SineVectors(GraphScene): - CONFIG = { - "x_min": 0, - "x_max": 10, - "y_min": -1, - "y_max": 1, - "graph_origin": ORIGIN+4*LEFT, - #"x_labeled_nums": list(range(-5, 6)), - #"y_labeled_nums": list(range(0, 5)), - } - def construct(self): - - - - - - XTD = self.x_axis_width/(self.x_max - self.x_min) - YTD = self.y_axis_height/(self.y_max - self.y_min) - - self.setup_axes(animate = True) - - - sine1 = self.get_graph(lambda x : np.sin(x), x_min = 0, x_max = 1.575, color = GREEN) - - point1 = Dot().shift(self.graph_origin+1*YTD*UP + 1.575*XTD*RIGHT) - point1_lab = TextMobject(r"$t = (\frac{\pi}{2})$") - point1_lab.scale(0.7) - point1_lab.next_to(point1, UP) - - vector1 = Arrow(self.graph_origin, self.graph_origin+1*YTD*UP + 1.575*XTD*RIGHT, buff=0.1, color = RED) - vector1_lab = TextMobject(r"$r(\frac{\pi}{2})$", color = RED) - vector1_lab.move_to(self.graph_origin+1.5*XTD*RIGHT+ 0.5*YTD*UP) - - self.play(GrowArrow(vector1),Write(vector1_lab)) - self.play(ShowCreation(point1), Write(point1_lab)) - self.play(ShowCreation(sine1)) - self.wait(1) - - - sine2 = self.get_graph(lambda x : np.sin(x), x_min = 1.575, x_max = 3.15, color = GREEN) - - point2 = Dot().shift(self.graph_origin+3.15*XTD*RIGHT) - point2_lab = TextMobject(r"$t = (\pi)$") - point2_lab.scale(0.7) - point2_lab.next_to(point2, UP+RIGHT) - - vector2 = Arrow(self.graph_origin, self.graph_origin+3.15*XTD*RIGHT, buff=0.1, color = BLUE) - vector2_lab = TextMobject(r"$r(\pi)$", color = BLUE) - vector2_lab.move_to(self.graph_origin+1.5*XTD*RIGHT+ 0.15*YTD*UP) - - self.play(GrowArrow(vector2),Write(vector2_lab)) - self.play(ShowCreation(point2), Write(point2_lab)) - self.play(ShowCreation(sine2)) - self.wait(1) - - - sine3 = self.get_graph(lambda x : np.sin(x), x_min = 3.15, x_max = 4.725, color = GREEN) - - point3 = Dot().shift(self.graph_origin+1*YTD*DOWN + 4.725*XTD*RIGHT) - point3_lab = TextMobject(r"$t = (\frac{3\pi}{2})$") - point3_lab.scale(0.7) - point3_lab.next_to(point3, DOWN) - - vector3 = Arrow(self.graph_origin, self.graph_origin+1*YTD*DOWN + 4.725*XTD*RIGHT, buff=0.1, color = YELLOW_C) - vector3_lab = TextMobject(r"$r(\frac{3\pi}{2})$", color = YELLOW_C) - vector3_lab.move_to(self.graph_origin+2*XTD*RIGHT+ 0.7*YTD*DOWN) - - self.play(GrowArrow(vector3),Write(vector3_lab)) - self.play(ShowCreation(point3), Write(point3_lab)) - self.play(ShowCreation(sine3)) - self.wait(1) - - - sine4 = self.get_graph(lambda x : np.sin(x), x_min = 4.725, x_max = 6.3, color = GREEN) - - point4 = Dot().shift(self.graph_origin+6.3*XTD*RIGHT) - point4_lab = TextMobject(r"$t = (2\pi)$") - point4_lab.scale(0.7) - point4_lab.next_to(point4, UP+RIGHT) - - vector4 = Arrow(self.graph_origin, self.graph_origin+6.3*XTD*RIGHT, buff=0.1, color = PURPLE) - vector4_lab = TextMobject(r"$r(2\pi)$", color = PURPLE) - vector4_lab.move_to(self.graph_origin+4.5*XTD*RIGHT+ 0.15*YTD*DOWN) - - self.play(GrowArrow(vector4),Write(vector4_lab)) - self.play(ShowCreation(point4), Write(point4_lab)) - self.play(ShowCreation(sine4)) - self.wait(3) - -- cgit From b1d37a71c5b9d80a9487092aaa548082929657ad Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:19:16 +0530 Subject: Delete multivariable_func_respresntation.py --- .../multivariable_func_respresntation.py | 80 ---------------------- 1 file changed, 80 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_respresntation.py (limited to 'FSF-2020') 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/multivariable_func_respresntation.py deleted file mode 100644 index 4bfcf21..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_respresntation.py +++ /dev/null @@ -1,80 +0,0 @@ -from manimlib.imports import * - -class MultivariableFunc(Scene): - def construct(self): - - topic = TextMobject("Multivariable Functions") - topic.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) - topic.scale(2) - - self.play(Write(topic)) - self.wait(1) - self.play(FadeOut(topic)) - - - circle = Circle() - circle.scale(3) - - eqn1 = TextMobject(r"f(x,y) = $x^2y$") - eqn1.set_color(YELLOW) - - - - number1 = TextMobject("(2,1)") - number1.move_to(3*UP+ 3*LEFT) - number1.scale(1.2) - number1.set_color(GREEN) - - output1 = TextMobject("4") - output1.scale(1.5) - output1.set_color(BLUE) - - eqn1_1 = TextMobject(r"f(2,1) = $2^2(1)$") - eqn1_1.set_color(YELLOW) - - - self.play(ShowCreation(circle),Write(eqn1)) - self.wait(1) - self.play(ApplyMethod(number1.move_to, 0.6*LEFT)) - self.play(FadeOut(number1)) - self.play(Transform(eqn1, eqn1_1)) - self.wait(1) - self.play(ApplyMethod(output1.move_to, 3*DOWN+4*RIGHT)) - self.wait(1) - self.play(FadeOut(output1)) - - - eqn2 = TextMobject(r"f(x,y,z) = $x^2y+2yz$") - eqn2.set_color(YELLOW) - - number2 = TextMobject("(2,1,3)") - number2.move_to(3*UP+ 3*LEFT) - number2.scale(1.2) - number2.set_color(GREEN) - - output2 = TextMobject("8") - output2.scale(1.5) - output2.set_color(BLUE) - - eqn2_1 = TextMobject(r"f(2,1,3) = $2^2(1) + 2(1)(3)$") - eqn2_1.set_color(YELLOW) - - eqn2_2 = TextMobject(r"f(2,1,3) = $2 + 6$") - eqn2_2.set_color(YELLOW) - - - - self.play(FadeOut(eqn1)) - self.play(Write(eqn2)) - - self.wait(1) - self.play(ApplyMethod(number2.move_to, 1.2*LEFT)) - self.play(FadeOut(number2)) - self.play(Transform(eqn2, eqn2_1)) - self.wait(1) - self.play(Transform(eqn2, eqn2_2)) - self.wait(1) - self.play(ApplyMethod(output2.move_to, 3*DOWN+4*RIGHT)) - self.wait(1) - self.play(FadeOut(output2),FadeOut(eqn2),FadeOut(circle)) - self.wait(2) \ No newline at end of file -- cgit From 4f83639077a36f1775c3c063f0b6be1c40097247 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:19:24 +0530 Subject: Delete multivariable_func_plot_sphere.py --- .../multivariable_func_plot_sphere.py | 42 ---------------------- 1 file changed, 42 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_plot_sphere.py (limited to 'FSF-2020') 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/multivariable_func_plot_sphere.py deleted file mode 100644 index baf08b1..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_plot_sphere.py +++ /dev/null @@ -1,42 +0,0 @@ -from manimlib.imports import * - -class Sphere(ThreeDScene): - def construct(self): - axes = ThreeDAxes() # creates a 3D Axis - - sphere = ParametricSurface( - lambda u, v: np.array([ - np.sin(u)*np.cos(v), - np.sin(u)*np.sin(v), - np.cos(u) - ]),u_min=0,u_max=PI,v_min=0,v_max=2*PI,checkerboard_colors=[RED_D, RED_E], - resolution=(15, 32)).scale(2) - - - - #self.set_camera_orientation(phi=0 * DEGREES,theta=270*DEGREES) - - text3d = TextMobject(r"$f(x,y) \rightarrow Point(x,y,z)$") - text3d1 = TextMobject(r"$f(x,y) \rightarrow Point(x,y, 1 - x^2 - y^2)$") - self.add_fixed_in_frame_mobjects(text3d) - text3d.scale(0.7) - text3d1.scale(0.7) - text3d.to_corner(UL) - text3d1.to_corner(UL) - text3d.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) - text3d1.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) - self.play(Write(text3d)) - self.wait(1) - - self.play(Transform(text3d,text3d1)) - self.add_fixed_in_frame_mobjects(text3d1) - self.play(FadeOut(text3d)) - - - self.set_camera_orientation(phi=75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.3) - - - self.add(axes) - self.play(Write(sphere)) - self.wait(5) \ No newline at end of file -- cgit From 9046a816f265c4f1e99c65a919d2d8240f4118a0 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:19:32 +0530 Subject: Delete multivariable_func_examples.py --- .../multivariable_func_examples.py | 69 ---------------------- 1 file changed, 69 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_examples.py (limited to 'FSF-2020') 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/multivariable_func_examples.py deleted file mode 100644 index 7322e47..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_examples.py +++ /dev/null @@ -1,69 +0,0 @@ -from manimlib.imports import * - -class Examples(GraphScene): - def construct(self): - - rectangle = Rectangle(height = 3, width = 4, color = GREEN) - square = Square(side_length = 5, color = PURPLE) - circle = Circle(radius = 2, color = PINK) - radius = Line(ORIGIN,2*RIGHT) - - radius.set_color(RED) - - rectangle_area_func = TextMobject(r"$Area = f(Length, Breadth)$") - rectangle_area_func.scale(0.6) - square_area_func = TextMobject(r"$Area = f(Length)$") - circle_area_func = TextMobject(r"$Area = f(r)$") - - - rectangle_area = TextMobject(r"$Area = Length \times Breadth$") - rectangle_area.scale(0.6) - square_area = TextMobject(r"$Area = Length^2$") - circle_area = TextMobject(r"$Area = \pi r^2$") - - braces_rect1 = Brace(rectangle, LEFT) - eq_text1 = braces_rect1.get_text("Length") - braces_rect2 = Brace(rectangle, UP) - eq_text2 = braces_rect2.get_text("Breadth") - - braces_square = Brace(square, LEFT) - braces_square_text = braces_square.get_text("Length") - - radius_text = TextMobject("r") - radius_text.next_to(radius,UP) - - - - self.play(ShowCreation(rectangle)) - self.wait(1) - self.play(GrowFromCenter(braces_rect1),Write(eq_text1),GrowFromCenter(braces_rect2),Write(eq_text2)) - self.wait(1) - self.play(Write(rectangle_area_func)) - self.wait(1) - self.play(Transform(rectangle_area_func, rectangle_area)) - self.wait(1) - self.play(FadeOut(braces_rect1),FadeOut(eq_text1),FadeOut(braces_rect2),FadeOut(eq_text2),FadeOut(rectangle_area_func)) - - - self.play(Transform(rectangle, square)) - self.wait(1) - self.play(GrowFromCenter(braces_square),Write(braces_square_text)) - self.wait(1) - self.play(Write(square_area_func)) - self.wait(1) - self.play(Transform(square_area_func, square_area)) - self.wait(1) - self.play(FadeOut(braces_square),FadeOut(braces_square_text),FadeOut(square_area_func)) - - - self.play(Transform(rectangle, circle)) - self.wait(1) - self.play(ShowCreation(radius),Write(radius_text)) - self.wait(1) - self.play(FadeOut(radius_text),FadeOut(radius)) - self.wait(1) - self.play(Write(circle_area_func)) - self.wait(1) - self.play(Transform(circle_area_func, circle_area)) - self.wait(1) - self.play(FadeOut(circle_area_func)) \ No newline at end of file -- cgit From f2ff715f096058647093dbafab8912487ffcb886 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:19:32 +0530 Subject: Add files via upload --- .../file2_Tangent plane at extrema of a function.mp4 | Bin 0 -> 3483550 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 new file mode 100644 index 0000000..75657be Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 differ -- cgit From ae89b51ed274c28c5351113b9a37beb0eeb0c487 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:19:40 +0530 Subject: Delete multivariable_func_derivative_vectorvf.py --- .../multivariable_func_derivative_vectorvf.py | 247 --------------------- 1 file changed, 247 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_derivative_vectorvf.py (limited to 'FSF-2020') 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/multivariable_func_derivative_vectorvf.py deleted file mode 100644 index 466e389..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/multivariable_func_derivative_vectorvf.py +++ /dev/null @@ -1,247 +0,0 @@ -from manimlib.imports import * - -class Derivative(GraphScene): - CONFIG = { - "x_min": 0, - "x_max": 3, - "y_min": 0, - "y_max": 5, - "graph_origin": ORIGIN+6*LEFT+3*DOWN, - "x_axis_width": 6, - "x_labeled_nums": list(range(0, 4)), - "y_labeled_nums": list(range(0, 6)), - } - def construct(self): - - XTD = self.x_axis_width/(self.x_max - self.x_min) - YTD = self.y_axis_height/(self.y_max - self.y_min) - - self.setup_axes(animate = True) - - graph = self.get_graph(lambda x : x*x, x_min = 0.5, x_max = 2, color = GREEN) - - point1 = Dot().shift(self.graph_origin+0.25*YTD*UP + 0.5*XTD*RIGHT) - point1_lab = TextMobject(r"$t = a$") - point1_lab.scale(0.7) - point1_lab.next_to(point1, RIGHT) - - point2 = Dot().shift(self.graph_origin+2*XTD*RIGHT+4*YTD*UP) - point2_lab = TextMobject(r"$t = b$") - point2_lab.scale(0.7) - point2_lab.next_to(point2, RIGHT) - - - vector1 = Arrow(self.graph_origin, self.graph_origin+1*YTD*UP + 1*XTD*RIGHT, buff=0.02, color = RED) - vector1_lab = TextMobject(r"$\vec r(t)$", color = RED) - vector1_lab.move_to(self.graph_origin+1.2*XTD*RIGHT+ 0.75*YTD*UP) - vector1_lab.scale(0.8) - - vector2 = Arrow(self.graph_origin, self.graph_origin+2.25*YTD*UP + 1.5*XTD*RIGHT, buff=0.02, color = YELLOW_C) - vector2_lab = TextMobject(r"$\vec r(t + h)$", color = YELLOW_C) - vector2_lab.move_to(self.graph_origin+0.5*XTD*RIGHT+ 2*YTD*UP) - vector2_lab.scale(0.8) - - vector3 = Arrow(self.graph_origin+1*YTD*UP + 1*XTD*RIGHT, self.graph_origin+2.25*YTD*UP + 1.5*XTD*RIGHT, buff=0.02, color = PINK) - vector3_lab = TextMobject(r"$\vec r(t + h) - \vec r(t)$", color = PINK) - vector3_lab.move_to(self.graph_origin+2*XTD*RIGHT+ 1.5*YTD*UP) - vector3_lab.scale(0.8) - - - self.play(ShowCreation(graph)) - self.play(ShowCreation(point1), Write(point1_lab)) - self.play(ShowCreation(point2), Write(point2_lab)) - - self.play(GrowArrow(vector1),Write(vector1_lab)) - self.play(GrowArrow(vector2),Write(vector2_lab)) - self.play(GrowArrow(vector3),Write(vector3_lab)) - self.wait(1) - - self.display_text() - - self.play(ApplyMethod(vector3_lab.move_to,(self.graph_origin+2.3*XTD*RIGHT+ 2.2*YTD*UP))) - - vector4 = Arrow(self.graph_origin+1*YTD*UP + 1*XTD*RIGHT, self.graph_origin+1*YTD*UP + 1.5*XTD*RIGHT, buff=0.02, color = PURPLE) - vector4_lab = TextMobject(r"$dx$", color = PURPLE) - vector4_lab.move_to(self.graph_origin+1.7*XTD*RIGHT+ 0.8*YTD*UP) - vector4_lab.scale(0.7) - - vector5 = Arrow(self.graph_origin+1*YTD*UP + 1.5*XTD*RIGHT, self.graph_origin+2.25*YTD*UP + 1.5*XTD*RIGHT, buff=0.02, color = ORANGE) - vector5_lab = TextMobject(r"$dy$", color = ORANGE) - vector5_lab.move_to(self.graph_origin+1.7*XTD*RIGHT+ 1.4*YTD*UP) - vector5_lab.scale(0.7) - - self.play(GrowArrow(vector4),Write(vector4_lab)) - self.play(GrowArrow(vector5),Write(vector5_lab)) - self.wait(2) - - - - def display_text(self): - text1 = TextMobject(r"$\vec r(t)$",r"+", r"$\vec r(t + h) - \vec r(t)$") - text1[0].set_color(RED) - text1[2].set_color(PINK) - text1.scale(0.7) - - text2 = TextMobject(r"$\vec r(t + h)$", color = YELLOW_C) - text2.scale(0.7) - - text3 = TextMobject(r"$ \vec r(t + h) - \vec r(t)$", color = PINK) - text3.scale(0.7) - - text4 = TextMobject(r"[", r"$x(t+h)$", r"$\vec i$", r"+", r"$y(t+h)$", r"$\vec j$", r"$] - [$", r"$x(t)$", r"$\vec i$", r"+", r"y(t)", r"$\vec j$", r"]") - text4.set_color_by_tex(r"\vec i", BLUE) - text4.set_color_by_tex(r"\vec j", GREEN) - text4[1].set_color(YELLOW_C) - text4[4].set_color(YELLOW_C) - text4[-6].set_color(RED) - text4[-3].set_color(RED) - text4.scale(0.7) - - text5 = TextMobject(r"$[x(t+h) - x(t)]$", r"$\vec i$", r"+", r"$[y(t+h) + y(t)]$", r"$\vec j$") - text5.set_color_by_tex(r"\vec i", BLUE) - text5.set_color_by_tex(r"\vec j", GREEN) - text5[0].set_color(PURPLE) - text5[3].set_color(ORANGE) - text5.scale(0.7) - - text6 = TextMobject(r"$\frac{[\vec r(t + h) - \vec r(t)]}{h}$", r"=", r"$\frac{[x(t+h) - x(t)]}{h}$", r"$\vec i$", r"+", r"$\frac{[y(t+h) + y(t)]}{h}$", r"$\vec j$") - text6.set_color_by_tex(r"\vec i", BLUE) - text6.set_color_by_tex(r"\vec j", GREEN) - text6[0].set_color(PINK) - text6[2].set_color(PURPLE) - text6[-2].set_color(ORANGE) - text6.scale(0.8) - - text7 = TextMobject(r"$\lim_{h \rightarrow 0}$", r"$\frac{[\vec r(t + h) - \vec r(t)]}{h}$", r"=", r"$\lim_{h \rightarrow 0}$", r"$\frac{[x(t+h) - x(t)]}{h}$", r"$\vec i$", r"+", r"$\lim_{h \rightarrow 0}$", r"$\frac{[y(t+h) + y(t)]}{h}$", r"$\vec j$") - text7.set_color_by_tex(r"\vec i", BLUE) - text7.set_color_by_tex(r"\vec j", GREEN) - text7[1].set_color(PINK) - text7[4].set_color(PURPLE) - text7[-2].set_color(ORANGE) - text7.scale(0.6) - - text8 = TextMobject(r"$\vec r'(t)$", r"=",r"$\vec x'(t)$", r"$\vec i$", r"+", r"$\vec y'(t)$", r"$\vec j$") - text8.set_color_by_tex(r"\vec i", BLUE) - text8.set_color_by_tex(r"\vec j", GREEN) - text8[0].set_color(PINK) - text8[2].set_color(PURPLE) - text8[5].set_color(ORANGE) - text8.scale(0.7) - - text9 = TextMobject(r"$\frac{d \vec r}{dt}$", r"=", r"$\frac{d \vec x}{dt}$", r"$\vec i$", r"+", r"$\frac{d \vec y}{dt}$", r"$\vec j$") - text9.set_color_by_tex(r"\vec i", BLUE) - text9.set_color_by_tex(r"\vec j", GREEN) - text9[0].set_color(PINK) - text9[2].set_color(PURPLE) - text9[5].set_color(ORANGE) - text9.scale(0.7) - - - text10 = TextMobject(r"$d \vec r$", r"=", r"$\frac{d \vec x}{dt}dt$", r"$\vec i$", r"+", r"$\frac{d \vec y}{dt}dt$", r"$\vec j$") - text10.set_color_by_tex(r"\vec i", BLUE) - text10.set_color_by_tex(r"\vec j", GREEN) - text10[0].set_color(PINK) - text10[2].set_color(PURPLE) - text10[5].set_color(ORANGE) - text10.scale(0.7) - - text11 = TextMobject(r"$d \vec r$", r"=", r"$x'(t)dt$", r"$\vec i$", r"+", r"$y'(t)dt$", r"$\vec j$") - text11.set_color_by_tex(r"\vec i", BLUE) - text11.set_color_by_tex(r"\vec j", GREEN) - text11[0].set_color(PINK) - text11[2].set_color(PURPLE) - text11[5].set_color(ORANGE) - text11.scale(0.7) - - text12 = TextMobject(r"$d \vec r$", r"=", r"$dx$", r"$\vec i$", r"+", r"$dy$", r"$\vec j$") - text12.set_color_by_tex(r"\vec i", BLUE) - text12.set_color_by_tex(r"\vec j", GREEN) - text12[0].set_color(PINK) - text12[2].set_color(PURPLE) - text12[5].set_color(ORANGE) - text12.scale(0.7) - - - text1.move_to(1*UP+2.7*RIGHT) - text2.move_to(1*UP+2.7*RIGHT) - text3.move_to(1*UP+2.7*RIGHT) - text4.move_to(1*UP+2.7*RIGHT) - text5.move_to(1*UP+2.7*RIGHT) - text6.move_to(1*UP+2.7*RIGHT) - text7.move_to(1*UP+2.5*RIGHT) - text8.move_to(1*UP+2.7*RIGHT) - text9.move_to(1*UP+2.7*RIGHT) - text10.move_to(1*UP+2.7*RIGHT) - text11.move_to(1*UP+2.7*RIGHT) - text12.move_to(1*UP+2.7*RIGHT) - - brace1 = Brace(text7[0:2], DOWN, buff = SMALL_BUFF) - brace2 = Brace(text7[3:6], UP, buff = SMALL_BUFF) - brace3 = Brace(text7[7:], DOWN, buff = SMALL_BUFF) - t1 = brace1.get_text(r"$\vec r'(t)$") - t1.set_color(PINK) - - t2 = brace2.get_text(r"$\vec x'(t)$") - t2.set_color(PURPLE) - - t3 = brace3.get_text(r"$\vec y'(t)$") - t3.set_color(ORANGE) - - - self.play(Write(text1)) - self.play(Transform(text1, text2)) - self.wait(1) - - self.play(Transform(text1, text3)) - self.wait(1) - - self.play(Transform(text1, text4)) - self.wait(1) - - self.play(Transform(text1, text5)) - self.wait(1) - - self.play(Transform(text1, text6)) - self.wait(1) - - self.play(Transform(text1, text7)) - self.wait(1) - - self.play( - GrowFromCenter(brace1), - FadeIn(t1), - ) - self.wait() - self.play( - ReplacementTransform(brace1.copy(),brace2), - ReplacementTransform(t1.copy(),t2) - ) - self.wait() - self.play( - ReplacementTransform(brace2.copy(),brace3), - ReplacementTransform(t2.copy(),t3) - ) - self.wait() - - self.play(FadeOut(brace1), FadeOut(t1), FadeOut(brace2), FadeOut(t2), FadeOut(brace3), FadeOut(t3),) - self.wait() - - self.play(Transform(text1, text8)) - self.wait(1) - - self.play(Transform(text1, text9)) - self.wait(1) - - self.play(Transform(text1, text10)) - self.wait(1) - - self.play(Transform(text1, text11)) - self.wait(1) - - self.play(Transform(text1, text12)) - self.wait(1) - - - - - -- cgit From 8efa8b48786fdad5b4041239584fb561bcc6e09e Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:19:48 +0530 Subject: Delete Multivariable_Functions_Quiz.pdf --- .../Multivariable_Functions_Quiz.pdf | Bin 109631 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/Multivariable_Functions_Quiz.pdf (limited to 'FSF-2020') 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 deleted file mode 100644 index 7895843..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/Multivariable_Functions_Quiz.pdf and /dev/null differ -- cgit From 8a4169e79d266f3c1de05dc4ca4ae1455ad44733 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:19:59 +0530 Subject: Delete multivariable_func_vectorvf_sine.gif --- .../gifs/multivariable_func_vectorvf_sine.gif | Bin 29814 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_vectorvf_sine.gif (limited to 'FSF-2020') 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/multivariable_func_vectorvf_sine.gif deleted file mode 100644 index 4f6b931..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_vectorvf_sine.gif and /dev/null differ -- cgit From ec0eaf91e660704750ec9490aee64cd5f35076b8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:20:06 +0530 Subject: Delete file 3_Visualization of types of critical points.gif.mp4 --- ..._Visualization of types of critical points.gif.mp4 | Bin 1035267 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 deleted file mode 100644 index ea6b781..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 and /dev/null differ -- cgit From 4634d7d86485e311656c284865b148df3eb32311 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:20:08 +0530 Subject: Delete multivariable_func_respresntation.gif --- .../gifs/multivariable_func_respresntation.gif | Bin 73055 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_respresntation.gif (limited to 'FSF-2020') 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/multivariable_func_respresntation.gif deleted file mode 100644 index a173bda..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_respresntation.gif and /dev/null differ -- cgit From d4a743c0cd3a7213f74584e5e66af3a256c347c1 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:20:16 +0530 Subject: Delete multivariable_func_plot_sphere.gif --- .../gifs/multivariable_func_plot_sphere.gif | Bin 198324 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_plot_sphere.gif (limited to 'FSF-2020') 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/multivariable_func_plot_sphere.gif deleted file mode 100644 index ad7582c..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_plot_sphere.gif and /dev/null differ -- cgit From 13f38fa93f34b60d6998a7111c2bb6cb62c90446 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:20:16 +0530 Subject: Delete file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 --- .../file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 | Bin 2542434 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 deleted file mode 100644 index b01d279..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 and /dev/null differ -- cgit From 693f36507eab8073fdd5fead632139a8f2dbcf40 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:20:25 +0530 Subject: Delete multivariable_func_examples.gif --- .../gifs/multivariable_func_examples.gif | Bin 57945 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_examples.gif (limited to 'FSF-2020') 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/multivariable_func_examples.gif deleted file mode 100644 index 11f66f1..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_examples.gif and /dev/null differ -- cgit From 9834675082d4ec9ab0b765348eb03194eb12c834 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:20:33 +0530 Subject: Delete multivariable_func_derivative_vectorvf.gif --- .../gifs/multivariable_func_derivative_vectorvf.gif | Bin 117597 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_derivative_vectorvf.gif (limited to 'FSF-2020') 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/multivariable_func_derivative_vectorvf.gif deleted file mode 100644 index a94de90..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Multivariable Functions/gifs/multivariable_func_derivative_vectorvf.gif and /dev/null differ -- cgit From 5d91fddefadc72abbdfe9961cd38b48c77b60abd Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:20:46 +0530 Subject: Delete limit_approach_point.py --- .../limit_approach_point.py | 66 ---------------------- 1 file changed, 66 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Limits and Continuity of Multivariable Functions/limit_approach_point.py (limited to 'FSF-2020') 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/limit_approach_point.py deleted file mode 100644 index 57d1d45..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Limits and Continuity of Multivariable Functions/limit_approach_point.py +++ /dev/null @@ -1,66 +0,0 @@ -from manimlib.imports import * - -class Limit(GraphScene): - CONFIG = { - "x_min": 0, - "x_max": 4, - "y_min": 0, - "y_max": 4, - "graph_origin": ORIGIN + 3* DOWN+4*LEFT, - "x_labeled_nums": list(range(0, 4)), - "y_labeled_nums": list(range(0, 5)), - } - def construct(self): - topic = TextMobject("Different paths of approach to limit point") - topic.scale(1.5) - topic.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) - self.play(Write(topic)) - self.wait(1) - self.play(FadeOut(topic)) - - - - XTD = self.x_axis_width/(self.x_max- self.x_min) - YTD = self.y_axis_height/(self.y_max- self.y_min) - - self.setup_axes(animate = True) - - y_x = self.get_graph(lambda x : x, x_min = -1, x_max = 4) - y_x_lab = self.get_graph_label(y_x, label = r"y = x") - - y_xsquare = self.get_graph(lambda x : x*x, x_min = -1, x_max = 4) - y_xsquare_lab = self.get_graph_label(y_xsquare, label = r"y = x^2") - - y_1 = self.get_graph(lambda x : 1, x_min = -1, x_max = 4) - y_1_lab = self.get_graph_label(y_1, label = r"y = 1") - - y_2minusx = self.get_graph(lambda x : 2 - x, x_min = -1, x_max = 4, color = RED) - y_2minusx_lab = self.get_graph_label(y_2minusx, label = r"y = 2 - x") - - limit_point = Dot().shift(self.graph_origin+1*XTD*RIGHT+1*YTD*UP) - limit_point_lab = TextMobject(r"(1,1)") - limit_point_lab.next_to(limit_point, DOWN) - - self.play(ShowCreation(limit_point)) - self.play(Write(limit_point_lab)) - self.wait(1) - - self.play(ShowCreation(y_x)) - self.play(Write(y_x_lab)) - self.wait(1) - - self.play(ShowCreation(y_xsquare)) - self.play(Write(y_xsquare_lab)) - self.wait(1) - - self.play(ShowCreation(y_1)) - self.play(Write(y_1_lab)) - self.wait(1) - - self.play(ShowCreation(y_2minusx)) - self.play(Write(y_2minusx_lab)) - self.wait(1) - - - - \ No newline at end of file -- cgit From dcf9888ff648234c364a6b0733aeadc48e855e8b Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:20:56 +0530 Subject: Delete limit_approach_point.gif --- .../gifs/limit_approach_point.gif | Bin 47411 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Limits and Continuity of Multivariable Functions/gifs/limit_approach_point.gif (limited to 'FSF-2020') 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/limit_approach_point.gif deleted file mode 100644 index 830b6f1..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/Limits and Continuity of Multivariable Functions/gifs/limit_approach_point.gif and /dev/null differ -- cgit From 6d371da0a54d8b887894fdd9008ea4a6afc09e9e Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:21:38 +0530 Subject: Create file1_Total area of cross section A.py --- .../file1_Total area of cross section A.py | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py new file mode 100644 index 0000000..b1ce29c --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py @@ -0,0 +1,31 @@ +from manimlib.imports import* + +class MotivationAnimation(Scene): + def construct(self): + + r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip + b = Brace(r,UP) + r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) + m_text = TextMobject("Metal Strip").shift(3*DOWN) + a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) + a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) + START = [1,0,0] + END = [0,3,0] + l = Line(START,END,color = RED).shift(0.9*DOWN) + a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) + + group1 = VGroup(r_text,b,a,l,a2,a2_text) + f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) + + ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip + + self.play(Write(r)) + self.wait(1) + self.play(ShowCreation(m_text)) + self.wait(1) + self.play(Write(group1)) + self.wait(2) + self.play(FadeOut(group1)) + self.wait(1) + self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) + -- cgit From 6f0a08e8e7db04c9fb87136fda8200f08279a4a9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:22:00 +0530 Subject: Rename file 3_Visualization of types of critical points.py to file3_Visualization of types of critical points.py --- ... 3_Visualization of types of critical points.py | 70 ---------------------- ...e3_Visualization of types of critical points.py | 70 ++++++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py deleted file mode 100644 index f9055e6..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py +++ /dev/null @@ -1,70 +0,0 @@ -from manimlib.imports import * - -class TypescpAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - - #----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) - - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) - - #----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) - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----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) - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r3_text) - self.wait(1) - self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py new file mode 100644 index 0000000..f9055e6 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py @@ -0,0 +1,70 @@ +from manimlib.imports import * + +class TypescpAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + #----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) + + r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + #----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) + + r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + #----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) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.play(FadeOut(r2_text)) + self.add(axes) + self.play(Write(f2),Write(d)) + self.add_fixed_in_frame_mobjects(f2_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r3_text) + self.wait(1) + self.play(FadeOut(r3_text)) + self.add(axes) + self.play(Write(f3),Write(d)) + self.add_fixed_in_frame_mobjects(f3_text) + self.wait(2) -- cgit From 4f3ae2072d6312cde707b4c643ddb8777e867c6b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:22:35 +0530 Subject: Rename file 4_f(x,y) = (y-x)(1-2x-3y).py to file4_f(x,y) = (y-x)(1-2x-3y).py --- .../file 4_f(x,y) = (y-x)(1-2x-3y).py | 32 ---------------------- .../file4_f(x,y) = (y-x)(1-2x-3y).py | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py deleted file mode 100644 index 72c93b1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = 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_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py new file mode 100644 index 0000000..72c93b1 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py @@ -0,0 +1,32 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point + d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 + r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) + + #----f(x,y) = (y-x)(1-2x-3y) + f = 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_D, PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.5) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(d_text) + self.wait(1) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(3) -- cgit From 25d955f5c9e2a1e19e746c40531763e3f5ad30dd Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:23:20 +0530 Subject: Rename file 2_Tangent plane at extrema of a function.py to file2_Tangent plane at extrema of a function.py --- ...ile 2_Tangent plane at extrema of a function.py | 55 ---------------------- ...file2_Tangent plane at extrema of a function.py | 55 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py deleted file mode 100644 index 6889a52..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import* - -class TheoremAnimation(ThreeDScene): - def construct(self): - - axes = ThreeDAxes() - - #----parabola: x**2+y**2 - parabola1 = 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_E], - resolution=(20, 20)).scale(1) - - #----parabola: -x**2-y**2 - parabola2 = 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_E,PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi=75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.4) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane - - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) - - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) - - self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) - self.wait(1) - self.play(Write(parabola1)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) - - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py new file mode 100644 index 0000000..6889a52 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py @@ -0,0 +1,55 @@ +from manimlib.imports import* + +class TheoremAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + + #----parabola: x**2+y**2 + parabola1 = 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_E], + resolution=(20, 20)).scale(1) + + #----parabola: -x**2-y**2 + parabola2 = 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_E,PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane + + parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.add(axes) + self.add_fixed_in_frame_mobjects(parabola2_text) + self.wait(1) + self.play(Write(parabola1)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) + self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + + self.wait(1) + self.add_fixed_in_frame_mobjects(parabola1_text) + self.wait(1) + self.play(Write(parabola2)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) -- cgit From 576d9a6054d5b2c351760b878e29af2cca9c57e4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:24:50 +0530 Subject: Add files via upload --- .../file1_Total area of cross section A.mp4 | Bin 0 -> 283509 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 new file mode 100644 index 0000000..436dedf Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 differ -- cgit From 0df5e06b5035e954f01fcde0fea0dd5a4a0d9b66 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:26:03 +0530 Subject: Add files via upload --- ...le 3_Visualization of types of critical points.mp4 | Bin 0 -> 1035267 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 new file mode 100644 index 0000000..ea6b781 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 differ -- cgit From c99e8f947c3ffe2f2b5d4c877c9c7755d2d4e8c9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:26:42 +0530 Subject: Delete file 3_Visualization of types of critical points.mp4 --- ...le 3_Visualization of types of critical points.mp4 | Bin 1035267 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 deleted file mode 100644 index ea6b781..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 and /dev/null differ -- cgit From b735d3d21136fce2384bb5b861894a101295314d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:27:11 +0530 Subject: Add files via upload --- ...ile3_Visualization of types of critical points.mp4 | Bin 0 -> 1035267 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 new file mode 100644 index 0000000..ea6b781 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 differ -- cgit From b868cbd088b9bcb87969d60aadd1df50e3e05816 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:28:09 +0530 Subject: Add files via upload --- .../Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 | Bin 0 -> 2542434 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 new file mode 100644 index 0000000..b01d279 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 differ -- cgit From 7741043e07cf71c0dc47a80d4cd71dbbcd2e09b8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:29:59 +0530 Subject: Delete example.py --- .../Critical Points/example.py | 32 ---------------------- 1 file changed, 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/example.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/example.py b/FSF-2020/approximations-and-optimizations/Critical Points/example.py deleted file mode 100644 index 3a41be7..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/example.py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = 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_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) -- cgit From c9ca55539047853d53019ecd96e5ff2eaf88efe9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:30:28 +0530 Subject: Delete motivation.py --- .../Critical Points/motivation.py | 30 ---------------------- 1 file changed, 30 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/motivation.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/motivation.py b/FSF-2020/approximations-and-optimizations/Critical Points/motivation.py deleted file mode 100644 index 27354ef..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/motivation.py +++ /dev/null @@ -1,30 +0,0 @@ -from manimlib.imports import* - -class MotivationAnimation(Scene): - def construct(self): - - r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip - b = Brace(r,UP) - r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) - m_text = TextMobject("Metal Strip").shift(3*DOWN) - a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) - a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) - START = [1,0,0] - END = [0,3,0] - l = Line(START,END,color = RED).shift(0.9*DOWN) - a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) - - group1 = VGroup(r_text,b,a,l,a2,a2_text) - f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) - - ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip - - self.play(Write(r)) - self.wait(1) - self.play(ShowCreation(m_text)) - self.wait(1) - self.play(Write(group1)) - self.wait(2) - self.play(FadeOut(group1)) - self.wait(1) - self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) -- cgit From 154071b94df207e7791666d5ab2ab91a11caac0c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:30:50 +0530 Subject: Delete theorem.py --- .../Critical Points/theorem.py | 55 ---------------------- 1 file changed, 55 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/theorem.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/theorem.py b/FSF-2020/approximations-and-optimizations/Critical Points/theorem.py deleted file mode 100644 index 7c82aa9..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/theorem.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import* - -class TheoremAnimation(ThreeDScene): - def construct(self): - - axes = ThreeDAxes() - - #----parabola: x**2+y**2 - parabola1 = 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_E], - resolution = (20, 20)).scale(1) - - #----parabola: -x**2-y**2 - parabola2 = 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_E,PURPLE_E], - resolution = (20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate = 0.4) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color = '#C0C0C0',fill_opacity = 0.3).move_to(ORIGIN) #----tangent plane - - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) - - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) - - self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) - self.wait(1) - self.play(Write(parabola1)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) - - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) -- cgit From 005df55ffdc15c828a5edd82080b3055ff418afb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:31:08 +0530 Subject: Delete types_of_cp.py --- .../Critical Points/types_of_cp.py | 70 ---------------------- 1 file changed, 70 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py b/FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py deleted file mode 100644 index f9055e6..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py +++ /dev/null @@ -1,70 +0,0 @@ -from manimlib.imports import * - -class TypescpAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - - #----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) - - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) - - #----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) - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----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) - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r3_text) - self.wait(1) - self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) -- cgit From e92c84ba37bd991b5a7f093fbc411280568ea380 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:34:24 +0530 Subject: Upload scalar-functions Folder --- .../scalar-functions/Scalar_Function_Quiz.pdf | Bin 0 -> 87455 bytes .../scalar-functions/file1_domain_range.py | 132 +++++++++++++++ .../file2_scalar_function_application.py | 129 +++++++++++++++ .../scalar-functions/file3_parabola_example.py | 35 ++++ .../scalar-functions/file4_neural_nets.py | 177 +++++++++++++++++++++ .../scalar-functions/gifs/file1_domain_range.gif | Bin 0 -> 74879 bytes .../gifs/file2_scalar_function_application.gif | Bin 0 -> 225144 bytes .../gifs/file3_parabola_example.gif | Bin 0 -> 905534 bytes .../scalar-functions/gifs/file4_neural_nets.gif | Bin 0 -> 95828 bytes 9 files changed, 473 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/Scalar_Function_Quiz.pdf create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file1_domain_range.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file2_scalar_function_application.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file3_parabola_example.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file4_neural_nets.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file1_domain_range.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file2_scalar_function_application.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file3_parabola_example.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file4_neural_nets.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..6d94a2c Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/Scalar_Function_Quiz.pdf differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file1_domain_range.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file1_domain_range.py new file mode 100644 index 0000000..9b1ca7b --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file1_domain_range.py @@ -0,0 +1,132 @@ +# Plotting Graphs +from manimlib.imports import * + +class PlotGraphs(GraphScene): + CONFIG = { + "x_min": -5, + "x_max": 5, + "y_min": 0, + "y_max": 4, + "graph_origin": ORIGIN + 2.5* DOWN, + "x_labeled_nums": list(range(-5, 6)), + "y_labeled_nums": list(range(0, 5)), + } + def construct(self): + + topic = TextMobject("Domain and Range") + topic.scale(2) + topic.set_color(YELLOW) + self.play(Write(topic)) + self.play(FadeOut(topic)) + self.wait(1) + + + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + self.setup_axes(animate = True) + + graphobj = self.get_graph(lambda x : np.sqrt(x + 4), x_min = -4, x_max = 5) + graph_lab = self.get_graph_label(graphobj, label = r"\sqrt{x + 4}") + + + rangeline1 = Arrow(self.graph_origin+2.2*YTD*UP+5*XTD*LEFT, self.graph_origin+4.1*YTD*UP+5*XTD*LEFT) + rangeline2 = Arrow(self.graph_origin+1.7*YTD*UP+5*XTD*LEFT, self.graph_origin+5*XTD*LEFT) + rangeline1.set_color(RED) + rangeline2.set_color(RED) + + rangeMsg = TextMobject(r"Range: $y \geq 0$") + rangeMsg.move_to(self.graph_origin+2*YTD*UP+5*XTD*LEFT) + rangeMsg.scale(0.5) + rangeMsg.set_color(YELLOW) + + domainline1 = Line(self.graph_origin+0.6*YTD*DOWN+1.2*XTD*LEFT, self.graph_origin+0.6*YTD*DOWN + 4*XTD*LEFT) + domainline2 = Arrow(self.graph_origin+0.6*YTD*DOWN+1.1*XTD*RIGHT, self.graph_origin+0.6*YTD*DOWN + 5.3*XTD*RIGHT) + domainline1.set_color(PINK) + domainline2.set_color(PINK) + + domainMsg = TextMobject(r"Domain: $x \geq -4$") + domainMsg.move_to(self.graph_origin+0.6*YTD*DOWN) + domainMsg.scale(0.5) + domainMsg.set_color(GREEN) + + + + + self.play(ShowCreation(graphobj)) + self.play(ShowCreation(graph_lab)) + self.wait(1) + self.play(GrowArrow(rangeline1)) + self.play(GrowArrow(rangeline2)) + self.play(Write(rangeMsg)) + self.wait(1) + self.play(GrowArrow(domainline1)) + self.play(GrowArrow(domainline2)) + self.play(Write(domainMsg)) + self.wait(3) + + self.wait(2) + + + + +class PlotSineGraphs(GraphScene): + CONFIG = { + "x_min": -8, + "x_max": 8, + "y_min": -1, + "y_max": 1, + "graph_origin": ORIGIN, + "x_labeled_nums": list(range(-8, 9)), + "y_labeled_nums": list(range(-1, 2)), + } + def construct(self): + + + + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + self.setup_axes(animate = True) + + sineobj = self.get_graph(lambda x : np.sin(x), x_min = -7, x_max = 8) + sine_lab = self.get_graph_label(sineobj, label = "\\sin(x)") + + + rangeline1 = Line(8*XTD*LEFT,1*YTD*UP+8*XTD*LEFT) + rangeline2 = Line(8*XTD*LEFT,1*YTD*DOWN+8*XTD*LEFT) + rangeline1.set_color(RED) + rangeline2.set_color(RED) + + rangeMsg = TextMobject(r"Range: $-1 \leq y \leq 1$") + rangeMsg.move_to(1.1*YTD*UP+8.5*XTD*LEFT) + rangeMsg.scale(0.5) + rangeMsg.set_color(YELLOW) + + + domainline1 = Arrow(1.1*YTD*DOWN+2*XTD*LEFT, 1.1*YTD*DOWN + 8.5*XTD*LEFT) + domainline2 = Arrow(1.1*YTD*DOWN+2*XTD*RIGHT, 1.1*YTD*DOWN + 8.5*XTD*RIGHT) + domainline1.set_color(PINK) + domainline2.set_color(PINK) + + domainMsg = TextMobject(r"Domain: $[-\infty, \infty]$") + domainMsg.move_to(1.1*YTD*DOWN) + domainMsg.scale(0.5) + domainMsg.set_color(GREEN) + + + + self.play(ShowCreation(sineobj)) + self.play(ShowCreation(sine_lab)) + self.wait(1) + self.play(GrowArrow(rangeline1)) + self.play(GrowArrow(rangeline2)) + self.play(Write(rangeMsg)) + self.wait(1) + self.play(GrowArrow(domainline1)) + self.play(GrowArrow(domainline2)) + self.play(Write(domainMsg)) + self.wait(3) + + + \ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file2_scalar_function_application.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file2_scalar_function_application.py new file mode 100644 index 0000000..56b3e53 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file2_scalar_function_application.py @@ -0,0 +1,129 @@ +from manimlib.imports import * + +class ScalarApplication(ThreeDScene): + def construct(self): + axes = ThreeDAxes() # creates a 3D Axis + + cube = Cube() + cube.set_fill(YELLOW_E, opacity = 0.1) + cube.scale(2) + self.set_camera_orientation(phi=0 * DEGREES,theta=270*DEGREES) + self.play(ShowCreation(cube),ShowCreation(axes)) + + dot = Sphere() + dot.scale(0.1) + dot.move_to(np.array([1,0.5,1])) + dot.set_fill(RED) + + #dot = Dot(np.array([1,0.5,1]), color = RED) + temp_func = TextMobject("T(x,y,z)") + temp_func.next_to(dot,RIGHT) + temp_func.set_color(RED) + temp_func_trans = TextMobject("T(1,0.5,1)") + temp_func_trans.next_to(dot,RIGHT) + temp_func_trans.set_color(RED) + temp = TextMobject(r"$36 ^\circ$") + temp.next_to(dot,RIGHT) + temp.set_color(RED_E) + + + self.play(ShowCreation(dot)) + self.play(ShowCreation(temp_func)) + self.play(Transform(temp_func, temp_func_trans)) + self.wait(1) + self.play(Transform(temp_func, temp)) + + + + + dot1 = Sphere() + dot1.scale(0.1) + dot1.move_to(np.array([-1,-0.8,-1.5])) + dot1.set_fill(BLUE_E) + #dot1 = Dot(np.array([-1,-0.8,-1.5]), color = BLUE) + temp_func1 = TextMobject("T(x,y,z)") + temp_func1.next_to(dot1,LEFT) + temp_func1.set_color(BLUE) + temp_func_trans1 = TextMobject("T(-1,-0.8,-1.5)") + temp_func_trans1.next_to(dot1,LEFT) + temp_func_trans1.set_color(BLUE) + temp1 = TextMobject(r"$24 ^\circ$") + temp1.next_to(dot1,LEFT) + temp1.set_color(BLUE) + + self.play(ShowCreation(dot1)) + self.play(ShowCreation(temp_func1)) + self.play(Transform(temp_func1, temp_func_trans1)) + self.wait(1) + self.play(Transform(temp_func1, temp1)) + + self.play(FadeOut(temp_func)) + self.play(FadeOut(temp_func1)) + + + self.move_camera(phi=80* DEGREES,theta=45*DEGREES,run_time=3) + + self.begin_ambient_camera_rotation(rate=0.2) + self.wait(4) + self.stop_ambient_camera_rotation() + self.wait(2) + + + + +class AddTempScale(Scene): + def construct(self): + temp_scale = ImageMobject("tempscale.png") + temp_scale.scale(4) + temp_scale.move_to(2*RIGHT) + self.play(ShowCreation(temp_scale)) + + + temp_func = TextMobject("T(x,y,z)") + temp_func.move_to(3*UP +2*LEFT) + temp_func.set_color(RED) + temp_func_trans = TextMobject("T(1,0.5,1)") + temp_func_trans.move_to(3*UP +2*LEFT) + temp_func_trans.set_color(RED) + temp = TextMobject(r"$36 ^\circ$") + temp.set_color(RED) + temp.move_to(3*UP +2*LEFT) + temp.scale(0.7) + + self.play(ShowCreation(temp_func)) + self.play(Transform(temp_func, temp_func_trans)) + self.wait(1) + self.play(Transform(temp_func, temp)) + self.play(ApplyMethod(temp_func.move_to, 1.8*UP +1.8*RIGHT)) + + + temp_func1 = TextMobject("T(x,y,z)") + temp_func1.move_to(2*UP +2*LEFT) + temp_func1.set_color(BLUE) + temp_func_trans1 = TextMobject("T(-1,-0.8,-1.5)") + temp_func_trans1.move_to(2*UP +2*LEFT) + temp_func_trans1.set_color(BLUE) + temp1 = TextMobject(r"$24 ^\circ$") + temp1.set_color(BLUE) + temp1.move_to(2*UP +2*LEFT) + temp1.scale(0.7) + + self.play(ShowCreation(temp_func1)) + self.play(Transform(temp_func1, temp_func_trans1)) + self.wait(1) + self.play(Transform(temp_func1, temp1)) + self.play(ApplyMethod(temp_func1.move_to, 0.6*UP +1.8*RIGHT)) + + + + transtext = TextMobject("Scalar Function Transform:") + transtext.set_color(GREEN) + transtext1 = TextMobject(r"$\mathbb{R}^3 \rightarrow \mathbb{R}$") + transtext1.set_color(YELLOW_E) + transtext.move_to(3*UP +3*LEFT) + transtext1.next_to(transtext,DOWN) + self.play(Write(transtext)) + self.play(Write(transtext1)) + self.wait(2) + + diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file3_parabola_example.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file3_parabola_example.py new file mode 100644 index 0000000..74dc063 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file3_parabola_example.py @@ -0,0 +1,35 @@ +from manimlib.imports import * + +class Parabola(ThreeDScene): + def construct(self): + axes = ThreeDAxes() # creates a 3D Axis + + paraboloid = ParametricSurface( + lambda u, v: np.array([ + 2*np.cosh(u)*np.cos(v), + 2*np.cosh(u)*np.sin(v), + 2*np.sinh(u) + ]),v_min=0,v_max=TAU,u_min=0,u_max=2,checkerboard_colors=[YELLOW_D, YELLOW_E], + resolution=(15, 32)) + + text3d = TextMobject(r"Plot of $f: \mathbb{R}^2 \rightarrow \mathbb{R}$", "z = f(x,y)") + self.add_fixed_in_frame_mobjects(text3d) + text3d[0].move_to(4*LEFT+2*DOWN) + text3d[1].next_to(text3d[0], DOWN) + text3d[0].set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) + text3d[1].set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE) + + #self.set_camera_orientation(phi=0 * DEGREES,theta=270*DEGREES) + self.move_camera(phi=110* DEGREES,theta=45*DEGREES) + self.add(axes) + self.play(ShowCreation(paraboloid)) + self.play(Write(text3d[0])) + self.play(Write(text3d[1])) + self.begin_ambient_camera_rotation(rate=0.2) + self.wait(3) + self.move_camera(phi=0 * DEGREES,theta=180*DEGREES,run_time=3) + self.wait(3) + self.move_camera(phi=110* DEGREES,theta=90*DEGREES,run_time=3) + self.wait(3) + + \ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file4_neural_nets.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file4_neural_nets.py new file mode 100644 index 0000000..eb6bf45 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/file4_neural_nets.py @@ -0,0 +1,177 @@ +from manimlib.imports import * + +class SigmoidFunc(GraphScene): + CONFIG = { + "x_min": -4, + "x_max": 4, + "y_min": -1, + "y_max": 1, + "graph_origin": ORIGIN + 0.8*DOWN, + "x_labeled_nums": list(range(-4, 5)), + "y_labeled_nums": list(range(-1, 2)), + "y_axis_height": 4.5, + } + def construct(self): + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + topic = TextMobject("Sigmoid Function") + topic.move_to(3.2*UP) + topic.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) + + self.setup_axes(animate = True) + sigmoid_func = self.get_graph(lambda x : (1/(1 + np.exp(-x))), x_min = -4, x_max = 4) + sigmoid_lab = self.get_graph_label(sigmoid_func, label = r"\frac{1}{1 + e^{-z}}") + + + + + self.play(ShowCreation(sigmoid_func),Write(sigmoid_lab)) + self.play(Write(topic)) + self.wait(2) + self.play(FadeOut(sigmoid_func), FadeOut(sigmoid_lab)) + self.wait(1) + + + +class NeuralNet(GraphScene): + def construct(self): + + sigmoid_exp = TextMobject(r"g(z) = g($\theta^T$ X) = $\frac{1}{1 + e^{-z}}$") + sigmoid_exp.move_to(3*UP + 4*LEFT) + sigmoid_exp.scale(0.8) + sigmoid_exp.set_color(BLUE) + sigmoid_exp1 = TextMobject(r"Predict: 'y = 1'",r"When g(z) $\geq$ 0.5, z $\geq$ 0, $\theta^T$ X $\geq$ 0") + sigmoid_exp2 = TextMobject(r"Predict: 'y = 0'", r"When g(z) $\leq$ 0.5, z $\leq$ 0, $\theta^T$ X $\leq$ 0") + sigmoid_exp1.scale(0.5) + sigmoid_exp2.scale(0.5) + sigmoid_exp1.set_color(PURPLE) + sigmoid_exp2.set_color(PURPLE) + + sigmoid_exp1[0].next_to(sigmoid_exp, 1.5*DOWN) + sigmoid_exp1[1].next_to(sigmoid_exp1[0], DOWN) + sigmoid_exp2[0].next_to(sigmoid_exp1[1], 1.5*DOWN) + sigmoid_exp2[1].next_to(sigmoid_exp2[0], DOWN) + + + self.play(Write(sigmoid_exp)) + self.play(Write(sigmoid_exp1[0]), Write(sigmoid_exp1[1])) + self.play(Write(sigmoid_exp2[0]), Write(sigmoid_exp2[1])) + self.wait(2) + + + neuron1 = Circle() + neuron1.set_fill(YELLOW_A, opacity = 0.5) + + neuron2 = Circle() + neuron2.set_fill(ORANGE, opacity = 0.5) + + neuron3 = Circle() + neuron3.set_fill(GREEN_E, opacity = 0.5) + + neuron1.move_to(2*UP+RIGHT) + neuron2.move_to(2*DOWN+RIGHT) + neuron3.move_to(4*RIGHT) + + arrow1 = Arrow(neuron1.get_right(),neuron3.get_left(),buff=0.1) + arrow1.set_color(RED) + arrow2 = Arrow(neuron2.get_right(),neuron3.get_left(),buff=0.1) + arrow2.set_color(RED) + + arrow3 = Arrow(neuron3.get_right(),7*RIGHT,buff=0.1) + arrow3.set_color(RED) + + + sign1 = TextMobject("+1") + sign1.move_to(2*UP+RIGHT) + sign1.scale(2) + sign2 = TextMobject(r"$x_1$") + sign2.move_to(2*DOWN+RIGHT) + sign2.scale(2) + sign3 = TextMobject(r"$h_{\theta}(x)$") + sign3.move_to(6*RIGHT+0.4*DOWN) + sign3.scale(0.7) + sign4 = TextMobject(r"$= g(10 - 20x_1)$") + sign4.next_to(sign3,DOWN) + sign4.scale(0.5) + sign5 = TextMobject(r"$= g(10 - 20x_1)$") + sign5.next_to(sign3,DOWN) + sign5.scale(0.5) + sign6 = TextMobject(r"$= g(10 - 20x_1)$") + sign6.next_to(sign3,DOWN) + sign6.scale(0.5) + + + weight1 = TextMobject("10") + weight1.next_to(arrow1,UP) + weight2 = TextMobject("-20") + weight2.next_to(arrow2,DOWN) + + gate = TextMobject("NOT GATE") + gate.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) + gate.scale(1.5) + gate.move_to(3*RIGHT+3.5*UP) + + + + truth_table = TextMobject(r"\begin{displaymath}\begin{array}{|c|c|} x & y\\ \hline 1 & 0 \\0 & 1 \\\end{array}\end{displaymath}") + truth_table.next_to(sigmoid_exp2[1], 3*DOWN) + + values = TextMobject("1", "0") + values.scale(2) + + sign4_trans1 = TextMobject(r"$= g(10 - 20(1))$") + sign4_trans2 = TextMobject(r"$= g(10 - 20(0))$") + sign4_trans1.next_to(sign3,DOWN) + sign4_trans2.next_to(sign3,DOWN) + sign4_trans1.scale(0.5) + sign4_trans2.scale(0.5) + + + + output1 = TextMobject("y = 0") + output2 = TextMobject("y = 1") + output1.next_to(sign4,DOWN) + output2.next_to(sign4,DOWN) + output1.scale(1.5) + output2.scale(1.5) + + + + self.play(ShowCreation(neuron1),ShowCreation(neuron2)) + self.play(ShowCreation(neuron3)) + self.play(ShowCreation(sign1),ShowCreation(sign2)) + self.wait(1) + + self.play(GrowArrow(arrow1)) + self.play(GrowArrow(arrow2)) + self.play(ShowCreation(weight1),ShowCreation(weight2)) + + + + self.play(GrowArrow(arrow3)) + self.play(Write(sign3),Write(sign4)) + + self.play(Write(gate)) + self.play(ShowCreation(truth_table)) + + self.play(ApplyMethod(values[0].move_to, 2*DOWN+RIGHT)) + self.play(FadeOut(values[0])) + self.play(Transform(sign4,sign4_trans1)) + self.play(Write(output1)) + self.wait(1) + self.play(FadeOut(output1)) + self.play(Transform(sign4, sign5)) + + + self.play(ApplyMethod(values[1].move_to, 2*DOWN+RIGHT)) + self.play(FadeOut(values[1])) + self.play(Transform(sign4,sign4_trans2)) + self.play(Write(output2)) + self.wait(1) + self.play(FadeOut(output2)) + self.play(Transform(sign4, sign6)) + + self.wait(2) + + diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file1_domain_range.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file1_domain_range.gif new file mode 100644 index 0000000..d0351e5 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file1_domain_range.gif differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file2_scalar_function_application.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file2_scalar_function_application.gif new file mode 100644 index 0000000..831ec8e Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file2_scalar_function_application.gif differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file3_parabola_example.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file3_parabola_example.gif new file mode 100644 index 0000000..3fdecf4 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file3_parabola_example.gif differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file4_neural_nets.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file4_neural_nets.gif new file mode 100644 index 0000000..9d24688 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/scalar-functions/gifs/file4_neural_nets.gif differ -- cgit From 7557884e36f721156f4a6f0eb8dd9997d9c25805 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:35:30 +0530 Subject: Uploaded multivariable-functions Folder --- .../Multivariable_Functions_Quiz.pdf | Bin 0 -> 109631 bytes .../file1_multivariable_func_respresentation.py | 80 +++++++ .../file2_multivariable_func_examples.py | 69 ++++++ .../multivariable-functions/file3_plot_sphere.py | 42 ++++ .../multivariable-functions/file4_vectorvf_sine.py | 91 ++++++++ .../file5_derivative_vectorvf.py | 247 +++++++++++++++++++++ .../file1_multivariable_func_respresentation.gif | Bin 0 -> 73055 bytes .../gifs/file2_multivariable_func_examples.gif | Bin 0 -> 57945 bytes .../gifs/file3_plot_sphere.gif | Bin 0 -> 198324 bytes .../gifs/file4_vectorvf_sine.gif | Bin 0 -> 29814 bytes .../gifs/file5_derivative_vectorvf.gif | Bin 0 -> 117597 bytes 11 files changed, 529 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/Multivariable_Functions_Quiz.pdf create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivariable_func_respresentation.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_examples.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_derivative_vectorvf.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivariable_func_respresentation.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_examples.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_plot_sphere.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_derivative_vectorvf.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..7895843 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/Multivariable_Functions_Quiz.pdf differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivariable_func_respresentation.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivariable_func_respresentation.py new file mode 100644 index 0000000..4bfcf21 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivariable_func_respresentation.py @@ -0,0 +1,80 @@ +from manimlib.imports import * + +class MultivariableFunc(Scene): + def construct(self): + + topic = TextMobject("Multivariable Functions") + topic.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) + topic.scale(2) + + self.play(Write(topic)) + self.wait(1) + self.play(FadeOut(topic)) + + + circle = Circle() + circle.scale(3) + + eqn1 = TextMobject(r"f(x,y) = $x^2y$") + eqn1.set_color(YELLOW) + + + + number1 = TextMobject("(2,1)") + number1.move_to(3*UP+ 3*LEFT) + number1.scale(1.2) + number1.set_color(GREEN) + + output1 = TextMobject("4") + output1.scale(1.5) + output1.set_color(BLUE) + + eqn1_1 = TextMobject(r"f(2,1) = $2^2(1)$") + eqn1_1.set_color(YELLOW) + + + self.play(ShowCreation(circle),Write(eqn1)) + self.wait(1) + self.play(ApplyMethod(number1.move_to, 0.6*LEFT)) + self.play(FadeOut(number1)) + self.play(Transform(eqn1, eqn1_1)) + self.wait(1) + self.play(ApplyMethod(output1.move_to, 3*DOWN+4*RIGHT)) + self.wait(1) + self.play(FadeOut(output1)) + + + eqn2 = TextMobject(r"f(x,y,z) = $x^2y+2yz$") + eqn2.set_color(YELLOW) + + number2 = TextMobject("(2,1,3)") + number2.move_to(3*UP+ 3*LEFT) + number2.scale(1.2) + number2.set_color(GREEN) + + output2 = TextMobject("8") + output2.scale(1.5) + output2.set_color(BLUE) + + eqn2_1 = TextMobject(r"f(2,1,3) = $2^2(1) + 2(1)(3)$") + eqn2_1.set_color(YELLOW) + + eqn2_2 = TextMobject(r"f(2,1,3) = $2 + 6$") + eqn2_2.set_color(YELLOW) + + + + self.play(FadeOut(eqn1)) + self.play(Write(eqn2)) + + self.wait(1) + self.play(ApplyMethod(number2.move_to, 1.2*LEFT)) + self.play(FadeOut(number2)) + self.play(Transform(eqn2, eqn2_1)) + self.wait(1) + self.play(Transform(eqn2, eqn2_2)) + self.wait(1) + self.play(ApplyMethod(output2.move_to, 3*DOWN+4*RIGHT)) + self.wait(1) + self.play(FadeOut(output2),FadeOut(eqn2),FadeOut(circle)) + self.wait(2) \ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_examples.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_examples.py new file mode 100644 index 0000000..7322e47 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_examples.py @@ -0,0 +1,69 @@ +from manimlib.imports import * + +class Examples(GraphScene): + def construct(self): + + rectangle = Rectangle(height = 3, width = 4, color = GREEN) + square = Square(side_length = 5, color = PURPLE) + circle = Circle(radius = 2, color = PINK) + radius = Line(ORIGIN,2*RIGHT) + + radius.set_color(RED) + + rectangle_area_func = TextMobject(r"$Area = f(Length, Breadth)$") + rectangle_area_func.scale(0.6) + square_area_func = TextMobject(r"$Area = f(Length)$") + circle_area_func = TextMobject(r"$Area = f(r)$") + + + rectangle_area = TextMobject(r"$Area = Length \times Breadth$") + rectangle_area.scale(0.6) + square_area = TextMobject(r"$Area = Length^2$") + circle_area = TextMobject(r"$Area = \pi r^2$") + + braces_rect1 = Brace(rectangle, LEFT) + eq_text1 = braces_rect1.get_text("Length") + braces_rect2 = Brace(rectangle, UP) + eq_text2 = braces_rect2.get_text("Breadth") + + braces_square = Brace(square, LEFT) + braces_square_text = braces_square.get_text("Length") + + radius_text = TextMobject("r") + radius_text.next_to(radius,UP) + + + + self.play(ShowCreation(rectangle)) + self.wait(1) + self.play(GrowFromCenter(braces_rect1),Write(eq_text1),GrowFromCenter(braces_rect2),Write(eq_text2)) + self.wait(1) + self.play(Write(rectangle_area_func)) + self.wait(1) + self.play(Transform(rectangle_area_func, rectangle_area)) + self.wait(1) + self.play(FadeOut(braces_rect1),FadeOut(eq_text1),FadeOut(braces_rect2),FadeOut(eq_text2),FadeOut(rectangle_area_func)) + + + self.play(Transform(rectangle, square)) + self.wait(1) + self.play(GrowFromCenter(braces_square),Write(braces_square_text)) + self.wait(1) + self.play(Write(square_area_func)) + self.wait(1) + self.play(Transform(square_area_func, square_area)) + self.wait(1) + self.play(FadeOut(braces_square),FadeOut(braces_square_text),FadeOut(square_area_func)) + + + self.play(Transform(rectangle, circle)) + self.wait(1) + self.play(ShowCreation(radius),Write(radius_text)) + self.wait(1) + self.play(FadeOut(radius_text),FadeOut(radius)) + self.wait(1) + self.play(Write(circle_area_func)) + self.wait(1) + self.play(Transform(circle_area_func, circle_area)) + self.wait(1) + self.play(FadeOut(circle_area_func)) \ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py new file mode 100644 index 0000000..baf08b1 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_plot_sphere.py @@ -0,0 +1,42 @@ +from manimlib.imports import * + +class Sphere(ThreeDScene): + def construct(self): + axes = ThreeDAxes() # creates a 3D Axis + + sphere = ParametricSurface( + lambda u, v: np.array([ + np.sin(u)*np.cos(v), + np.sin(u)*np.sin(v), + np.cos(u) + ]),u_min=0,u_max=PI,v_min=0,v_max=2*PI,checkerboard_colors=[RED_D, RED_E], + resolution=(15, 32)).scale(2) + + + + #self.set_camera_orientation(phi=0 * DEGREES,theta=270*DEGREES) + + text3d = TextMobject(r"$f(x,y) \rightarrow Point(x,y,z)$") + text3d1 = TextMobject(r"$f(x,y) \rightarrow Point(x,y, 1 - x^2 - y^2)$") + self.add_fixed_in_frame_mobjects(text3d) + text3d.scale(0.7) + text3d1.scale(0.7) + text3d.to_corner(UL) + text3d1.to_corner(UL) + text3d.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) + text3d1.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) + self.play(Write(text3d)) + self.wait(1) + + self.play(Transform(text3d,text3d1)) + self.add_fixed_in_frame_mobjects(text3d1) + self.play(FadeOut(text3d)) + + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.3) + + + self.add(axes) + self.play(Write(sphere)) + self.wait(5) \ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py new file mode 100644 index 0000000..06e225e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py @@ -0,0 +1,91 @@ +from manimlib.imports import * + +class SineVectors(GraphScene): + CONFIG = { + "x_min": 0, + "x_max": 10, + "y_min": -1, + "y_max": 1, + "graph_origin": ORIGIN+4*LEFT, + #"x_labeled_nums": list(range(-5, 6)), + #"y_labeled_nums": list(range(0, 5)), + } + def construct(self): + + + + + + XTD = self.x_axis_width/(self.x_max - self.x_min) + YTD = self.y_axis_height/(self.y_max - self.y_min) + + self.setup_axes(animate = True) + + + sine1 = self.get_graph(lambda x : np.sin(x), x_min = 0, x_max = 1.575, color = GREEN) + + point1 = Dot().shift(self.graph_origin+1*YTD*UP + 1.575*XTD*RIGHT) + point1_lab = TextMobject(r"$t = (\frac{\pi}{2})$") + point1_lab.scale(0.7) + point1_lab.next_to(point1, UP) + + vector1 = Arrow(self.graph_origin, self.graph_origin+1*YTD*UP + 1.575*XTD*RIGHT, buff=0.1, color = RED) + vector1_lab = TextMobject(r"$r(\frac{\pi}{2})$", color = RED) + vector1_lab.move_to(self.graph_origin+1.5*XTD*RIGHT+ 0.5*YTD*UP) + + self.play(GrowArrow(vector1),Write(vector1_lab)) + self.play(ShowCreation(point1), Write(point1_lab)) + self.play(ShowCreation(sine1)) + self.wait(1) + + + sine2 = self.get_graph(lambda x : np.sin(x), x_min = 1.575, x_max = 3.15, color = GREEN) + + point2 = Dot().shift(self.graph_origin+3.15*XTD*RIGHT) + point2_lab = TextMobject(r"$t = (\pi)$") + point2_lab.scale(0.7) + point2_lab.next_to(point2, UP+RIGHT) + + vector2 = Arrow(self.graph_origin, self.graph_origin+3.15*XTD*RIGHT, buff=0.1, color = BLUE) + vector2_lab = TextMobject(r"$r(\pi)$", color = BLUE) + vector2_lab.move_to(self.graph_origin+1.5*XTD*RIGHT+ 0.15*YTD*UP) + + self.play(GrowArrow(vector2),Write(vector2_lab)) + self.play(ShowCreation(point2), Write(point2_lab)) + self.play(ShowCreation(sine2)) + self.wait(1) + + + sine3 = self.get_graph(lambda x : np.sin(x), x_min = 3.15, x_max = 4.725, color = GREEN) + + point3 = Dot().shift(self.graph_origin+1*YTD*DOWN + 4.725*XTD*RIGHT) + point3_lab = TextMobject(r"$t = (\frac{3\pi}{2})$") + point3_lab.scale(0.7) + point3_lab.next_to(point3, DOWN) + + vector3 = Arrow(self.graph_origin, self.graph_origin+1*YTD*DOWN + 4.725*XTD*RIGHT, buff=0.1, color = YELLOW_C) + vector3_lab = TextMobject(r"$r(\frac{3\pi}{2})$", color = YELLOW_C) + vector3_lab.move_to(self.graph_origin+2*XTD*RIGHT+ 0.7*YTD*DOWN) + + self.play(GrowArrow(vector3),Write(vector3_lab)) + self.play(ShowCreation(point3), Write(point3_lab)) + self.play(ShowCreation(sine3)) + self.wait(1) + + + sine4 = self.get_graph(lambda x : np.sin(x), x_min = 4.725, x_max = 6.3, color = GREEN) + + point4 = Dot().shift(self.graph_origin+6.3*XTD*RIGHT) + point4_lab = TextMobject(r"$t = (2\pi)$") + point4_lab.scale(0.7) + point4_lab.next_to(point4, UP+RIGHT) + + vector4 = Arrow(self.graph_origin, self.graph_origin+6.3*XTD*RIGHT, buff=0.1, color = PURPLE) + vector4_lab = TextMobject(r"$r(2\pi)$", color = PURPLE) + vector4_lab.move_to(self.graph_origin+4.5*XTD*RIGHT+ 0.15*YTD*DOWN) + + self.play(GrowArrow(vector4),Write(vector4_lab)) + self.play(ShowCreation(point4), Write(point4_lab)) + self.play(ShowCreation(sine4)) + self.wait(3) + diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_derivative_vectorvf.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_derivative_vectorvf.py new file mode 100644 index 0000000..466e389 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_derivative_vectorvf.py @@ -0,0 +1,247 @@ +from manimlib.imports import * + +class Derivative(GraphScene): + CONFIG = { + "x_min": 0, + "x_max": 3, + "y_min": 0, + "y_max": 5, + "graph_origin": ORIGIN+6*LEFT+3*DOWN, + "x_axis_width": 6, + "x_labeled_nums": list(range(0, 4)), + "y_labeled_nums": list(range(0, 6)), + } + def construct(self): + + XTD = self.x_axis_width/(self.x_max - self.x_min) + YTD = self.y_axis_height/(self.y_max - self.y_min) + + self.setup_axes(animate = True) + + graph = self.get_graph(lambda x : x*x, x_min = 0.5, x_max = 2, color = GREEN) + + point1 = Dot().shift(self.graph_origin+0.25*YTD*UP + 0.5*XTD*RIGHT) + point1_lab = TextMobject(r"$t = a$") + point1_lab.scale(0.7) + point1_lab.next_to(point1, RIGHT) + + point2 = Dot().shift(self.graph_origin+2*XTD*RIGHT+4*YTD*UP) + point2_lab = TextMobject(r"$t = b$") + point2_lab.scale(0.7) + point2_lab.next_to(point2, RIGHT) + + + vector1 = Arrow(self.graph_origin, self.graph_origin+1*YTD*UP + 1*XTD*RIGHT, buff=0.02, color = RED) + vector1_lab = TextMobject(r"$\vec r(t)$", color = RED) + vector1_lab.move_to(self.graph_origin+1.2*XTD*RIGHT+ 0.75*YTD*UP) + vector1_lab.scale(0.8) + + vector2 = Arrow(self.graph_origin, self.graph_origin+2.25*YTD*UP + 1.5*XTD*RIGHT, buff=0.02, color = YELLOW_C) + vector2_lab = TextMobject(r"$\vec r(t + h)$", color = YELLOW_C) + vector2_lab.move_to(self.graph_origin+0.5*XTD*RIGHT+ 2*YTD*UP) + vector2_lab.scale(0.8) + + vector3 = Arrow(self.graph_origin+1*YTD*UP + 1*XTD*RIGHT, self.graph_origin+2.25*YTD*UP + 1.5*XTD*RIGHT, buff=0.02, color = PINK) + vector3_lab = TextMobject(r"$\vec r(t + h) - \vec r(t)$", color = PINK) + vector3_lab.move_to(self.graph_origin+2*XTD*RIGHT+ 1.5*YTD*UP) + vector3_lab.scale(0.8) + + + self.play(ShowCreation(graph)) + self.play(ShowCreation(point1), Write(point1_lab)) + self.play(ShowCreation(point2), Write(point2_lab)) + + self.play(GrowArrow(vector1),Write(vector1_lab)) + self.play(GrowArrow(vector2),Write(vector2_lab)) + self.play(GrowArrow(vector3),Write(vector3_lab)) + self.wait(1) + + self.display_text() + + self.play(ApplyMethod(vector3_lab.move_to,(self.graph_origin+2.3*XTD*RIGHT+ 2.2*YTD*UP))) + + vector4 = Arrow(self.graph_origin+1*YTD*UP + 1*XTD*RIGHT, self.graph_origin+1*YTD*UP + 1.5*XTD*RIGHT, buff=0.02, color = PURPLE) + vector4_lab = TextMobject(r"$dx$", color = PURPLE) + vector4_lab.move_to(self.graph_origin+1.7*XTD*RIGHT+ 0.8*YTD*UP) + vector4_lab.scale(0.7) + + vector5 = Arrow(self.graph_origin+1*YTD*UP + 1.5*XTD*RIGHT, self.graph_origin+2.25*YTD*UP + 1.5*XTD*RIGHT, buff=0.02, color = ORANGE) + vector5_lab = TextMobject(r"$dy$", color = ORANGE) + vector5_lab.move_to(self.graph_origin+1.7*XTD*RIGHT+ 1.4*YTD*UP) + vector5_lab.scale(0.7) + + self.play(GrowArrow(vector4),Write(vector4_lab)) + self.play(GrowArrow(vector5),Write(vector5_lab)) + self.wait(2) + + + + def display_text(self): + text1 = TextMobject(r"$\vec r(t)$",r"+", r"$\vec r(t + h) - \vec r(t)$") + text1[0].set_color(RED) + text1[2].set_color(PINK) + text1.scale(0.7) + + text2 = TextMobject(r"$\vec r(t + h)$", color = YELLOW_C) + text2.scale(0.7) + + text3 = TextMobject(r"$ \vec r(t + h) - \vec r(t)$", color = PINK) + text3.scale(0.7) + + text4 = TextMobject(r"[", r"$x(t+h)$", r"$\vec i$", r"+", r"$y(t+h)$", r"$\vec j$", r"$] - [$", r"$x(t)$", r"$\vec i$", r"+", r"y(t)", r"$\vec j$", r"]") + text4.set_color_by_tex(r"\vec i", BLUE) + text4.set_color_by_tex(r"\vec j", GREEN) + text4[1].set_color(YELLOW_C) + text4[4].set_color(YELLOW_C) + text4[-6].set_color(RED) + text4[-3].set_color(RED) + text4.scale(0.7) + + text5 = TextMobject(r"$[x(t+h) - x(t)]$", r"$\vec i$", r"+", r"$[y(t+h) + y(t)]$", r"$\vec j$") + text5.set_color_by_tex(r"\vec i", BLUE) + text5.set_color_by_tex(r"\vec j", GREEN) + text5[0].set_color(PURPLE) + text5[3].set_color(ORANGE) + text5.scale(0.7) + + text6 = TextMobject(r"$\frac{[\vec r(t + h) - \vec r(t)]}{h}$", r"=", r"$\frac{[x(t+h) - x(t)]}{h}$", r"$\vec i$", r"+", r"$\frac{[y(t+h) + y(t)]}{h}$", r"$\vec j$") + text6.set_color_by_tex(r"\vec i", BLUE) + text6.set_color_by_tex(r"\vec j", GREEN) + text6[0].set_color(PINK) + text6[2].set_color(PURPLE) + text6[-2].set_color(ORANGE) + text6.scale(0.8) + + text7 = TextMobject(r"$\lim_{h \rightarrow 0}$", r"$\frac{[\vec r(t + h) - \vec r(t)]}{h}$", r"=", r"$\lim_{h \rightarrow 0}$", r"$\frac{[x(t+h) - x(t)]}{h}$", r"$\vec i$", r"+", r"$\lim_{h \rightarrow 0}$", r"$\frac{[y(t+h) + y(t)]}{h}$", r"$\vec j$") + text7.set_color_by_tex(r"\vec i", BLUE) + text7.set_color_by_tex(r"\vec j", GREEN) + text7[1].set_color(PINK) + text7[4].set_color(PURPLE) + text7[-2].set_color(ORANGE) + text7.scale(0.6) + + text8 = TextMobject(r"$\vec r'(t)$", r"=",r"$\vec x'(t)$", r"$\vec i$", r"+", r"$\vec y'(t)$", r"$\vec j$") + text8.set_color_by_tex(r"\vec i", BLUE) + text8.set_color_by_tex(r"\vec j", GREEN) + text8[0].set_color(PINK) + text8[2].set_color(PURPLE) + text8[5].set_color(ORANGE) + text8.scale(0.7) + + text9 = TextMobject(r"$\frac{d \vec r}{dt}$", r"=", r"$\frac{d \vec x}{dt}$", r"$\vec i$", r"+", r"$\frac{d \vec y}{dt}$", r"$\vec j$") + text9.set_color_by_tex(r"\vec i", BLUE) + text9.set_color_by_tex(r"\vec j", GREEN) + text9[0].set_color(PINK) + text9[2].set_color(PURPLE) + text9[5].set_color(ORANGE) + text9.scale(0.7) + + + text10 = TextMobject(r"$d \vec r$", r"=", r"$\frac{d \vec x}{dt}dt$", r"$\vec i$", r"+", r"$\frac{d \vec y}{dt}dt$", r"$\vec j$") + text10.set_color_by_tex(r"\vec i", BLUE) + text10.set_color_by_tex(r"\vec j", GREEN) + text10[0].set_color(PINK) + text10[2].set_color(PURPLE) + text10[5].set_color(ORANGE) + text10.scale(0.7) + + text11 = TextMobject(r"$d \vec r$", r"=", r"$x'(t)dt$", r"$\vec i$", r"+", r"$y'(t)dt$", r"$\vec j$") + text11.set_color_by_tex(r"\vec i", BLUE) + text11.set_color_by_tex(r"\vec j", GREEN) + text11[0].set_color(PINK) + text11[2].set_color(PURPLE) + text11[5].set_color(ORANGE) + text11.scale(0.7) + + text12 = TextMobject(r"$d \vec r$", r"=", r"$dx$", r"$\vec i$", r"+", r"$dy$", r"$\vec j$") + text12.set_color_by_tex(r"\vec i", BLUE) + text12.set_color_by_tex(r"\vec j", GREEN) + text12[0].set_color(PINK) + text12[2].set_color(PURPLE) + text12[5].set_color(ORANGE) + text12.scale(0.7) + + + text1.move_to(1*UP+2.7*RIGHT) + text2.move_to(1*UP+2.7*RIGHT) + text3.move_to(1*UP+2.7*RIGHT) + text4.move_to(1*UP+2.7*RIGHT) + text5.move_to(1*UP+2.7*RIGHT) + text6.move_to(1*UP+2.7*RIGHT) + text7.move_to(1*UP+2.5*RIGHT) + text8.move_to(1*UP+2.7*RIGHT) + text9.move_to(1*UP+2.7*RIGHT) + text10.move_to(1*UP+2.7*RIGHT) + text11.move_to(1*UP+2.7*RIGHT) + text12.move_to(1*UP+2.7*RIGHT) + + brace1 = Brace(text7[0:2], DOWN, buff = SMALL_BUFF) + brace2 = Brace(text7[3:6], UP, buff = SMALL_BUFF) + brace3 = Brace(text7[7:], DOWN, buff = SMALL_BUFF) + t1 = brace1.get_text(r"$\vec r'(t)$") + t1.set_color(PINK) + + t2 = brace2.get_text(r"$\vec x'(t)$") + t2.set_color(PURPLE) + + t3 = brace3.get_text(r"$\vec y'(t)$") + t3.set_color(ORANGE) + + + self.play(Write(text1)) + self.play(Transform(text1, text2)) + self.wait(1) + + self.play(Transform(text1, text3)) + self.wait(1) + + self.play(Transform(text1, text4)) + self.wait(1) + + self.play(Transform(text1, text5)) + self.wait(1) + + self.play(Transform(text1, text6)) + self.wait(1) + + self.play(Transform(text1, text7)) + self.wait(1) + + self.play( + GrowFromCenter(brace1), + FadeIn(t1), + ) + self.wait() + self.play( + ReplacementTransform(brace1.copy(),brace2), + ReplacementTransform(t1.copy(),t2) + ) + self.wait() + self.play( + ReplacementTransform(brace2.copy(),brace3), + ReplacementTransform(t2.copy(),t3) + ) + self.wait() + + self.play(FadeOut(brace1), FadeOut(t1), FadeOut(brace2), FadeOut(t2), FadeOut(brace3), FadeOut(t3),) + self.wait() + + self.play(Transform(text1, text8)) + self.wait(1) + + self.play(Transform(text1, text9)) + self.wait(1) + + self.play(Transform(text1, text10)) + self.wait(1) + + self.play(Transform(text1, text11)) + self.wait(1) + + self.play(Transform(text1, text12)) + self.wait(1) + + + + + diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivariable_func_respresentation.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivariable_func_respresentation.gif new file mode 100644 index 0000000..a173bda Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivariable_func_respresentation.gif differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_examples.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_examples.gif new file mode 100644 index 0000000..11f66f1 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_examples.gif differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_plot_sphere.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_plot_sphere.gif new file mode 100644 index 0000000..ad7582c Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_plot_sphere.gif differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif new file mode 100644 index 0000000..4f6b931 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_derivative_vectorvf.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_derivative_vectorvf.gif new file mode 100644 index 0000000..a94de90 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_derivative_vectorvf.gif differ -- cgit From 8cf9bc5da64361ce7d5a24a6b3a55443a447a06f Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:37:33 +0530 Subject: Uploaded limits-and-continuity-of-multivariable-functions Folder --- .../file1_limit_approach_point.py | 66 +++++++++++++++++++++ .../gifs/file1_limit_approach_point.gif | Bin 0 -> 47411 bytes 2 files changed, 66 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_limit_approach_point.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_limit_approach_point.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_limit_approach_point.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_limit_approach_point.py new file mode 100644 index 0000000..57d1d45 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_limit_approach_point.py @@ -0,0 +1,66 @@ +from manimlib.imports import * + +class Limit(GraphScene): + CONFIG = { + "x_min": 0, + "x_max": 4, + "y_min": 0, + "y_max": 4, + "graph_origin": ORIGIN + 3* DOWN+4*LEFT, + "x_labeled_nums": list(range(0, 4)), + "y_labeled_nums": list(range(0, 5)), + } + def construct(self): + topic = TextMobject("Different paths of approach to limit point") + topic.scale(1.5) + topic.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) + self.play(Write(topic)) + self.wait(1) + self.play(FadeOut(topic)) + + + + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + self.setup_axes(animate = True) + + y_x = self.get_graph(lambda x : x, x_min = -1, x_max = 4) + y_x_lab = self.get_graph_label(y_x, label = r"y = x") + + y_xsquare = self.get_graph(lambda x : x*x, x_min = -1, x_max = 4) + y_xsquare_lab = self.get_graph_label(y_xsquare, label = r"y = x^2") + + y_1 = self.get_graph(lambda x : 1, x_min = -1, x_max = 4) + y_1_lab = self.get_graph_label(y_1, label = r"y = 1") + + y_2minusx = self.get_graph(lambda x : 2 - x, x_min = -1, x_max = 4, color = RED) + y_2minusx_lab = self.get_graph_label(y_2minusx, label = r"y = 2 - x") + + limit_point = Dot().shift(self.graph_origin+1*XTD*RIGHT+1*YTD*UP) + limit_point_lab = TextMobject(r"(1,1)") + limit_point_lab.next_to(limit_point, DOWN) + + self.play(ShowCreation(limit_point)) + self.play(Write(limit_point_lab)) + self.wait(1) + + self.play(ShowCreation(y_x)) + self.play(Write(y_x_lab)) + self.wait(1) + + self.play(ShowCreation(y_xsquare)) + self.play(Write(y_xsquare_lab)) + self.wait(1) + + self.play(ShowCreation(y_1)) + self.play(Write(y_1_lab)) + self.wait(1) + + self.play(ShowCreation(y_2minusx)) + self.play(Write(y_2minusx_lab)) + self.wait(1) + + + + \ 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_limit_approach_point.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_limit_approach_point.gif new file mode 100644 index 0000000..830b6f1 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_limit_approach_point.gif differ -- cgit From aa9bcd8cde74b592dd16051809b9f4ce70f63586 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:38:58 +0530 Subject: Update README.md --- .../multivariable-functions-and-paritial-derivatives/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') 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..6e4d2a8 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 : nishanpoojary ## Sub-Topics Covered: + Scalar Functions + Multivariable Functions -+ Limits and continuity of Multivariable Function ++ Limits and Continuity of Multivariable Function + Partial Derivatives + Directonal Derivatives -- cgit From 7cb7a025c6b74c1998739fdae5a84945ff708307 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Tue, 26 May 2020 12:39:13 +0530 Subject: Update README.md --- .../multivariable-functions-and-paritial-derivatives/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') 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 6e4d2a8..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 : nishanpoojary ## Sub-Topics Covered: + Scalar Functions + Multivariable Functions -+ Limits and Continuity of Multivariable Function ++ Limits and Continuity of Multivariable Functions + Partial Derivatives + Directonal Derivatives -- cgit From c37336428531e016f5b1d9efb81a2d72348a21a7 Mon Sep 17 00:00:00 2001 From: Archit Sangal Date: Tue, 26 May 2020 12:51:09 +0530 Subject: Updating Folder Name --- ...1_Understand_Linear_Transformations_visually.py | 193 --------------------- .../file2_Uniform_Scaling.py | 91 ---------- .../file3_Horizontal_Shear.py | 53 ------ .../file3_Horizontal_Shear_gif.gif | Bin 1566999 -> 0 bytes .../file4_Vertical_Shear.py | 52 ------ .../file4_Vertical_Shear_gif.gif | Bin 1347079 -> 0 bytes ...1_Understand_Linear_Transformations_visually.py | 193 +++++++++++++++++++++ .../file2_Uniform_Scaling.py | 91 ++++++++++ .../file3_Horizontal_Shear.py | 53 ++++++ .../file3_Horizontal_Shear_gif.gif | Bin 0 -> 1566999 bytes .../file4_Vertical_Shear.py | 52 ++++++ .../file4_Vertical_Shear_gif.gif | Bin 0 -> 1347079 bytes 12 files changed, 389 insertions(+), 389 deletions(-) delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file1_Understand_Linear_Transformations_visually.py delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file2_Uniform_Scaling.py delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file3_Horizontal_Shear.py delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file3_Horizontal_Shear_gif.gif delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file4_Vertical_Shear.py delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file4_Vertical_Shear_gif.gif create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_Understand_Linear_Transformations_visually.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Uniform_Scaling.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear_gif.gif create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear_gif.gif (limited to 'FSF-2020') diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file1_Understand_Linear_Transformations_visually.py b/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file1_Understand_Linear_Transformations_visually.py deleted file mode 100644 index 577032d..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file1_Understand_Linear_Transformations_visually.py +++ /dev/null @@ -1,193 +0,0 @@ -from manimlib.imports import * - -class Rotation(GraphScene): - CONFIG = { - "x_min" : -5, - "x_max" : 5, - "y_min" : -5, - "y_max" : 5, - "graph_origin" : ORIGIN+3.5*LEFT, - "x_axis_width" : 7, - "y_axis_height" : 7 - #"x_labeled_nums" : list(range(-5,6)), - #"y_labeled_nums" : list(range(-5,6)), - } - - def construct(self): - XTD = self.x_axis_width/(self.x_max-self.x_min) - YTD = self.y_axis_height/(self.y_max-self.y_min) - - introText = TextMobject("Understanding Linear Transformations") - self.play(Write(introText)) - self.wait(1) - - introText1 = TextMobject("Visually ... ") - introText1.move_to(DOWN) - self.play(Write(introText1)) - self.wait(1) - self.play(FadeOut(introText), FadeOut(introText1)) - - Text1 = TextMobject("Let $\overrightarrow{v}$ be $2\hat{i}+3\hat{j}$") - Text2 = TextMobject("$\overrightarrow{v} = 2\hat{i}+3\hat{j}$") - - Text1.move_to(4*RIGHT+2*UP) - Text2.move_to(4*RIGHT+1*UP) - self.play(Write(Text1)) - self.wait() - self.play(Transform(Text1,Text2)) - - self.setup_axes(animate=True) - arrow_v = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*LEFT + 0.25*DOWN, end = self.graph_origin+2*XTD*RIGHT+3*YTD*UP+ 0.15*RIGHT + 0.25*UP) - self.play(ShowCreation(arrow_v)) - - Text_i = TextMobject("$\hat{i}$") - Text_i.move_to(self.graph_origin+0.5*XTD*RIGHT+0.5*YTD*DOWN) - Text_i.scale(0.75) - Text_j = TextMobject("$\hat{j}$") - Text_j.move_to(self.graph_origin+0.5*XTD*LEFT+0.5*YTD*UP) - Text_j.scale(0.75) - - arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*YTD*UP+0.25*UP) - self.play(ShowCreation(arrow_i), ShowCreation(arrow_j), Write(Text_i), Write(Text_j)) - - Text_2i = TextMobject("$2\hat{i}$") - Text_2i.move_to(self.graph_origin+1*XTD*RIGHT+1*YTD*DOWN) - Text_3j = TextMobject("$3\hat{j}$") - Text_3j.move_to(self.graph_origin+1*XTD*LEFT+1.5*YTD*UP) - - arrow_2i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+2*XTD*RIGHT+ 0.25*RIGHT) - arrow_2i.set_color(YELLOW) - arrow_3j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+3*YTD*UP+0.25*UP) - arrow_3j.set_color(RED) - self.wait(0.5) - self.play(Transform(arrow_i,arrow_2i), Transform(arrow_j,arrow_3j), Transform(Text_i,Text_2i), Transform(Text_j,Text_3j)) - self.play(ApplyMethod(arrow_j.move_to,self.graph_origin+2*XTD*RIGHT+1.5*YTD*UP) , ApplyMethod(Text_j.move_to,self.graph_origin+2.5*XTD*RIGHT+1.5*YTD*UP+ 0.15*RIGHT + 0.25*UP)) - - new_Text_v = TextMobject("$\overrightarrow{v}$") - new_Text_v.move_to(self.graph_origin+0.5*XTD*RIGHT+1.5*YTD*UP) - self.play(Write(new_Text_v)) - - new_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - new_arrow_i.set_color(YELLOW) - new_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*YTD*UP+0.25*UP) - new_arrow_j.set_color(RED) - - new_Text_i = TextMobject("$\hat{i}$") - new_Text_i.move_to(self.graph_origin+0.5*XTD*RIGHT+0.5*YTD*DOWN) - new_Text_i.scale(0.75) - new_Text_j = TextMobject("$\hat{j}$") - new_Text_j.move_to(self.graph_origin+0.5*XTD*LEFT+0.5*YTD*UP) - new_Text_j.scale(0.75) - - self.wait(1) - - self.play(FadeOut(Text_i), - FadeOut(Text_j), - FadeOut(arrow_i), - FadeOut(arrow_j), - ShowCreation(new_arrow_i), - ShowCreation(new_arrow_j), - Write(new_Text_i), - Write(new_Text_j)) - - self.play(ApplyMethod(Text1.move_to,4*RIGHT)) - Text3 = TextMobject("Let the be a linear transformation function") - Text3.scale(0.5) - Text4 = TextMobject("$T$ which rotates the vectors by angle of $90^{\circ}$") - Text4.scale(0.5) - Text3.move_to(4*RIGHT+3*UP) - Text4.move_to(4*RIGHT+2.5*UP) - self.play(Write(Text3), Write(Text4)) - self.wait(2) - - Text6 = TextMobject(r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") - Text6.scale(0.75) - Text6.set_color(YELLOW) - Text6.move_to(self.graph_origin+1*XTD*RIGHT+1*YTD*DOWN) - Text7 = TextMobject(r"$\begin{pmatrix} 0 \\ 1 \end{pmatrix}$") - Text7.scale(0.75) - Text7.set_color(RED) - Text7.move_to(self.graph_origin+1*XTD*LEFT+1*YTD*UP) - - self.play(Transform(new_Text_i,Text6)) - self.play(Transform(new_Text_j,Text7)) - - Text5 = TextMobject(r"$\overrightarrow{v} = 2 $", r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$", r"+3", r"$\begin{pmatrix} 0 \\ 1 \end{pmatrix}$") - Text5[1].set_color(YELLOW) - Text5[3].set_color(RED) - Text5.move_to(4*RIGHT) - - self.play(Transform(Text1, Text5)) - self.wait() - - arrow_modified_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*UP, end = self.graph_origin-(1*YTD*UP+0.25*UP)) - arrow_modified_i.set_color(YELLOW) - arrow_modified_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - arrow_modified_j.set_color(RED) - - yellow_i = TextMobject(r"$\begin{pmatrix} 0 \\ -1 \end{pmatrix}$") - yellow_i.set_color(YELLOW).scale(0.75) - yellow_i.move_to(self.graph_origin + 1*XTD*DOWN + 1*YTD*LEFT) - - red_j = TextMobject(r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") - red_j.set_color(RED).scale(0.75) - red_j.move_to(self.graph_origin + 1*XTD*UP + 1*YTD*RIGHT) - - Text8 = TextMobject(r"$\overrightarrow{v}_{transformed} = 2 $", r"$\begin{pmatrix} 0 \\ -1 \end{pmatrix}$", r"+3", r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") - Text8[1].set_color(YELLOW) - Text8[3].set_color(RED) - Text8.move_to(4*RIGHT+1.5*DOWN) - Text8.scale(0.75) - - new_Text__v = TextMobject("$\overrightarrow{v}_{transformed}$") - new_Text__v.scale(0.75) - arrow_modified_v = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT + 0.15*UP, end = self.graph_origin+2*XTD*DOWN+3*YTD*RIGHT+ 0.15*DOWN + 0.25*RIGHT) - self.play(Transform(arrow_v, arrow_modified_v), - Transform(new_arrow_i, arrow_modified_i), - Transform(new_arrow_j, arrow_modified_j), - Transform(new_Text_i,yellow_i), - Transform(new_Text_j,red_j), - FadeOut(new_Text_v), - ApplyMethod(new_Text__v.move_to,self.graph_origin+3*XTD*RIGHT+0.5*YTD*DOWN), - Write(Text8)) - - self.play(FadeOut(Text1), FadeOut(Text3), FadeOut(Text4), ApplyMethod(Text8.move_to,4*RIGHT+3*UP)) - - Text9 = TextMobject(r"$\overrightarrow{v}_{transformed} = 2 $", r"$\hat{i}_{transformed}$", r"+3", r"$\hat{j}_{transformed}$") - Text9[1].set_color(YELLOW) - Text9[3].set_color(RED) - Text9.move_to(4*RIGHT+2*UP) - Text9.scale(0.5) - - self.play(Write(Text9)) - - v_transformed = TextMobject(r"$\overrightarrow{v}_{transformed} \equiv T(\overrightarrow{v})$") - v_transformed.scale(0.75).move_to(4*RIGHT+UP) - i_transformed = TextMobject(r"$\hat{i}_{transformed} \equiv T(\hat{i})$") - i_transformed.set_color(YELLOW).scale(0.75).move_to(4*RIGHT) - j_transformed = TextMobject(r"$\hat{v}_{transformed} \equiv T(\hat{j})$") - j_transformed.set_color(RED).scale(0.75).move_to(4*RIGHT+DOWN) - - self.play(Write(v_transformed), Write(i_transformed), Write(j_transformed)) - self.wait(3) - - Text10 = TextMobject(r"$T(\overrightarrow{v}) = $", r"$\begin{pmatrix} 3 \\ -2 \end{pmatrix}$") - Text10[1].set_color(BLUE_E) - Text10.move_to(4*RIGHT+1*UP) - Text10.scale(0.75) - - self.play(Write(Text10), ApplyMethod(v_transformed.move_to,4*RIGHT+2*UP), FadeOut(i_transformed), FadeOut(j_transformed), FadeOut(Text9)) - self.wait(1) - - self.play(FadeOut(self.axes), - FadeOut(arrow_v), - FadeOut(new_arrow_i), - FadeOut(new_arrow_j), - FadeOut(new_Text_i), - FadeOut(new_Text_i), - FadeOut(new_Text_j), - FadeOut(new_Text__v), - FadeOut(Text10), - FadeOut(v_transformed), - FadeOut(Text8)) diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file2_Uniform_Scaling.py b/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file2_Uniform_Scaling.py deleted file mode 100644 index a7856a5..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file2_Uniform_Scaling.py +++ /dev/null @@ -1,91 +0,0 @@ -from manimlib.imports import * - -class Scaling(GraphScene): - CONFIG = { - "x_min" : -5, - "x_max" : 5, - "y_min" : -5, - "y_max" : 5, - "graph_origin" : ORIGIN+3.5*LEFT, - "x_axis_width" : 7, - "y_axis_height" : 7 - #"x_labeled_nums" : list(range(-5,6)), - #"y_labeled_nums" : list(range(-5,6)), - } - - def construct(self): - XTD = self.x_axis_width/(self.x_max-self.x_min) - YTD = self.y_axis_height/(self.y_max-self.y_min) - - introText = TextMobject("Scaling") - self.play(Write(introText)) - self.wait(1) - self.play(FadeOut(introText)) - - introText = TextMobject("Uniform Scaling") - self.play(Write(introText)) - self.wait(1) - self.play(FadeOut(introText)) - - Text1 = TextMobject("Let $\overrightarrow{v}$ be $3\hat{i}+3\hat{j}$") - Text2 = TextMobject("$\overrightarrow{v} = 3\hat{i}+3\hat{j}$") - - Text1.move_to(4*RIGHT+2*UP) - Text2.move_to(4*RIGHT+1*UP) - self.play(Write(Text1)) - self.wait() - self.play(Transform(Text1,Text2)) - - self.setup_axes(animate=True) - arrow_v = Arrow(stroke_width = 4, start = self.graph_origin + 0.15*LEFT + 0.15*DOWN, end = self.graph_origin+3*XTD*RIGHT+3*YTD*UP+ 0.15*RIGHT + 0.15*UP) - vector_v = TextMobject(r"$\vec{v}$") - vector_v.move_to(self.graph_origin + 1*XTD*RIGHT + 2*YTD*UP ) - self.play(ShowCreation(arrow_v),Write(vector_v)) - scaling_factor = TextMobject(r"Scaling Factor = $\frac{4}{3}$") - scaling_factor.scale(0.75) - scaled_vector = TextMobject(r"$T(\vec{v}) = \frac{4}{3} \left[ \begin{array} {c} 3 \\ 3 \end{array} \right] = \left[ \begin{array} {c} 4 \\ 4 \end{array} \right]$") - scaled_vector.set_color(DARK_BLUE) - scaled_vector.scale(0.75) - scaling_factor.move_to(4*RIGHT) - scaled_vector.move_to(4*RIGHT+DOWN) - self.play(Write(scaling_factor)) - self.wait() - self.play(Write(scaled_vector)) - - transformed_arrow_v = Arrow(stroke_width = 2, start = self.graph_origin + 0.15*LEFT + 0.15*DOWN, end = self.graph_origin+4*XTD*RIGHT+4*YTD*UP+ 0.15*RIGHT + 0.15*UP) - transformed_arrow_v.set_color(DARK_BLUE) - transformed_vector_v = TextMobject(r"$T(\vec{v})$") - transformed_vector_v.move_to(self.graph_origin + 4.5*XTD*RIGHT + 4.5*YTD*UP ) - transformed_vector_v.set_color(DARK_BLUE) - self.play(ShowCreation(transformed_arrow_v), Write(transformed_vector_v)) - - self.wait() - - represent_text1 = TextMobject("Representation of scaling") - represent_text2 = TextMobject("of vectors in point form") - represent_text1.move_to(4*RIGHT+3*UP) - represent_text2.move_to(4*RIGHT+2*UP) - self.play(Write(represent_text1), Write(represent_text2)) - - dot_init = Dot(self.graph_origin+3*XTD*RIGHT+3*YTD*UP) - dot_trans = Dot(self.graph_origin+4*XTD*RIGHT+4*YTD*UP) - - self.play(ApplyMethod(vector_v.move_to,self.graph_origin+2.5*XTD*RIGHT+2.5*YTD*UP), - ApplyMethod(transformed_vector_v.move_to,self.graph_origin+4.5*XTD*RIGHT+4.5*YTD*UP), - ShowCreation(dot_init), - Transform(arrow_v,dot_init), - Transform(transformed_arrow_v,dot_trans)) - - self.wait(2) - - self.play(FadeOut(dot_init), - FadeOut(arrow_v), - FadeOut(transformed_arrow_v), - FadeOut(represent_text1), - FadeOut(represent_text2), - FadeOut(self.axes), - FadeOut(scaling_factor), - FadeOut(scaled_vector), - FadeOut(transformed_vector_v), - FadeOut(vector_v), - FadeOut(Text1)) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file3_Horizontal_Shear.py b/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file3_Horizontal_Shear.py deleted file mode 100644 index 91f098e..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file3_Horizontal_Shear.py +++ /dev/null @@ -1,53 +0,0 @@ -from manimlib.imports import * - -class Hori_Shear(GraphScene): - CONFIG = { - "x_min" : -5, - "x_max" : 5, - "y_min" : -5, - "y_max" : 5, - "graph_origin" : ORIGIN+3.5*LEFT, - "x_axis_width" : 7, - "y_axis_height" : 7 - #"x_labeled_nums" : list(range(-5,6)), - #"y_labeled_nums" : list(range(-5,6)), - } - - def construct(self): - XTD = self.x_axis_width/(self.x_max-self.x_min) - YTD = self.y_axis_height/(self.y_max-self.y_min) - - Text1 = TextMobject("Before"," Horizontal") - Text1[0].set_color(YELLOW) - Text2 = TextMobject("Shear Transformation") - - Text1.move_to(4*RIGHT+2*UP) - Text2.move_to(4*RIGHT+1*UP) - - self.setup_axes(animate=False) - arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+0.25*UP) - arrow_i.set_color(YELLOW) - arrow_j.set_color(YELLOW) - - square = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+2*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*YTD*UP) - square.set_color(DARK_BLUE) - self.play(ShowCreation(square), Write(Text1), Write(Text2), ShowCreation(arrow_i), ShowCreation(arrow_j)) - self.wait(1) - - Text3 = TextMobject("After"," Horizontal") - Text3[0].set_color(RED) - Text4 = TextMobject("Shear Transformation") - - Text3.move_to(4*RIGHT+2*UP) - Text4.move_to(4*RIGHT+1*UP) - - trans_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - trans_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*DOWN + 0.15*LEFT, end = self.graph_origin+1*XTD*UP+1*YTD*RIGHT+0.25*UP+0.25*RIGHT) - trans_arrow_i.set_color(RED) - trans_arrow_j.set_color(RED) - - rhombus = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+4*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*XTD*RIGHT+2*YTD*UP) - square.set_color(DARK_BLUE) - self.play(Transform(arrow_i,trans_arrow_i), Transform(arrow_j,trans_arrow_j), Transform(square,rhombus), Transform(Text1,Text3), Transform(Text2,Text4)) - self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file3_Horizontal_Shear_gif.gif b/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file3_Horizontal_Shear_gif.gif deleted file mode 100644 index 9bef1b6..0000000 Binary files a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file3_Horizontal_Shear_gif.gif and /dev/null differ diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file4_Vertical_Shear.py b/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file4_Vertical_Shear.py deleted file mode 100644 index 718e4e0..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file4_Vertical_Shear.py +++ /dev/null @@ -1,52 +0,0 @@ -from manimlib.imports import * - -class Ver_Shear(GraphScene): - CONFIG = { - "x_min" : -5, - "x_max" : 5, - "y_min" : -5, - "y_max" : 5, - "graph_origin" : ORIGIN+3.5*LEFT, - "x_axis_width" : 7, - "y_axis_height" : 7 - #"x_labeled_nums" : list(range(-5,6)), - #"y_labeled_nums" : list(range(-5,6)), - } - - def construct(self): - XTD = self.x_axis_width/(self.x_max-self.x_min) - YTD = self.y_axis_height/(self.y_max-self.y_min) - - Text1 = TextMobject("Before"," Vertical") - Text1[0].set_color(YELLOW) - Text2 = TextMobject("Shear Transformation") - - Text1.move_to(4*RIGHT+2*UP) - Text2.move_to(4*RIGHT+1*UP) - - self.setup_axes(animate=False) - arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+0.25*UP) - arrow_i.set_color(YELLOW) - arrow_j.set_color(YELLOW) - - square = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+2*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*YTD*UP) - square.set_color(DARK_BLUE) - self.play(ShowCreation(square), Write(Text1), Write(Text2), ShowCreation(arrow_i), ShowCreation(arrow_j)) - self.wait(1) - - Text3 = TextMobject("After"," Vertical") - Text3[0].set_color(RED) - Text4 = TextMobject("Shear Transformation") - - Text3.move_to(4*RIGHT+2*UP) - Text4.move_to(4*RIGHT+1*UP) - - trans_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*DOWN + 0.15*LEFT, end = self.graph_origin+1*XTD*UP+1*YTD*RIGHT+0.25*UP+0.25*RIGHT) - trans_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+ 0.25*UP) - trans_arrow_i.set_color(RED) - trans_arrow_j.set_color(RED) - - rhombus = Polygon(self.graph_origin,self.graph_origin+2*XTD*UP, self.graph_origin+2*XTD*RIGHT+4*YTD*UP, self.graph_origin+2*XTD*RIGHT+2*YTD*UP) - self.play(Transform(arrow_i,trans_arrow_i), Transform(arrow_j,trans_arrow_j), FadeOut(square), ShowCreation(rhombus), Transform(Text1,Text3), Transform(Text2,Text4)) - self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file4_Vertical_Shear_gif.gif b/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file4_Vertical_Shear_gif.gif deleted file mode 100644 index 7ca323f..0000000 Binary files a/FSF-2020/linear-algebra/linear-transformations/Linear Transformations (Linear Maps)/file4_Vertical_Shear_gif.gif and /dev/null differ diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_Understand_Linear_Transformations_visually.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_Understand_Linear_Transformations_visually.py new file mode 100644 index 0000000..577032d --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_Understand_Linear_Transformations_visually.py @@ -0,0 +1,193 @@ +from manimlib.imports import * + +class Rotation(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "graph_origin" : ORIGIN+3.5*LEFT, + "x_axis_width" : 7, + "y_axis_height" : 7 + #"x_labeled_nums" : list(range(-5,6)), + #"y_labeled_nums" : list(range(-5,6)), + } + + def construct(self): + XTD = self.x_axis_width/(self.x_max-self.x_min) + YTD = self.y_axis_height/(self.y_max-self.y_min) + + introText = TextMobject("Understanding Linear Transformations") + self.play(Write(introText)) + self.wait(1) + + introText1 = TextMobject("Visually ... ") + introText1.move_to(DOWN) + self.play(Write(introText1)) + self.wait(1) + self.play(FadeOut(introText), FadeOut(introText1)) + + Text1 = TextMobject("Let $\overrightarrow{v}$ be $2\hat{i}+3\hat{j}$") + Text2 = TextMobject("$\overrightarrow{v} = 2\hat{i}+3\hat{j}$") + + Text1.move_to(4*RIGHT+2*UP) + Text2.move_to(4*RIGHT+1*UP) + self.play(Write(Text1)) + self.wait() + self.play(Transform(Text1,Text2)) + + self.setup_axes(animate=True) + arrow_v = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*LEFT + 0.25*DOWN, end = self.graph_origin+2*XTD*RIGHT+3*YTD*UP+ 0.15*RIGHT + 0.25*UP) + self.play(ShowCreation(arrow_v)) + + Text_i = TextMobject("$\hat{i}$") + Text_i.move_to(self.graph_origin+0.5*XTD*RIGHT+0.5*YTD*DOWN) + Text_i.scale(0.75) + Text_j = TextMobject("$\hat{j}$") + Text_j.move_to(self.graph_origin+0.5*XTD*LEFT+0.5*YTD*UP) + Text_j.scale(0.75) + + arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*YTD*UP+0.25*UP) + self.play(ShowCreation(arrow_i), ShowCreation(arrow_j), Write(Text_i), Write(Text_j)) + + Text_2i = TextMobject("$2\hat{i}$") + Text_2i.move_to(self.graph_origin+1*XTD*RIGHT+1*YTD*DOWN) + Text_3j = TextMobject("$3\hat{j}$") + Text_3j.move_to(self.graph_origin+1*XTD*LEFT+1.5*YTD*UP) + + arrow_2i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+2*XTD*RIGHT+ 0.25*RIGHT) + arrow_2i.set_color(YELLOW) + arrow_3j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+3*YTD*UP+0.25*UP) + arrow_3j.set_color(RED) + self.wait(0.5) + self.play(Transform(arrow_i,arrow_2i), Transform(arrow_j,arrow_3j), Transform(Text_i,Text_2i), Transform(Text_j,Text_3j)) + self.play(ApplyMethod(arrow_j.move_to,self.graph_origin+2*XTD*RIGHT+1.5*YTD*UP) , ApplyMethod(Text_j.move_to,self.graph_origin+2.5*XTD*RIGHT+1.5*YTD*UP+ 0.15*RIGHT + 0.25*UP)) + + new_Text_v = TextMobject("$\overrightarrow{v}$") + new_Text_v.move_to(self.graph_origin+0.5*XTD*RIGHT+1.5*YTD*UP) + self.play(Write(new_Text_v)) + + new_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + new_arrow_i.set_color(YELLOW) + new_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*YTD*UP+0.25*UP) + new_arrow_j.set_color(RED) + + new_Text_i = TextMobject("$\hat{i}$") + new_Text_i.move_to(self.graph_origin+0.5*XTD*RIGHT+0.5*YTD*DOWN) + new_Text_i.scale(0.75) + new_Text_j = TextMobject("$\hat{j}$") + new_Text_j.move_to(self.graph_origin+0.5*XTD*LEFT+0.5*YTD*UP) + new_Text_j.scale(0.75) + + self.wait(1) + + self.play(FadeOut(Text_i), + FadeOut(Text_j), + FadeOut(arrow_i), + FadeOut(arrow_j), + ShowCreation(new_arrow_i), + ShowCreation(new_arrow_j), + Write(new_Text_i), + Write(new_Text_j)) + + self.play(ApplyMethod(Text1.move_to,4*RIGHT)) + Text3 = TextMobject("Let the be a linear transformation function") + Text3.scale(0.5) + Text4 = TextMobject("$T$ which rotates the vectors by angle of $90^{\circ}$") + Text4.scale(0.5) + Text3.move_to(4*RIGHT+3*UP) + Text4.move_to(4*RIGHT+2.5*UP) + self.play(Write(Text3), Write(Text4)) + self.wait(2) + + Text6 = TextMobject(r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") + Text6.scale(0.75) + Text6.set_color(YELLOW) + Text6.move_to(self.graph_origin+1*XTD*RIGHT+1*YTD*DOWN) + Text7 = TextMobject(r"$\begin{pmatrix} 0 \\ 1 \end{pmatrix}$") + Text7.scale(0.75) + Text7.set_color(RED) + Text7.move_to(self.graph_origin+1*XTD*LEFT+1*YTD*UP) + + self.play(Transform(new_Text_i,Text6)) + self.play(Transform(new_Text_j,Text7)) + + Text5 = TextMobject(r"$\overrightarrow{v} = 2 $", r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$", r"+3", r"$\begin{pmatrix} 0 \\ 1 \end{pmatrix}$") + Text5[1].set_color(YELLOW) + Text5[3].set_color(RED) + Text5.move_to(4*RIGHT) + + self.play(Transform(Text1, Text5)) + self.wait() + + arrow_modified_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*UP, end = self.graph_origin-(1*YTD*UP+0.25*UP)) + arrow_modified_i.set_color(YELLOW) + arrow_modified_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + arrow_modified_j.set_color(RED) + + yellow_i = TextMobject(r"$\begin{pmatrix} 0 \\ -1 \end{pmatrix}$") + yellow_i.set_color(YELLOW).scale(0.75) + yellow_i.move_to(self.graph_origin + 1*XTD*DOWN + 1*YTD*LEFT) + + red_j = TextMobject(r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") + red_j.set_color(RED).scale(0.75) + red_j.move_to(self.graph_origin + 1*XTD*UP + 1*YTD*RIGHT) + + Text8 = TextMobject(r"$\overrightarrow{v}_{transformed} = 2 $", r"$\begin{pmatrix} 0 \\ -1 \end{pmatrix}$", r"+3", r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") + Text8[1].set_color(YELLOW) + Text8[3].set_color(RED) + Text8.move_to(4*RIGHT+1.5*DOWN) + Text8.scale(0.75) + + new_Text__v = TextMobject("$\overrightarrow{v}_{transformed}$") + new_Text__v.scale(0.75) + arrow_modified_v = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT + 0.15*UP, end = self.graph_origin+2*XTD*DOWN+3*YTD*RIGHT+ 0.15*DOWN + 0.25*RIGHT) + self.play(Transform(arrow_v, arrow_modified_v), + Transform(new_arrow_i, arrow_modified_i), + Transform(new_arrow_j, arrow_modified_j), + Transform(new_Text_i,yellow_i), + Transform(new_Text_j,red_j), + FadeOut(new_Text_v), + ApplyMethod(new_Text__v.move_to,self.graph_origin+3*XTD*RIGHT+0.5*YTD*DOWN), + Write(Text8)) + + self.play(FadeOut(Text1), FadeOut(Text3), FadeOut(Text4), ApplyMethod(Text8.move_to,4*RIGHT+3*UP)) + + Text9 = TextMobject(r"$\overrightarrow{v}_{transformed} = 2 $", r"$\hat{i}_{transformed}$", r"+3", r"$\hat{j}_{transformed}$") + Text9[1].set_color(YELLOW) + Text9[3].set_color(RED) + Text9.move_to(4*RIGHT+2*UP) + Text9.scale(0.5) + + self.play(Write(Text9)) + + v_transformed = TextMobject(r"$\overrightarrow{v}_{transformed} \equiv T(\overrightarrow{v})$") + v_transformed.scale(0.75).move_to(4*RIGHT+UP) + i_transformed = TextMobject(r"$\hat{i}_{transformed} \equiv T(\hat{i})$") + i_transformed.set_color(YELLOW).scale(0.75).move_to(4*RIGHT) + j_transformed = TextMobject(r"$\hat{v}_{transformed} \equiv T(\hat{j})$") + j_transformed.set_color(RED).scale(0.75).move_to(4*RIGHT+DOWN) + + self.play(Write(v_transformed), Write(i_transformed), Write(j_transformed)) + self.wait(3) + + Text10 = TextMobject(r"$T(\overrightarrow{v}) = $", r"$\begin{pmatrix} 3 \\ -2 \end{pmatrix}$") + Text10[1].set_color(BLUE_E) + Text10.move_to(4*RIGHT+1*UP) + Text10.scale(0.75) + + self.play(Write(Text10), ApplyMethod(v_transformed.move_to,4*RIGHT+2*UP), FadeOut(i_transformed), FadeOut(j_transformed), FadeOut(Text9)) + self.wait(1) + + self.play(FadeOut(self.axes), + FadeOut(arrow_v), + FadeOut(new_arrow_i), + FadeOut(new_arrow_j), + FadeOut(new_Text_i), + FadeOut(new_Text_i), + FadeOut(new_Text_j), + FadeOut(new_Text__v), + FadeOut(Text10), + FadeOut(v_transformed), + FadeOut(Text8)) diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Uniform_Scaling.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Uniform_Scaling.py new file mode 100644 index 0000000..a7856a5 --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Uniform_Scaling.py @@ -0,0 +1,91 @@ +from manimlib.imports import * + +class Scaling(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "graph_origin" : ORIGIN+3.5*LEFT, + "x_axis_width" : 7, + "y_axis_height" : 7 + #"x_labeled_nums" : list(range(-5,6)), + #"y_labeled_nums" : list(range(-5,6)), + } + + def construct(self): + XTD = self.x_axis_width/(self.x_max-self.x_min) + YTD = self.y_axis_height/(self.y_max-self.y_min) + + introText = TextMobject("Scaling") + self.play(Write(introText)) + self.wait(1) + self.play(FadeOut(introText)) + + introText = TextMobject("Uniform Scaling") + self.play(Write(introText)) + self.wait(1) + self.play(FadeOut(introText)) + + Text1 = TextMobject("Let $\overrightarrow{v}$ be $3\hat{i}+3\hat{j}$") + Text2 = TextMobject("$\overrightarrow{v} = 3\hat{i}+3\hat{j}$") + + Text1.move_to(4*RIGHT+2*UP) + Text2.move_to(4*RIGHT+1*UP) + self.play(Write(Text1)) + self.wait() + self.play(Transform(Text1,Text2)) + + self.setup_axes(animate=True) + arrow_v = Arrow(stroke_width = 4, start = self.graph_origin + 0.15*LEFT + 0.15*DOWN, end = self.graph_origin+3*XTD*RIGHT+3*YTD*UP+ 0.15*RIGHT + 0.15*UP) + vector_v = TextMobject(r"$\vec{v}$") + vector_v.move_to(self.graph_origin + 1*XTD*RIGHT + 2*YTD*UP ) + self.play(ShowCreation(arrow_v),Write(vector_v)) + scaling_factor = TextMobject(r"Scaling Factor = $\frac{4}{3}$") + scaling_factor.scale(0.75) + scaled_vector = TextMobject(r"$T(\vec{v}) = \frac{4}{3} \left[ \begin{array} {c} 3 \\ 3 \end{array} \right] = \left[ \begin{array} {c} 4 \\ 4 \end{array} \right]$") + scaled_vector.set_color(DARK_BLUE) + scaled_vector.scale(0.75) + scaling_factor.move_to(4*RIGHT) + scaled_vector.move_to(4*RIGHT+DOWN) + self.play(Write(scaling_factor)) + self.wait() + self.play(Write(scaled_vector)) + + transformed_arrow_v = Arrow(stroke_width = 2, start = self.graph_origin + 0.15*LEFT + 0.15*DOWN, end = self.graph_origin+4*XTD*RIGHT+4*YTD*UP+ 0.15*RIGHT + 0.15*UP) + transformed_arrow_v.set_color(DARK_BLUE) + transformed_vector_v = TextMobject(r"$T(\vec{v})$") + transformed_vector_v.move_to(self.graph_origin + 4.5*XTD*RIGHT + 4.5*YTD*UP ) + transformed_vector_v.set_color(DARK_BLUE) + self.play(ShowCreation(transformed_arrow_v), Write(transformed_vector_v)) + + self.wait() + + represent_text1 = TextMobject("Representation of scaling") + represent_text2 = TextMobject("of vectors in point form") + represent_text1.move_to(4*RIGHT+3*UP) + represent_text2.move_to(4*RIGHT+2*UP) + self.play(Write(represent_text1), Write(represent_text2)) + + dot_init = Dot(self.graph_origin+3*XTD*RIGHT+3*YTD*UP) + dot_trans = Dot(self.graph_origin+4*XTD*RIGHT+4*YTD*UP) + + self.play(ApplyMethod(vector_v.move_to,self.graph_origin+2.5*XTD*RIGHT+2.5*YTD*UP), + ApplyMethod(transformed_vector_v.move_to,self.graph_origin+4.5*XTD*RIGHT+4.5*YTD*UP), + ShowCreation(dot_init), + Transform(arrow_v,dot_init), + Transform(transformed_arrow_v,dot_trans)) + + self.wait(2) + + self.play(FadeOut(dot_init), + FadeOut(arrow_v), + FadeOut(transformed_arrow_v), + FadeOut(represent_text1), + FadeOut(represent_text2), + FadeOut(self.axes), + FadeOut(scaling_factor), + FadeOut(scaled_vector), + FadeOut(transformed_vector_v), + FadeOut(vector_v), + FadeOut(Text1)) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear.py new file mode 100644 index 0000000..91f098e --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear.py @@ -0,0 +1,53 @@ +from manimlib.imports import * + +class Hori_Shear(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "graph_origin" : ORIGIN+3.5*LEFT, + "x_axis_width" : 7, + "y_axis_height" : 7 + #"x_labeled_nums" : list(range(-5,6)), + #"y_labeled_nums" : list(range(-5,6)), + } + + def construct(self): + XTD = self.x_axis_width/(self.x_max-self.x_min) + YTD = self.y_axis_height/(self.y_max-self.y_min) + + Text1 = TextMobject("Before"," Horizontal") + Text1[0].set_color(YELLOW) + Text2 = TextMobject("Shear Transformation") + + Text1.move_to(4*RIGHT+2*UP) + Text2.move_to(4*RIGHT+1*UP) + + self.setup_axes(animate=False) + arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+0.25*UP) + arrow_i.set_color(YELLOW) + arrow_j.set_color(YELLOW) + + square = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+2*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*YTD*UP) + square.set_color(DARK_BLUE) + self.play(ShowCreation(square), Write(Text1), Write(Text2), ShowCreation(arrow_i), ShowCreation(arrow_j)) + self.wait(1) + + Text3 = TextMobject("After"," Horizontal") + Text3[0].set_color(RED) + Text4 = TextMobject("Shear Transformation") + + Text3.move_to(4*RIGHT+2*UP) + Text4.move_to(4*RIGHT+1*UP) + + trans_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + trans_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*DOWN + 0.15*LEFT, end = self.graph_origin+1*XTD*UP+1*YTD*RIGHT+0.25*UP+0.25*RIGHT) + trans_arrow_i.set_color(RED) + trans_arrow_j.set_color(RED) + + rhombus = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+4*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*XTD*RIGHT+2*YTD*UP) + square.set_color(DARK_BLUE) + self.play(Transform(arrow_i,trans_arrow_i), Transform(arrow_j,trans_arrow_j), Transform(square,rhombus), Transform(Text1,Text3), Transform(Text2,Text4)) + self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear_gif.gif b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear_gif.gif new file mode 100644 index 0000000..9bef1b6 Binary files /dev/null and b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear_gif.gif differ diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear.py new file mode 100644 index 0000000..718e4e0 --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear.py @@ -0,0 +1,52 @@ +from manimlib.imports import * + +class Ver_Shear(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "graph_origin" : ORIGIN+3.5*LEFT, + "x_axis_width" : 7, + "y_axis_height" : 7 + #"x_labeled_nums" : list(range(-5,6)), + #"y_labeled_nums" : list(range(-5,6)), + } + + def construct(self): + XTD = self.x_axis_width/(self.x_max-self.x_min) + YTD = self.y_axis_height/(self.y_max-self.y_min) + + Text1 = TextMobject("Before"," Vertical") + Text1[0].set_color(YELLOW) + Text2 = TextMobject("Shear Transformation") + + Text1.move_to(4*RIGHT+2*UP) + Text2.move_to(4*RIGHT+1*UP) + + self.setup_axes(animate=False) + arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+0.25*UP) + arrow_i.set_color(YELLOW) + arrow_j.set_color(YELLOW) + + square = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+2*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*YTD*UP) + square.set_color(DARK_BLUE) + self.play(ShowCreation(square), Write(Text1), Write(Text2), ShowCreation(arrow_i), ShowCreation(arrow_j)) + self.wait(1) + + Text3 = TextMobject("After"," Vertical") + Text3[0].set_color(RED) + Text4 = TextMobject("Shear Transformation") + + Text3.move_to(4*RIGHT+2*UP) + Text4.move_to(4*RIGHT+1*UP) + + trans_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*DOWN + 0.15*LEFT, end = self.graph_origin+1*XTD*UP+1*YTD*RIGHT+0.25*UP+0.25*RIGHT) + trans_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+ 0.25*UP) + trans_arrow_i.set_color(RED) + trans_arrow_j.set_color(RED) + + rhombus = Polygon(self.graph_origin,self.graph_origin+2*XTD*UP, self.graph_origin+2*XTD*RIGHT+4*YTD*UP, self.graph_origin+2*XTD*RIGHT+2*YTD*UP) + self.play(Transform(arrow_i,trans_arrow_i), Transform(arrow_j,trans_arrow_j), FadeOut(square), ShowCreation(rhombus), Transform(Text1,Text3), Transform(Text2,Text4)) + self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear_gif.gif b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear_gif.gif new file mode 100644 index 0000000..7ca323f Binary files /dev/null and b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear_gif.gif differ -- cgit From 1e686327480f17e623f1aa51885ba44a7486ae99 Mon Sep 17 00:00:00 2001 From: stayaryan Date: Tue, 26 May 2020 13:34:16 +0530 Subject: Update README.md --- FSF-2020/calculus/intro-to-calculus/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus/intro-to-calculus/README.md b/FSF-2020/calculus/intro-to-calculus/README.md index e69de29..a417361 100644 --- a/FSF-2020/calculus/intro-to-calculus/README.md +++ b/FSF-2020/calculus/intro-to-calculus/README.md @@ -0,0 +1,8 @@ +Contributor: Aryan Singh +Subtopics covered + - When do limits exist? + - How Fast am I going?-An intro to derivatives + - Infinte sums in a nutshell(Riemann integrals) + - Fundamental Theorem of calculus + - Volume and surface area of Gabriel's Horn + - Infinite sequences and series -- cgit From a92ab419ce219a9bab4bbe03ea0f8be004e640ea Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Tue, 26 May 2020 14:38:07 +0530 Subject: renamed files --- .../double-integrals/area_Under_func.gif | Bin 1277788 -> 0 bytes .../double-integrals/area_under_func.py | 73 ------ .../double-integrals/elementary_area.gif | Bin 547368 -> 0 bytes .../double-integrals/elementary_area.py | 144 ----------- .../double-integrals/file1_surface.gif | Bin 0 -> 3365528 bytes .../double-integrals/file1_surface.py | 236 +++++++++++++++++ .../double-integrals/file2_area_under_func.gif | Bin 0 -> 1277788 bytes .../double-integrals/file2_area_under_func.py | 73 ++++++ .../file3_y_limit_dependent_on_x.gif | Bin 0 -> 1170435 bytes .../file3_y_limit_dependent_on_x.py | 113 ++++++++ .../double-integrals/file4_non_rect_region.gif | Bin 0 -> 2529511 bytes .../double-integrals/file4_non_rect_region.py | 154 +++++++++++ .../double-integrals/file5_elementary_area.gif | Bin 0 -> 547368 bytes .../double-integrals/file5_elementary_area.py | 144 +++++++++++ .../double-integrals/non_rect_region.gif | Bin 2529511 -> 0 bytes .../double-integrals/non_rect_region.py | 154 ----------- .../double-integrals/surface.gif | Bin 3365528 -> 0 bytes .../double-integrals/surface.py | 236 ----------------- .../double-integrals/y_limit_dependent_on_x.gif | Bin 1170435 -> 0 bytes .../double-integrals/y_limit_dependent_on_x.py | 113 -------- .../fubini's-theorem/file1_surface1.gif | Bin 0 -> 3752052 bytes .../fubini's-theorem/file1_surface1.py | 232 +++++++++++++++++ .../fubini's-theorem/file2_surface2.gif | Bin 0 -> 2556585 bytes .../fubini's-theorem/file2_surface2.py | 286 +++++++++++++++++++++ .../fubini's_theorem/surface1.gif | Bin 3752052 -> 0 bytes .../fubini's_theorem/surface1.py | 232 ----------------- .../fubini's_theorem/surface2.gif | Bin 2556585 -> 0 bytes .../fubini's_theorem/surface2.py | 286 --------------------- 28 files changed, 1238 insertions(+), 1238 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/area_Under_func.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/area_under_func.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/elementary_area.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/elementary_area.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/non_rect_region.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/non_rect_region.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/surface.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/surface.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/y_limit_dependent_on_x.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/y_limit_dependent_on_x.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface1.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface1.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface2.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface2.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/area_Under_func.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/area_Under_func.gif deleted file mode 100644 index 223218b..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/area_Under_func.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/area_under_func.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/area_under_func.py deleted file mode 100644 index 773840c..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/area_under_func.py +++ /dev/null @@ -1,73 +0,0 @@ -from manimlib.imports import * - - -class AreaUnderIntegral(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 5, - "y_min" : 0, - "y_max" : 6, - "Func":lambda x : 1+x**2*np.exp(-.15*x**2) - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - - int_area_sym=TextMobject("$$\int_{a}^b f(x)dx$$").shift(2*UP) - area_mean_text = TextMobject(r"means area under the curve of $f(x)$ \\ in the region $a\leq x\leq b$").next_to(int_area_sym,DOWN) - - opening_text=VGroup(*[int_area_sym,area_mean_text]) - self.play(Write(opening_text),run_time=4) - self.wait(2) - self.play(FadeOut(opening_text)) - - self.setup_axes(animate=True) - func= self.get_graph(self.Func, x_min=0,x_max=5) - self.curve=func - - func_text = TextMobject(r"$y = f(x)$").next_to(func,UP) - min_lim = self.get_vertical_line_to_graph(1,func,DashedLine,color=YELLOW) - tick_a=TextMobject(r"$a$").next_to(min_lim,DOWN) - max_lim = self.get_vertical_line_to_graph(4,func,DashedLine,color=YELLOW) - tick_b=TextMobject(r"$b$").next_to(max_lim,DOWN) - - # area = self.get_area(func,1,4) - - self.play(ShowCreation(func), ShowCreation(func_text)) - - self.wait(2) - self.play(ShowCreation(min_lim),Write(tick_a), ShowCreation(max_lim),Write(tick_b),run_time=0.5) - - - approx_text=TextMobject(r"The area can be approximated as \\ sum of small rectangles").next_to(func,4*Y) - self.play(Write(approx_text)) - - rect_list = self.get_riemann_rectangles_list( - self.curve, 5, - max_dx = 0.25, - x_min = 1, - x_max = 4, - ) - flat_graph = self.get_graph(lambda t : 0) - rects = self.get_riemann_rectangles( flat_graph, x_min = 1, x_max = 4, dx = 0.5) - for new_rects in rect_list: - new_rects.set_fill(opacity = 0.8) - rects.align_submobjects(new_rects) - for alt_rect in rects[::2]: - alt_rect.set_fill(opacity = 0) - self.play(Transform( - rects, new_rects, - run_time = 1.5, - lag_ratio = 0.5 - )) - conclude_text=TextMobject(r"Making the rectangles infinitesimally thin \\ we get the real area under the curve.").next_to(func,4*Y) - self.play(Transform(approx_text,conclude_text)) - self.wait(3) - int_area_sym.next_to(self.curve,IN) - self.play(Transform(conclude_text,int_area_sym)) - - # self.play(ShowCreation(area)) - self.wait(3) - -#uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/elementary_area.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/elementary_area.gif deleted file mode 100644 index 5c9ac03..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/elementary_area.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/elementary_area.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/elementary_area.py deleted file mode 100644 index 362b6f8..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/elementary_area.py +++ /dev/null @@ -1,144 +0,0 @@ -from manimlib.imports import * - -class ElementaryArea(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 2, - "y_min" : 0, - "y_max" : 2, - "x_tick_frequency" : 1, - "y_tick_frequency" : 1, - # "x_labeled_nums": list(np.arange(0,3)), - # "y_labeled_nums": list(np.arange(0 ,3)), - "x_axis_width": 6, - "y_axis_height": 6, - "graph_origin": ORIGIN+3.5*LEFT+3.5*DOWN, - } - - def construct(self): - X = self.x_axis_width/(self.x_max- self.x_min) - Y = self.y_axis_height/(self.y_max- self.y_min) - self.X=X ;self.Y=Y - self.setup_axes(animate=False) - - caption=TextMobject("The elementary area in ").to_edge(UP) - rect_text=TextMobject("Cartesian Coordinates").next_to(caption,DOWN,) - polar_text=TextMobject("Polar Coordinates").next_to(caption,DOWN,) - - self.add(caption) - self.play(Write(rect_text)) - self.get_rect_element() - # self.play(Write(polar_text)) - self.play(ReplacementTransform(rect_text,polar_text), - FadeOut(VGroup(self.dydx,self.rect_brace_gr))) - self.get_polar_element() - - - - def get_rect_element(self): - rect=Rectangle( - height=2, width=3,fill_color=BLUE_D, - fill_opacity=1, color=BLUE_D - ).scale(.75).move_to( - self.graph_origin+(RIGHT*self.X+UP*self.Y) - ) - dx_brace=Brace(rect, DOWN, buff = SMALL_BUFF) - dx_label=dx_brace.get_text("$dx$", buff = SMALL_BUFF) - dx_brace_gr=VGroup(dx_brace,dx_label) - - dy_brace=Brace(rect,RIGHT, buff = SMALL_BUFF) - dy_label=dy_brace.get_text("$dy$", buff = SMALL_BUFF) - dy_brace_gr=VGroup(dy_brace,dy_label) - - brace_gr=VGroup(dx_brace_gr,dy_brace_gr) - - dydx=TextMobject("$dxdy$",color=BLACK).next_to(rect,IN) - - self.play(FadeIn(rect)) - self.play(GrowFromCenter(brace_gr)) - self.play(GrowFromCenter(dydx)) - - self.rect=rect - self.rect_brace_gr=brace_gr - self.dydx=dydx - self.wait(2) - - - def get_polar_element(self): - X=self.X ;Y=self.Y - theta1=25*DEGREES - dtheta=TAU/12 - r_in=1.3*X ; r_out=1.9*X - - arc=AnnularSector( - arc_center=self.graph_origin, - inner_radius=r_in, - outer_radius=r_out , - angle= dtheta, - start_angle= theta1, - fill_opacity= 1, - stroke_width= 0, - color= BLUE_D, - ) - - - # # #getting braces - r_in_theta1=self.graph_origin+r_in*(np.cos(theta1)*RIGHT+np.sin(theta1)*UP) - dr_line=Line(r_in_theta1,r_in_theta1+RIGHT*(r_out-r_in)) - dr_brace=Brace(dr_line, DOWN, buff = SMALL_BUFF - ).rotate(theta1, about_point=r_in_theta1 - ) - dr_label=dr_brace.get_text("$dr$", buff = SMALL_BUFF) - dr_brace_gr=VGroup(dr_brace,dr_label) - - theta2=theta1+dtheta - r_out_theta2=self.graph_origin+r_out*( - np.cos(theta2)*RIGHT+np.sin(theta2)*UP - ) - rdt_line=Line(r_out_theta2,r_out_theta2 - +DOWN*(r_out*dtheta) - ) - rdt_brace=Brace(rdt_line, RIGHT, - buff = MED_SMALL_BUFF).rotate( - theta2-(dtheta/2), about_point=r_out_theta2 - ) - rdt_label=rdt_brace.get_text("$rd\\theta$",buff = SMALL_BUFF) - rdt_brace_gr=VGroup(rdt_brace,rdt_label) - - #getting label r and dtheta - r1=DashedLine(self.graph_origin,r_in_theta1).set_color(RED) - r2=DashedLine(self.graph_origin,r_out_theta2).set_color(RED) - r_brace=Brace(r1, DOWN, buff = SMALL_BUFF).rotate(theta1, about_point=self.graph_origin) - r_label=r_brace.get_text("$r$", buff = SMALL_BUFF) - r_brace_gr=VGroup(r_brace,r_label) - - dtheta_arc=Arc( - arc_center=self.graph_origin, - radius=.5*X, - angle= dtheta, - start_angle= theta1, - ) - dtheta_arc_label=TextMobject("$d\\theta$").move_to(.99*dtheta_arc.get_corner(UR)) - dtheta_label=VGroup(dtheta_arc,dtheta_arc_label) - - - rdrdt=TextMobject("$rdrd\\theta$",color=BLACK).next_to(arc,IN) - self.play(ReplacementTransform(self.rect,arc)) - self.wait() - self.play(ShowCreation(r1), - ShowCreation(r2) - ) - self.play(ShowCreation(r_brace_gr), - Write(dtheta_label) - ) - self.wait() - self.play(GrowFromCenter(rdt_brace_gr)) - self.wait(.5) - self.play(GrowFromCenter(dr_brace_gr)) - self.wait(.5) - self.play(GrowFromCenter(rdrdt)) - - self.wait(2) - - - #uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif new file mode 100644 index 0000000..ae23a7b Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.py new file mode 100644 index 0000000..a794f46 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.py @@ -0,0 +1,236 @@ +from manimlib.imports import * + +class SurfacesAnimation(ThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": 0, + "x_max": 8, + "y_min": 0, + "y_max": 8, + "z_min": 0, + "z_max": 6, + "a":1 ,"b": 6, "c":2 , "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("$z=f(x,y)$").set_color(PINK) + self.add_fixed_in_frame_mobjects(fn_text) + fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) + + R=TextMobject("R").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=PINK, + stroke_width=0.8, + stroke_color=WHITE, + ) + + + self.begin_ambient_camera_rotation(rate=0.07) + self.play(Write(surface)) + # self.play(LaggedStart(ShowCreation(surface))) + + self.get_lines() + # self.play(FadeIn(self.axes.input_plane)) + self.wait(3) + + def get_surface(self,axes, func, **kwargs): + config = { + "u_min": axes.a, + "u_max": axes.b, + "v_min": axes.c, + "v_max": axes.d, + "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,"RED")) + + 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: 0 + ) + 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 + + + +#uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif new file mode 100644 index 0000000..223218b Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.py new file mode 100644 index 0000000..773840c --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.py @@ -0,0 +1,73 @@ +from manimlib.imports import * + + +class AreaUnderIntegral(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 5, + "y_min" : 0, + "y_max" : 6, + "Func":lambda x : 1+x**2*np.exp(-.15*x**2) + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + int_area_sym=TextMobject("$$\int_{a}^b f(x)dx$$").shift(2*UP) + area_mean_text = TextMobject(r"means area under the curve of $f(x)$ \\ in the region $a\leq x\leq b$").next_to(int_area_sym,DOWN) + + opening_text=VGroup(*[int_area_sym,area_mean_text]) + self.play(Write(opening_text),run_time=4) + self.wait(2) + self.play(FadeOut(opening_text)) + + self.setup_axes(animate=True) + func= self.get_graph(self.Func, x_min=0,x_max=5) + self.curve=func + + func_text = TextMobject(r"$y = f(x)$").next_to(func,UP) + min_lim = self.get_vertical_line_to_graph(1,func,DashedLine,color=YELLOW) + tick_a=TextMobject(r"$a$").next_to(min_lim,DOWN) + max_lim = self.get_vertical_line_to_graph(4,func,DashedLine,color=YELLOW) + tick_b=TextMobject(r"$b$").next_to(max_lim,DOWN) + + # area = self.get_area(func,1,4) + + self.play(ShowCreation(func), ShowCreation(func_text)) + + self.wait(2) + self.play(ShowCreation(min_lim),Write(tick_a), ShowCreation(max_lim),Write(tick_b),run_time=0.5) + + + approx_text=TextMobject(r"The area can be approximated as \\ sum of small rectangles").next_to(func,4*Y) + self.play(Write(approx_text)) + + rect_list = self.get_riemann_rectangles_list( + self.curve, 5, + max_dx = 0.25, + x_min = 1, + x_max = 4, + ) + flat_graph = self.get_graph(lambda t : 0) + rects = self.get_riemann_rectangles( flat_graph, x_min = 1, x_max = 4, dx = 0.5) + for new_rects in rect_list: + new_rects.set_fill(opacity = 0.8) + rects.align_submobjects(new_rects) + for alt_rect in rects[::2]: + alt_rect.set_fill(opacity = 0) + self.play(Transform( + rects, new_rects, + run_time = 1.5, + lag_ratio = 0.5 + )) + conclude_text=TextMobject(r"Making the rectangles infinitesimally thin \\ we get the real area under the curve.").next_to(func,4*Y) + self.play(Transform(approx_text,conclude_text)) + self.wait(3) + int_area_sym.next_to(self.curve,IN) + self.play(Transform(conclude_text,int_area_sym)) + + # self.play(ShowCreation(area)) + self.wait(3) + +#uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif new file mode 100644 index 0000000..a2bfd9d Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.py new file mode 100644 index 0000000..4894ebf --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.py @@ -0,0 +1,113 @@ +from manimlib.imports import * + +class YlimitXdependent(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 1, + "y_min" : 0, + "y_max" : 2, + "x_tick_frequency" : 1, + "y_tick_frequency" : 1, + "x_labeled_nums": list(np.arange(0,2)), + "y_labeled_nums": list(np.arange(0 ,3)), + "x_axis_width": 3.5, + "y_axis_height": 6, + "graph_origin": ORIGIN+2.5*LEFT+3*DOWN, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + self.setup_axes(animate=False) + + line= self.get_graph( + lambda x : 2-2*x , + x_min = 0, + x_max = 1, + color = RED) + line_eqn=TextMobject("2x+y=2").move_to(self.graph_origin+.8*X+Y).rotate(np.arctan(-2)) + self.line=line + + caption=TextMobject(r"See the value of $y$ \\ is changing with $x$").move_to(self.graph_origin+1.2*X+1.8*Y) + self.play(ShowCreation(line),Write(line_eqn)) + # self.show_area() + self.show_rects() + self.play(Write(caption)) + self.show_y_values_at_different_x() + + self.wait(.5) + + ################### + def show_area(self): + area = self.get_riemann_rectangles( + self.line, + x_min = 0, + x_max = 1, + dx =.0001, + start_color = BLUE, + end_color = BLUE, + fill_opacity = 1, + stroke_width = 0, + ) + self.play(ShowCreation(area)) + # self.transform_between_riemann_rects(self.rects,area) + self.area = area + + def show_rects(self): + rects = self.get_riemann_rectangles( + self.line, + x_min = 0, + x_max = 1, + dx =.01, + start_color = BLUE, + end_color = BLUE, + fill_opacity =1, + stroke_width = 0, + ) + # self.play(ShowCreation(rects)) + # self.transform_between_riemann_rects(self.area,rects) + self.rects=rects + + def show_y_values_at_different_x(self): + rects=self.rects + rect = rects[len(rects)*1//10] + dx_brace = Brace(rect, DOWN, buff = 0) + dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) + dx_brace_group = VGroup(dx_brace,dx_label) + rp=int(len(rects)/10) + rects_subset = self.rects[3*rp:5*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, LEFT, buff = 0) + y = TexMobject("y=2-2x")#.rotate(PI/2) + y.next_to(brace, LEFT, SMALL_BUFF) + anims = [ + rect.set_fill, BLUE_E, 1, + dx_brace_group.next_to, rect, DOWN, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, BLUE, .75, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_y, y), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(y) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_y = y + + y = last_y + y_brace = last_brace + + +#uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif new file mode 100644 index 0000000..c8e7c8c Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.py new file mode 100644 index 0000000..793a000 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.py @@ -0,0 +1,154 @@ +from manimlib.imports import * + +class AreaUnderCurve(GraphScene): + CONFIG = { + "x_min" : -1, + "x_max" : 8, + "y_min" : -1, + "y_max" : 5, + "y_axis_label": "$y$", + "x_tick_frequency" : 1, + "y_tick_frequency" : 1, + "x_labeled_nums": list(np.arange(-1, 9)), + "y_labeled_nums": list(np.arange(-1, 6)), + "y_axis_height":5.5, + "graph_origin": ORIGIN+4*LEFT+2.5*DOWN, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + sofar_text=TextMobject(r"So far we have integrated over \\ rectangular regions") + self.play(Write(sofar_text)) + self.play(sofar_text.to_edge,UP) + + self.setup_axes(animate=False) + + rect= self.get_graph( + lambda x : 3, + x_min = 0, + x_max = 5, + color = GREEN) + + rect_region = self.get_riemann_rectangles( + rect, + x_min = 0, + x_max = 5, + dx =.01, + start_color = GREEN, + end_color = GREEN, + fill_opacity = 0.75, + stroke_width = 0, + ) + + self.play(ShowCreation(rect_region)) + self.wait(.5) + + rect_int=TextMobject(r"Here the integration limits are set as").to_edge(UP) + rect_lim=TextMobject(r"$$\int_{x=0}^{5}\int_{y=0}^{3}$$").next_to(rect_int,DOWN) + const_text=TextMobject(r"$\longleftarrow $ \textsf the limits are\\ constant values").next_to(rect_lim,RIGHT) + + self.play(ReplacementTransform(sofar_text,rect_int)) + self.wait(1.5) + self.play(FadeIn(rect_lim)) + self.wait(2) + self.play(Write(const_text)) + self.wait(2) + self.play(FadeOut(rect_int), FadeOut(rect_lim),FadeOut(const_text)) + + + non_rect_text=TextMobject(r"Now we see how to integrate over \\ non-rectangular regions") + non_rect_text.to_edge(UP) + self.play(Write(non_rect_text)) + self.wait(1.5) + self.play(FadeOut(rect_region)) + + c1= self.get_graph( + lambda x : x**2/4, + x_min = 0, + x_max = 4, + color = RED) + + c1_region = self.get_riemann_rectangles( + c1, + x_min = 0, + x_max = 4, + dx =.01, + start_color = BLUE, + end_color = BLUE, + fill_opacity = 0.75, + stroke_width = 0, + ) + self.add(c1,c1_region) + # self.wait(2) + + c2= self.get_graph( + lambda x :12-2*x, + x_min = 4, + x_max = 6, + color = RED) + + c2_region = self.get_riemann_rectangles( + c2, + x_min = 4, + x_max = 6, + dx =.01, + start_color = BLUE, + end_color = BLUE, + fill_opacity = .75, + stroke_width = 0, + ) + self.add(c2_region,c2) + self.wait(1.5) + c=VGroup(*[c1,c2]) + + no_func_text=TextMobject(r"The whole region can't be expressed as\\ bounded by a single $f(x)$").next_to(c2,UP,buff=LARGE_BUFF) + + self.play(ReplacementTransform(non_rect_text,no_func_text)) + self.wait(1) + self.play(Indicate(c)) + self.wait(2) + + div_region_text=TextMobject(r"So the region is divided into two").next_to(c2,UP,buff=MED_LARGE_BUFF) + self.play(ReplacementTransform(no_func_text,div_region_text)) + + c2.set_color(YELLOW) + self.play(c2_region.set_color,YELLOW) + c1_text=TextMobject("$\dfrac{x^2}{4}$").next_to(c1,IN) + c2_text=TextMobject("$12-2x$").next_to(c2,IN+2*X) + c_text=VGroup(*[c1_text,c2_text]) + + self.play(FadeIn(c_text)) + self.wait(.4) + self.play(Indicate(c1),Indicate(c1_text)) + self.play(Indicate(c2),Indicate(c2_text)) + + easy_text=TextMobject(r"Now the limis can be set easily").next_to(c2,UP,buff=.5) + self.play(ReplacementTransform(div_region_text,easy_text)) + + c1_int=TextMobject(r"$$\int_{x=0}^{4}\int_{y=0}^{\dfrac{x^2}{4}}$$").next_to(c1,IN).shift(.5*(-X+1.3*Y)) + c2_int=TextMobject(r"$$\int_{x=4}^{6}\int_{y=0}^{12-2x}$$").next_to(c2,IN+X) + + self.play(ReplacementTransform(c1_text,c1_int),ReplacementTransform(c2_text,c2_int)) + self.wait(2) + + total_int=TextMobject(r"The total integraton= ").to_edge(UP) + plus=TextMobject("$$+$$").move_to(self.graph_origin+4*X+4.8*Y) + self.play(ReplacementTransform(easy_text,total_int)) + self.play(c2_region.set_color,BLUE) + self.play(c1_int.next_to,c1,.1*UP, c2_int.next_to,plus,RIGHT, FadeIn(plus)) + + region=VGroup(*[c1_region,c2_region]) + region.set_color(GREEN) + self.play(ShowCreation(region)) + self.wait(3) + + + +#uploaded by Somnath Pandit.FSF2020_Double_Integral + + + + + diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif new file mode 100644 index 0000000..5c9ac03 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.py new file mode 100644 index 0000000..362b6f8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.py @@ -0,0 +1,144 @@ +from manimlib.imports import * + +class ElementaryArea(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 2, + "y_min" : 0, + "y_max" : 2, + "x_tick_frequency" : 1, + "y_tick_frequency" : 1, + # "x_labeled_nums": list(np.arange(0,3)), + # "y_labeled_nums": list(np.arange(0 ,3)), + "x_axis_width": 6, + "y_axis_height": 6, + "graph_origin": ORIGIN+3.5*LEFT+3.5*DOWN, + } + + def construct(self): + X = self.x_axis_width/(self.x_max- self.x_min) + Y = self.y_axis_height/(self.y_max- self.y_min) + self.X=X ;self.Y=Y + self.setup_axes(animate=False) + + caption=TextMobject("The elementary area in ").to_edge(UP) + rect_text=TextMobject("Cartesian Coordinates").next_to(caption,DOWN,) + polar_text=TextMobject("Polar Coordinates").next_to(caption,DOWN,) + + self.add(caption) + self.play(Write(rect_text)) + self.get_rect_element() + # self.play(Write(polar_text)) + self.play(ReplacementTransform(rect_text,polar_text), + FadeOut(VGroup(self.dydx,self.rect_brace_gr))) + self.get_polar_element() + + + + def get_rect_element(self): + rect=Rectangle( + height=2, width=3,fill_color=BLUE_D, + fill_opacity=1, color=BLUE_D + ).scale(.75).move_to( + self.graph_origin+(RIGHT*self.X+UP*self.Y) + ) + dx_brace=Brace(rect, DOWN, buff = SMALL_BUFF) + dx_label=dx_brace.get_text("$dx$", buff = SMALL_BUFF) + dx_brace_gr=VGroup(dx_brace,dx_label) + + dy_brace=Brace(rect,RIGHT, buff = SMALL_BUFF) + dy_label=dy_brace.get_text("$dy$", buff = SMALL_BUFF) + dy_brace_gr=VGroup(dy_brace,dy_label) + + brace_gr=VGroup(dx_brace_gr,dy_brace_gr) + + dydx=TextMobject("$dxdy$",color=BLACK).next_to(rect,IN) + + self.play(FadeIn(rect)) + self.play(GrowFromCenter(brace_gr)) + self.play(GrowFromCenter(dydx)) + + self.rect=rect + self.rect_brace_gr=brace_gr + self.dydx=dydx + self.wait(2) + + + def get_polar_element(self): + X=self.X ;Y=self.Y + theta1=25*DEGREES + dtheta=TAU/12 + r_in=1.3*X ; r_out=1.9*X + + arc=AnnularSector( + arc_center=self.graph_origin, + inner_radius=r_in, + outer_radius=r_out , + angle= dtheta, + start_angle= theta1, + fill_opacity= 1, + stroke_width= 0, + color= BLUE_D, + ) + + + # # #getting braces + r_in_theta1=self.graph_origin+r_in*(np.cos(theta1)*RIGHT+np.sin(theta1)*UP) + dr_line=Line(r_in_theta1,r_in_theta1+RIGHT*(r_out-r_in)) + dr_brace=Brace(dr_line, DOWN, buff = SMALL_BUFF + ).rotate(theta1, about_point=r_in_theta1 + ) + dr_label=dr_brace.get_text("$dr$", buff = SMALL_BUFF) + dr_brace_gr=VGroup(dr_brace,dr_label) + + theta2=theta1+dtheta + r_out_theta2=self.graph_origin+r_out*( + np.cos(theta2)*RIGHT+np.sin(theta2)*UP + ) + rdt_line=Line(r_out_theta2,r_out_theta2 + +DOWN*(r_out*dtheta) + ) + rdt_brace=Brace(rdt_line, RIGHT, + buff = MED_SMALL_BUFF).rotate( + theta2-(dtheta/2), about_point=r_out_theta2 + ) + rdt_label=rdt_brace.get_text("$rd\\theta$",buff = SMALL_BUFF) + rdt_brace_gr=VGroup(rdt_brace,rdt_label) + + #getting label r and dtheta + r1=DashedLine(self.graph_origin,r_in_theta1).set_color(RED) + r2=DashedLine(self.graph_origin,r_out_theta2).set_color(RED) + r_brace=Brace(r1, DOWN, buff = SMALL_BUFF).rotate(theta1, about_point=self.graph_origin) + r_label=r_brace.get_text("$r$", buff = SMALL_BUFF) + r_brace_gr=VGroup(r_brace,r_label) + + dtheta_arc=Arc( + arc_center=self.graph_origin, + radius=.5*X, + angle= dtheta, + start_angle= theta1, + ) + dtheta_arc_label=TextMobject("$d\\theta$").move_to(.99*dtheta_arc.get_corner(UR)) + dtheta_label=VGroup(dtheta_arc,dtheta_arc_label) + + + rdrdt=TextMobject("$rdrd\\theta$",color=BLACK).next_to(arc,IN) + self.play(ReplacementTransform(self.rect,arc)) + self.wait() + self.play(ShowCreation(r1), + ShowCreation(r2) + ) + self.play(ShowCreation(r_brace_gr), + Write(dtheta_label) + ) + self.wait() + self.play(GrowFromCenter(rdt_brace_gr)) + self.wait(.5) + self.play(GrowFromCenter(dr_brace_gr)) + self.wait(.5) + self.play(GrowFromCenter(rdrdt)) + + self.wait(2) + + + #uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/non_rect_region.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/non_rect_region.gif deleted file mode 100644 index c8e7c8c..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/non_rect_region.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/non_rect_region.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/non_rect_region.py deleted file mode 100644 index 793a000..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/non_rect_region.py +++ /dev/null @@ -1,154 +0,0 @@ -from manimlib.imports import * - -class AreaUnderCurve(GraphScene): - CONFIG = { - "x_min" : -1, - "x_max" : 8, - "y_min" : -1, - "y_max" : 5, - "y_axis_label": "$y$", - "x_tick_frequency" : 1, - "y_tick_frequency" : 1, - "x_labeled_nums": list(np.arange(-1, 9)), - "y_labeled_nums": list(np.arange(-1, 6)), - "y_axis_height":5.5, - "graph_origin": ORIGIN+4*LEFT+2.5*DOWN, - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - - sofar_text=TextMobject(r"So far we have integrated over \\ rectangular regions") - self.play(Write(sofar_text)) - self.play(sofar_text.to_edge,UP) - - self.setup_axes(animate=False) - - rect= self.get_graph( - lambda x : 3, - x_min = 0, - x_max = 5, - color = GREEN) - - rect_region = self.get_riemann_rectangles( - rect, - x_min = 0, - x_max = 5, - dx =.01, - start_color = GREEN, - end_color = GREEN, - fill_opacity = 0.75, - stroke_width = 0, - ) - - self.play(ShowCreation(rect_region)) - self.wait(.5) - - rect_int=TextMobject(r"Here the integration limits are set as").to_edge(UP) - rect_lim=TextMobject(r"$$\int_{x=0}^{5}\int_{y=0}^{3}$$").next_to(rect_int,DOWN) - const_text=TextMobject(r"$\longleftarrow $ \textsf the limits are\\ constant values").next_to(rect_lim,RIGHT) - - self.play(ReplacementTransform(sofar_text,rect_int)) - self.wait(1.5) - self.play(FadeIn(rect_lim)) - self.wait(2) - self.play(Write(const_text)) - self.wait(2) - self.play(FadeOut(rect_int), FadeOut(rect_lim),FadeOut(const_text)) - - - non_rect_text=TextMobject(r"Now we see how to integrate over \\ non-rectangular regions") - non_rect_text.to_edge(UP) - self.play(Write(non_rect_text)) - self.wait(1.5) - self.play(FadeOut(rect_region)) - - c1= self.get_graph( - lambda x : x**2/4, - x_min = 0, - x_max = 4, - color = RED) - - c1_region = self.get_riemann_rectangles( - c1, - x_min = 0, - x_max = 4, - dx =.01, - start_color = BLUE, - end_color = BLUE, - fill_opacity = 0.75, - stroke_width = 0, - ) - self.add(c1,c1_region) - # self.wait(2) - - c2= self.get_graph( - lambda x :12-2*x, - x_min = 4, - x_max = 6, - color = RED) - - c2_region = self.get_riemann_rectangles( - c2, - x_min = 4, - x_max = 6, - dx =.01, - start_color = BLUE, - end_color = BLUE, - fill_opacity = .75, - stroke_width = 0, - ) - self.add(c2_region,c2) - self.wait(1.5) - c=VGroup(*[c1,c2]) - - no_func_text=TextMobject(r"The whole region can't be expressed as\\ bounded by a single $f(x)$").next_to(c2,UP,buff=LARGE_BUFF) - - self.play(ReplacementTransform(non_rect_text,no_func_text)) - self.wait(1) - self.play(Indicate(c)) - self.wait(2) - - div_region_text=TextMobject(r"So the region is divided into two").next_to(c2,UP,buff=MED_LARGE_BUFF) - self.play(ReplacementTransform(no_func_text,div_region_text)) - - c2.set_color(YELLOW) - self.play(c2_region.set_color,YELLOW) - c1_text=TextMobject("$\dfrac{x^2}{4}$").next_to(c1,IN) - c2_text=TextMobject("$12-2x$").next_to(c2,IN+2*X) - c_text=VGroup(*[c1_text,c2_text]) - - self.play(FadeIn(c_text)) - self.wait(.4) - self.play(Indicate(c1),Indicate(c1_text)) - self.play(Indicate(c2),Indicate(c2_text)) - - easy_text=TextMobject(r"Now the limis can be set easily").next_to(c2,UP,buff=.5) - self.play(ReplacementTransform(div_region_text,easy_text)) - - c1_int=TextMobject(r"$$\int_{x=0}^{4}\int_{y=0}^{\dfrac{x^2}{4}}$$").next_to(c1,IN).shift(.5*(-X+1.3*Y)) - c2_int=TextMobject(r"$$\int_{x=4}^{6}\int_{y=0}^{12-2x}$$").next_to(c2,IN+X) - - self.play(ReplacementTransform(c1_text,c1_int),ReplacementTransform(c2_text,c2_int)) - self.wait(2) - - total_int=TextMobject(r"The total integraton= ").to_edge(UP) - plus=TextMobject("$$+$$").move_to(self.graph_origin+4*X+4.8*Y) - self.play(ReplacementTransform(easy_text,total_int)) - self.play(c2_region.set_color,BLUE) - self.play(c1_int.next_to,c1,.1*UP, c2_int.next_to,plus,RIGHT, FadeIn(plus)) - - region=VGroup(*[c1_region,c2_region]) - region.set_color(GREEN) - self.play(ShowCreation(region)) - self.wait(3) - - - -#uploaded by Somnath Pandit.FSF2020_Double_Integral - - - - - diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/surface.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/surface.gif deleted file mode 100644 index ae23a7b..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/surface.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/surface.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/surface.py deleted file mode 100644 index a794f46..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/surface.py +++ /dev/null @@ -1,236 +0,0 @@ -from manimlib.imports import * - -class SurfacesAnimation(ThreeDScene): - - CONFIG = { - "axes_config": { - "x_min": 0, - "x_max": 8, - "y_min": 0, - "y_max": 8, - "z_min": 0, - "z_max": 6, - "a":1 ,"b": 6, "c":2 , "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("$z=f(x,y)$").set_color(PINK) - self.add_fixed_in_frame_mobjects(fn_text) - fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) - - R=TextMobject("R").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=PINK, - stroke_width=0.8, - stroke_color=WHITE, - ) - - - self.begin_ambient_camera_rotation(rate=0.07) - self.play(Write(surface)) - # self.play(LaggedStart(ShowCreation(surface))) - - self.get_lines() - # self.play(FadeIn(self.axes.input_plane)) - self.wait(3) - - def get_surface(self,axes, func, **kwargs): - config = { - "u_min": axes.a, - "u_max": axes.b, - "v_min": axes.c, - "v_max": axes.d, - "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,"RED")) - - 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: 0 - ) - 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 - - - -#uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/y_limit_dependent_on_x.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/y_limit_dependent_on_x.gif deleted file mode 100644 index a2bfd9d..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/y_limit_dependent_on_x.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/y_limit_dependent_on_x.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/y_limit_dependent_on_x.py deleted file mode 100644 index 4894ebf..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/y_limit_dependent_on_x.py +++ /dev/null @@ -1,113 +0,0 @@ -from manimlib.imports import * - -class YlimitXdependent(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 1, - "y_min" : 0, - "y_max" : 2, - "x_tick_frequency" : 1, - "y_tick_frequency" : 1, - "x_labeled_nums": list(np.arange(0,2)), - "y_labeled_nums": list(np.arange(0 ,3)), - "x_axis_width": 3.5, - "y_axis_height": 6, - "graph_origin": ORIGIN+2.5*LEFT+3*DOWN, - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - - self.setup_axes(animate=False) - - line= self.get_graph( - lambda x : 2-2*x , - x_min = 0, - x_max = 1, - color = RED) - line_eqn=TextMobject("2x+y=2").move_to(self.graph_origin+.8*X+Y).rotate(np.arctan(-2)) - self.line=line - - caption=TextMobject(r"See the value of $y$ \\ is changing with $x$").move_to(self.graph_origin+1.2*X+1.8*Y) - self.play(ShowCreation(line),Write(line_eqn)) - # self.show_area() - self.show_rects() - self.play(Write(caption)) - self.show_y_values_at_different_x() - - self.wait(.5) - - ################### - def show_area(self): - area = self.get_riemann_rectangles( - self.line, - x_min = 0, - x_max = 1, - dx =.0001, - start_color = BLUE, - end_color = BLUE, - fill_opacity = 1, - stroke_width = 0, - ) - self.play(ShowCreation(area)) - # self.transform_between_riemann_rects(self.rects,area) - self.area = area - - def show_rects(self): - rects = self.get_riemann_rectangles( - self.line, - x_min = 0, - x_max = 1, - dx =.01, - start_color = BLUE, - end_color = BLUE, - fill_opacity =1, - stroke_width = 0, - ) - # self.play(ShowCreation(rects)) - # self.transform_between_riemann_rects(self.area,rects) - self.rects=rects - - def show_y_values_at_different_x(self): - rects=self.rects - rect = rects[len(rects)*1//10] - dx_brace = Brace(rect, DOWN, buff = 0) - dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) - dx_brace_group = VGroup(dx_brace,dx_label) - rp=int(len(rects)/10) - rects_subset = self.rects[3*rp:5*rp] - - last_rect = None - for rect in rects_subset: - brace = Brace(rect, LEFT, buff = 0) - y = TexMobject("y=2-2x")#.rotate(PI/2) - y.next_to(brace, LEFT, SMALL_BUFF) - anims = [ - rect.set_fill, BLUE_E, 1, - dx_brace_group.next_to, rect, DOWN, SMALL_BUFF - ] - if last_rect is not None: - anims += [ - last_rect.set_fill, None, 0, - # last_rect.set_fill, BLUE, .75, - ReplacementTransform(last_brace, brace), - ReplacementTransform(last_y, y), - ] - else: - anims += [ - GrowFromCenter(brace), - Write(y) - ] - self.play(*anims) - # self.wait(.2) - - last_rect = rect - last_brace = brace - last_y = y - - y = last_y - y_brace = last_brace - - -#uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif new file mode 100644 index 0000000..8c9fa0a Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.py new file mode 100644 index 0000000..a590a53 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.py @@ -0,0 +1,232 @@ +from manimlib.imports import * + +class SurfacesAnimation(ThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": 0, + "x_max": 4, + "y_min": 0, + "y_max": 4, + "z_min": -4, + "z_max": 4, + "a":0 ,"b": 4, "c":0 , "d":4, + "axes_shift":IN+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: 5*(x**2-y**2)/((1e-4+x**2+y**2)**2) + } + + + def construct(self): + + self.setup_axes() + self.set_camera_orientation(#distance=10, + phi=80 * DEGREES, + theta=35 * DEGREES, + ) + + fn_text=TextMobject("$z=\dfrac{x^2-y^2}{(x^2+y^2)^2}$").set_color(BLUE) + fn_text.to_corner(UR,buff=1) + self.add_fixed_in_frame_mobjects(fn_text) + + R=TextMobject("R").set_color(BLACK).scale(2).rotate(180*DEGREES , OUT) + 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.6, + fill_color=BLUE_E, + stroke_width=0.8, + stroke_color=WHITE, + ) + + + self.begin_ambient_camera_rotation(rate=0.2) + self.play(Write(surface)) + + self.get_lines() + self.wait(4) + + def get_surface(self,axes, func, **kwargs): + config = { + "u_min": axes.x_max, + "u_max": axes.x_min, + "v_min": axes.y_max, + "v_max": axes.y_min, + "resolution": (10,10), + } + + 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,"YELLOW")) + + 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, LEFT, + 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: 0 + ) + input_plane.set_style( + fill_opacity=0.3, + fill_color=PINK, + stroke_width=.2, + 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+.4), + ("b", axes.b), + ] + tex_vals_y=[ + ("c", axes.c+.4), + ("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) + label.rotate(180 * DEGREES) + 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) + 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, LEFT) + z_label.next_to(axes.z_axis.get_zenith(), LEFT) + axes.z_axis.label = z_label + for axis in axes: + axis.add(axis.label) + return axes + +#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem + + diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif new file mode 100644 index 0000000..ac13f21 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.py new file mode 100644 index 0000000..c998f3b --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.py @@ -0,0 +1,286 @@ +from manimlib.imports import * + +class SurfacesAnimation(ThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": 0, + "x_max": 4, + "y_min": 0, + "y_max": 4, + "z_min": -2, + "z_max": 4, + "a":0 ,"b": 4, "c":0 , "d":4, + "axes_shift":IN+2*LEFT+2*DOWN, + "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: x*y/4 + } + + + def construct(self): + + self.setup_axes() + self.set_camera_orientation( + distance=30, + phi=75 * DEGREES, + theta=20 * DEGREES, + ) + + fn_text=TextMobject("$z=xy$").set_color(BLUE).scale(1.5) + fn_text.to_corner(UR,buff=2) + self.add_fixed_in_frame_mobjects(fn_text) + + + #get the surface + surface= self.get_surface( + self.axes, lambda x , y: + self.Func(x,y) + ) + surface.set_style( + fill_opacity=.5, + fill_color=BLUE_E, + stroke_width=0.2, + stroke_color=WHITE, + ) + #get boundary curves + c1=self.get_curve( + self.axes, lambda x: x**2/4 + ) + c1_label=TextMobject("$y=x^2$").next_to(c1,IN+OUT).shift(DOWN+RIGHT) + c1_label.rotate(PI) + c1_group=VGroup(c1,c1_label).set_color(ORANGE) + + c2=self.get_curve( + self.axes, lambda x: x + ).set_color(PINK) + c2_label=TextMobject("$y=x$").next_to(c2,IN+OUT) + c2_label.rotate(PI/2,about_point=(c2_label.get_corner(UL))) + c2_group=VGroup(c2,c2_label).set_color(YELLOW_E) + + + + self.add(c1,c2,c1_label,c2_label) + + self.begin_ambient_camera_rotation(rate=0.4) + self.get_region(self.axes,c1,c2) + self.play(Write(surface)) + self.get_lines() + self.wait(1) + self.stop_ambient_camera_rotation() + self.move_camera( + distance=20, + phi=10 * DEGREES, + theta=80 * DEGREES, + run_time=2.5 + ) + self.wait(2) + + + + def get_curve(self,axes, func, **kwargs): + config = { + "t_min": axes.x_min, + "t_max": axes.x_max, + } + config.update(kwargs) + return ParametricFunction( + lambda x : axes.c2p( + x, func(x),0 + ), + **config + ) + + def get_region(self,axes,curve1,curve2,**kwargs): + x_vals=np.arange(axes.x_min,axes.x_max,.1) + c1_points=[curve1.get_point_from_function(x) for x in x_vals] + c2_points=[curve2.get_point_from_function(x) for x in x_vals] + c2_points.reverse() + points=c1_points+c2_points + region=Polygon(*points, + stroke_width=0, + fill_color=PINK, + fill_opacity=.5 + ) + R=TextMobject("R").set_color(PINK).scale(2).rotate(180*DEGREES , OUT) + R.move_to(region,IN+RIGHT) + + self.play(Write(region)) + self.add(R) + + def get_surface(self,axes, func, **kwargs): + config = { + "u_min": axes.x_max, + "u_max": axes.x_min, + "v_min": axes.y_max, + "v_max": axes.y_min, + "resolution": (10,10), + } + + 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,"YELLOW")) + + 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 + + #customize 3D axes + 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, LEFT, + 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: 0 + ) + input_plane.set_style( + fill_opacity=0.3, + fill_color=PINK, + stroke_width=.2, + 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 = [ + ("1", axes.b), + ] + tex_vals_y=[ + ("1", 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) + label.rotate(180 * DEGREES) + 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) + 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, LEFT) + z_label.next_to(axes.z_axis.get_zenith(), LEFT) + axes.z_axis.label = z_label + for axis in axes: + axis.add(axis.label) + return axes + + #uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem + + diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface1.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface1.gif deleted file mode 100644 index 8c9fa0a..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface1.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface1.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface1.py deleted file mode 100644 index a590a53..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface1.py +++ /dev/null @@ -1,232 +0,0 @@ -from manimlib.imports import * - -class SurfacesAnimation(ThreeDScene): - - CONFIG = { - "axes_config": { - "x_min": 0, - "x_max": 4, - "y_min": 0, - "y_max": 4, - "z_min": -4, - "z_max": 4, - "a":0 ,"b": 4, "c":0 , "d":4, - "axes_shift":IN+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: 5*(x**2-y**2)/((1e-4+x**2+y**2)**2) - } - - - def construct(self): - - self.setup_axes() - self.set_camera_orientation(#distance=10, - phi=80 * DEGREES, - theta=35 * DEGREES, - ) - - fn_text=TextMobject("$z=\dfrac{x^2-y^2}{(x^2+y^2)^2}$").set_color(BLUE) - fn_text.to_corner(UR,buff=1) - self.add_fixed_in_frame_mobjects(fn_text) - - R=TextMobject("R").set_color(BLACK).scale(2).rotate(180*DEGREES , OUT) - 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.6, - fill_color=BLUE_E, - stroke_width=0.8, - stroke_color=WHITE, - ) - - - self.begin_ambient_camera_rotation(rate=0.2) - self.play(Write(surface)) - - self.get_lines() - self.wait(4) - - def get_surface(self,axes, func, **kwargs): - config = { - "u_min": axes.x_max, - "u_max": axes.x_min, - "v_min": axes.y_max, - "v_max": axes.y_min, - "resolution": (10,10), - } - - 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,"YELLOW")) - - 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, LEFT, - 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: 0 - ) - input_plane.set_style( - fill_opacity=0.3, - fill_color=PINK, - stroke_width=.2, - 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+.4), - ("b", axes.b), - ] - tex_vals_y=[ - ("c", axes.c+.4), - ("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) - label.rotate(180 * DEGREES) - 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) - 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, LEFT) - z_label.next_to(axes.z_axis.get_zenith(), LEFT) - axes.z_axis.label = z_label - for axis in axes: - axis.add(axis.label) - return axes - -#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem - - diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface2.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface2.gif deleted file mode 100644 index ac13f21..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface2.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface2.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface2.py deleted file mode 100644 index c998f3b..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's_theorem/surface2.py +++ /dev/null @@ -1,286 +0,0 @@ -from manimlib.imports import * - -class SurfacesAnimation(ThreeDScene): - - CONFIG = { - "axes_config": { - "x_min": 0, - "x_max": 4, - "y_min": 0, - "y_max": 4, - "z_min": -2, - "z_max": 4, - "a":0 ,"b": 4, "c":0 , "d":4, - "axes_shift":IN+2*LEFT+2*DOWN, - "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: x*y/4 - } - - - def construct(self): - - self.setup_axes() - self.set_camera_orientation( - distance=30, - phi=75 * DEGREES, - theta=20 * DEGREES, - ) - - fn_text=TextMobject("$z=xy$").set_color(BLUE).scale(1.5) - fn_text.to_corner(UR,buff=2) - self.add_fixed_in_frame_mobjects(fn_text) - - - #get the surface - surface= self.get_surface( - self.axes, lambda x , y: - self.Func(x,y) - ) - surface.set_style( - fill_opacity=.5, - fill_color=BLUE_E, - stroke_width=0.2, - stroke_color=WHITE, - ) - #get boundary curves - c1=self.get_curve( - self.axes, lambda x: x**2/4 - ) - c1_label=TextMobject("$y=x^2$").next_to(c1,IN+OUT).shift(DOWN+RIGHT) - c1_label.rotate(PI) - c1_group=VGroup(c1,c1_label).set_color(ORANGE) - - c2=self.get_curve( - self.axes, lambda x: x - ).set_color(PINK) - c2_label=TextMobject("$y=x$").next_to(c2,IN+OUT) - c2_label.rotate(PI/2,about_point=(c2_label.get_corner(UL))) - c2_group=VGroup(c2,c2_label).set_color(YELLOW_E) - - - - self.add(c1,c2,c1_label,c2_label) - - self.begin_ambient_camera_rotation(rate=0.4) - self.get_region(self.axes,c1,c2) - self.play(Write(surface)) - self.get_lines() - self.wait(1) - self.stop_ambient_camera_rotation() - self.move_camera( - distance=20, - phi=10 * DEGREES, - theta=80 * DEGREES, - run_time=2.5 - ) - self.wait(2) - - - - def get_curve(self,axes, func, **kwargs): - config = { - "t_min": axes.x_min, - "t_max": axes.x_max, - } - config.update(kwargs) - return ParametricFunction( - lambda x : axes.c2p( - x, func(x),0 - ), - **config - ) - - def get_region(self,axes,curve1,curve2,**kwargs): - x_vals=np.arange(axes.x_min,axes.x_max,.1) - c1_points=[curve1.get_point_from_function(x) for x in x_vals] - c2_points=[curve2.get_point_from_function(x) for x in x_vals] - c2_points.reverse() - points=c1_points+c2_points - region=Polygon(*points, - stroke_width=0, - fill_color=PINK, - fill_opacity=.5 - ) - R=TextMobject("R").set_color(PINK).scale(2).rotate(180*DEGREES , OUT) - R.move_to(region,IN+RIGHT) - - self.play(Write(region)) - self.add(R) - - def get_surface(self,axes, func, **kwargs): - config = { - "u_min": axes.x_max, - "u_max": axes.x_min, - "v_min": axes.y_max, - "v_max": axes.y_min, - "resolution": (10,10), - } - - 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,"YELLOW")) - - 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 - - #customize 3D axes - 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, LEFT, - 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: 0 - ) - input_plane.set_style( - fill_opacity=0.3, - fill_color=PINK, - stroke_width=.2, - 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 = [ - ("1", axes.b), - ] - tex_vals_y=[ - ("1", 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) - label.rotate(180 * DEGREES) - 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) - 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, LEFT) - z_label.next_to(axes.z_axis.get_zenith(), LEFT) - axes.z_axis.label = z_label - for axis in axes: - axis.add(axis.label) - return axes - - #uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem - - -- cgit From 58a5802578af41558b26ac1c09b2983552698b58 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Wed, 27 May 2020 03:20:12 +0530 Subject: new animation --- .../fubini's-theorem/file3_iteration_methods.gif | Bin 0 -> 1762897 bytes .../fubini's-theorem/file3_iteration_methods.py | 428 +++++++++++++++++++++ .../fubini's-theorem/iteration_methods_check.py | 226 +++++++++++ 3 files changed, 654 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif new file mode 100644 index 0000000..e73dd8e Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py new file mode 100644 index 0000000..662242a --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py @@ -0,0 +1,428 @@ +from manimlib.imports import * + +class IterationMethods(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 1, + "y_min" : 0, + "y_max" : 1, + "x_tick_frequency" : 1, + "y_tick_frequency" : 1, + "x_labeled_nums": list(np.arange(0,2)), + "y_labeled_nums": list(np.arange(0 ,2)), + "x_axis_width": 6, + "y_axis_height": 6, + "graph_origin": ORIGIN+4.5*LEFT+3*DOWN, + "area_color": PINK , + "area_opacity": .6, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + self.intro_scene() + self.setup_axes(animate=True) + + + curve1= self.get_graph( + lambda x : x**2 , + x_min = 0, + x_max = 1, + color = ORANGE) + c1_eqn=self.get_graph_label( + curve1, + label="y=x^2", + x_val=.5, + direction=RIGHT, + buff=MED_LARGE_BUFF, + color=ORANGE, + ) + + curve2= self.get_graph( + lambda x : x , + x_min = 0, + x_max = 1, + color = YELLOW) + c2_eqn=self.get_graph_label( + curve2, + label="y=x", + x_val=.7, + direction=LEFT, + buff=MED_LARGE_BUFF, + color=YELLOW, + ) + self.curve1=curve1 + self.curve2=curve2 + + caption_limit=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) + int_lim=TextMobject( + "$$\\int_0^1$$" + ).next_to( + caption_limit,DOWN,buff=.5 + ).align_to( + caption_limit,LEFT + ) + + self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) + + self.play(Write(caption_limit)) + self.get_rects() + self.show_integral_values_at_different_x() + self.wait(1) + self.add(int_lim) + + self.integral_setup(int_lim,first_y=True) + + + self.another_method_scene() + self.remove(self.area) + self.wait() + + c1_eqn_y=self.get_graph_label( + curve1, + label="x=\sqrt y", + x_val=.6, + direction=RIGHT, + buff=MED_LARGE_BUFF, + color=ORANGE, + ) + c2_eqn_y=self.get_graph_label( + curve2, + label="x=y", + x_val=.7, + direction=LEFT, + buff=MED_LARGE_BUFF, + color=YELLOW, + ) + self.play( + ReplacementTransform(c1_eqn,c1_eqn_y), + ReplacementTransform(c2_eqn,c2_eqn_y) + ) + self.get_rects(base_y=True) + self.show_integral_values_at_different_y() + self.wait(1) + + int_lim_y=int_lim.copy() + int_lim_y.next_to(int_lim,DOWN) + equal=TextMobject("$$=$$").next_to(int_lim_y,LEFT) + self.add(equal,int_lim_y) + + self.integral_setup(int_lim_y,first_y=False) + + self.wait(2) + + ################### + def intro_scene(self): + text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) + self.play(Write(text),run_time=4) + self.wait(2) + self.play(FadeOut(text)) + + def another_method_scene(self): + text=TextMobject(r"The other method\\ of iteration") + text.next_to(self.curve1,UP,buff=-1) + self.play(GrowFromCenter(text)) + self.wait(2) + self.play(LaggedStart(FadeOut(text),lag_ratio=2)) + + def integral_setup(self,ref_object,first_y=True): + if first_y: + area=self.get_area() + self.area=area + self.play(FadeOut(self.brace_group)) + self.play(ApplyMethod( + self.y_int.next_to, + ref_object,RIGHT,buff=0) + ) + + self.play(ApplyMethod( + self.dx_label.next_to, + self.y_int,RIGHT), + ShowCreation(area),run_time=4 + ) + else: + area=self.get_area(base_y=True) + self.area=area + self.play( + FadeOut(self.y_brace_group), + Rotate(self.x_int,PI/2) + ) + self.play(ApplyMethod( + self.x_int.next_to, + ref_object,RIGHT,buff=0) + ) + self.play(ApplyMethod( + self.dy_label.next_to, + self.x_int,RIGHT), + ShowCreation(area),run_time=4 + ) + + def get_area(self,base_y=False): + if base_y: + area = self.bounded_riemann_rectangles_y( + lambda x: x, + lambda x: np.sqrt(x), + y_min = 0, + y_max = 1, + dy =.001, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.y_area = area + else: + area = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.001, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.area = area + + # self.transform_between_riemann_rects(self.rects,area) + return area + + def get_rects(self,base_y=False): + if base_y: + rects = self.bounded_riemann_rectangles_y( + lambda x: x, + lambda x: np.sqrt(x), + y_min = 0, + y_max = 1, + dy =.01, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.y_rects=rects + else: + rects = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.01, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.rects=rects + # self.transform_between_riemann_rects(self.area,rects) + + return rects + + def show_integral_values_at_different_x(self): + rects=self.rects + rect = rects[len(rects)*1//10] + dx_brace = Brace(rect, DOWN, buff = 0) + dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) + dx_brace_group = VGroup(dx_brace,dx_label) + rp=int(len(rects)/20) + rects_subset = rects[6*rp:7*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, LEFT, buff =.1) + y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) + y_int.next_to(brace, LEFT, MED_SMALL_BUFF) + anims = [ + rect.set_fill, self.area_color, 1, + dx_brace_group.next_to, rect, DOWN, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, self.area_color, self.area_opacity, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_y_int, y_int), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(y_int) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_y_int = y_int + + y_int = last_y_int + y_brace = last_brace + self.brace_group=VGroup(y_brace,dx_brace,rect) + self.y_int=y_int + self.dx_label=dx_label + + def show_integral_values_at_different_y(self): + rects=self.y_rects + rect = rects[len(rects)*1//10] + dy_brace = Brace(rect, LEFT, buff = 0) + dy_label = dy_brace.get_text("$dy$", buff = SMALL_BUFF) + dy_brace_group = VGroup(dy_brace,dy_label) + rp=int(len(rects)/20) + rects_subset = rects[5*rp:6*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, DOWN, buff =.1) + x_int = TexMobject("\\int_{y}^{\sqrt y}dx").rotate(-PI/2) + x_int.next_to(brace, DOWN, SMALL_BUFF) + anims = [ + rect.set_fill, self.area_color, 1, + dy_brace_group.next_to, rect, LEFT, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, self.area_color, self.area_opacity, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_x_int, x_int), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(x_int) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_x_int = x_int + + x_int = last_x_int + y_brace = last_brace + self.y_brace_group=VGroup(y_brace,dy_brace,rect) + self.x_int=x_int + self.dy_label=dy_label + + + def bounded_riemann_rectangles( + self, + graph1, + graph2, + x_min=None, + x_max=None, + dx=0.01, + input_sample_type="center", + stroke_width=1, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + show_signed_area=True, + width_scale_factor=1.001 + ): + x_min = x_min if x_min is not None else self.x_min + x_max = x_max if x_max is not None else self.x_max + if start_color is None: + start_color = self.default_riemann_start_color + if end_color is None: + end_color = self.default_riemann_end_color + rectangles = VGroup() + x_range = np.arange(x_min, x_max, dx) + colors = color_gradient([start_color, end_color], len(x_range)) + for x, color in zip(x_range, colors): + if input_sample_type == "left": + sample_input = x + elif input_sample_type == "right": + sample_input = x + dx + elif input_sample_type == "center": + sample_input = x + 0.5 * dx + else: + raise Exception("Invalid input sample type") + graph1_point = self.input_to_graph_point(sample_input, graph1) + graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) + graph2_point = self.input_to_graph_point(sample_input, graph2) + + points = VGroup(*list(map(VectorizedPoint, [ + graph1_point, + graph1_point_dx, + graph2_point + ]))) + + rect = Rectangle() + rect.replace(points, stretch=True) + if graph1_point[1] < self.graph_origin[1] and show_signed_area: + fill_color = invert_color(color) + else: + fill_color = color + rect.set_fill(fill_color, opacity=fill_opacity) + rect.set_stroke(stroke_color, width=stroke_width) + rectangles.add(rect) + return rectangles + + def bounded_riemann_rectangles_y( + self, + graph1, + graph2, + y_min=None, + y_max=None, + dy=0.01, + input_sample_type="center", + stroke_width=1, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + show_signed_area=True, + width_scale_factor=1.001 + ): + y_min = y_min if y_min is not None else self.y_min + y_max = y_max if y_max is not None else self.y_max + if start_color is None: + start_color = self.default_riemann_start_color + if end_color is None: + end_color = self.default_riemann_end_color + rectangles = VGroup() + y_range = np.arange(y_min, y_max, dy) + colors = color_gradient([start_color, end_color], len(y_range)) + for y, color in zip(y_range, colors): + if input_sample_type == "left": + sample_input = y + elif input_sample_type == "right": + sample_input = y + dy + elif input_sample_type == "center": + sample_input = y + 0.5 * dy + else: + raise Exception("Invalid input sample type") + graph1_point = self.coords_to_point( + graph1(sample_input),sample_input + ) + dy_input=sample_input + width_scale_factor * dy + graph1_point_dy= self.coords_to_point( + graph1(dy_input),dy_input + ) + graph2_point = self.coords_to_point( + graph2(sample_input),sample_input + ) + + points = VGroup(*list(map(VectorizedPoint, [ + graph1_point, + graph1_point_dy, + graph2_point + ]))) + + rect = Rectangle() + rect.replace(points, stretch=True) + if graph1_point[1] < self.graph_origin[1] and show_signed_area: + fill_color = invert_color(color) + else: + fill_color = color + rect.set_fill(fill_color, opacity=fill_opacity) + rect.set_stroke(stroke_color, width=stroke_width) + rectangles.add(rect) + return rectangles + + +#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.py new file mode 100644 index 0000000..55f91d3 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.py @@ -0,0 +1,226 @@ +from manimlib.imports import * + +class IterationMethods(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 1, + "y_min" : 0, + "y_max" : 1, + "x_tick_frequency" : 1, + "y_tick_frequency" : 1, + "x_labeled_nums": list(np.arange(0,2)), + "y_labeled_nums": list(np.arange(0 ,2)), + "x_axis_width": 6, + "y_axis_height": 6, + "graph_origin": ORIGIN+4*LEFT+3*DOWN, + "area_color": PINK , + "area_opacity": .6, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + # self.intro_scene() + self.setup_axes(animate=True) + + + curve1= self.get_graph( + lambda x : x**2 , + x_min = 0, + x_max = 1, + color = ORANGE) + c1_eqn=self.get_graph_label( + curve1, + label="y=x^2", + x_val=.5, + direction=RIGHT, + buff=MED_LARGE_BUFF, + color=ORANGE, + ) + + curve2= self.get_graph( + lambda x : x , + x_min = 0, + x_max = 1, + color = YELLOW) + c2_eqn=self.get_graph_label( + curve2, + label="y=x", + x_val=.5, + direction=LEFT, + buff=MED_LARGE_BUFF, + color=YELLOW, + ) + self.curve1=curve1 + self.curve2=curve2 + + caption_y_int=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) + int_lim=TextMobject( + "$$\\int_0^1$$" + ).next_to( + caption_y_int,DOWN,buff=.5 + ).align_to( + caption_y_int,LEFT + ) + + self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) + rects=self.get_rects() + + self.play(Write(caption_y_int)) + self.show_integral_values_at_different_x() + self.wait(1) + self.add(int_lim) + self.play(FadeOut(self.brace_group)) + self.play(ApplyMethod( + self.y_int.next_to, + int_lim,RIGHT,buff=0)) + + self.play(ApplyMethod( + self.dx_label.next_to, + self.y_int,RIGHT)) + + self.show_area() + + self.wait(2) + + ################### + def intro_scene(self): + text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) + self.play(Write(text),run_time=4) + self.wait(2) + self.play(FadeOut(text)) + + + def show_area(self): + area = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.001, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity = 1, + stroke_width = 0, + ) + self.play(ShowCreation(area)) + # self.transform_between_riemann_rects(self.rects,area) + self.area = area + + def get_rects(self): + rects = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.01, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + # self.transform_between_riemann_rects(self.area,rects) + self.rects=rects + return rects + + def show_integral_values_at_different_x(self): + rects=self.rects + rect = rects[len(rects)*1//10] + dx_brace = Brace(rect, DOWN, buff = 0) + dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) + dx_brace_group = VGroup(dx_brace,dx_label) + rp=int(len(rects)/10) + rects_subset = self.rects[4*rp:5*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, LEFT, buff =.1) + y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) + y_int.next_to(brace, LEFT, MED_SMALL_BUFF) + anims = [ + rect.set_fill, self.area_color, 1, + dx_brace_group.next_to, rect, DOWN, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, self.area_color, self.area_opacity, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_y_int, y_int), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(y_int) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_y_int = y_int + + y_int = last_y_int + y_brace = last_brace + self.brace_group=VGroup(y_brace,dx_brace,rect) + self.y_int=y_int + self.dx_label=dx_label + + + def bounded_riemann_rectangles( + self, + graph1, + graph2, + x_min=None, + x_max=None, + dx=0.01, + input_sample_type="center", + stroke_width=1, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + show_signed_area=True, + width_scale_factor=1.001 + ): + x_min = x_min if x_min is not None else self.x_min + x_max = x_max if x_max is not None else self.x_max + if start_color is None: + start_color = self.default_riemann_start_color + if end_color is None: + end_color = self.default_riemann_end_color + rectangles = VGroup() + x_range = np.arange(x_min, x_max, dx) + colors = color_gradient([start_color, end_color], len(x_range)) + for x, color in zip(x_range, colors): + if input_sample_type == "left": + sample_input = x + elif input_sample_type == "right": + sample_input = x + dx + elif input_sample_type == "center": + sample_input = x + 0.5 * dx + else: + raise Exception("Invalid input sample type") + graph1_point = self.input_to_graph_point(sample_input, graph1) + graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) + graph2_point = self.input_to_graph_point(sample_input, graph2) + + points = VGroup(*list(map(VectorizedPoint, [ + graph1_point, + graph1_point_dx, + graph2_point + ]))) + + rect = Rectangle() + rect.replace(points, stretch=True) + if graph1_point[1] < self.graph_origin[1] and show_signed_area: + fill_color = invert_color(color) + else: + fill_color = color + rect.set_fill(fill_color, opacity=fill_opacity) + rect.set_stroke(stroke_color, width=stroke_width) + rectangles.add(rect) + return rectangles + +#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem -- cgit From 8d57d47df8325601b70fa6611a68d8ed7dd56dc4 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Wed, 27 May 2020 03:26:24 +0530 Subject: checkpoint of file3 add --- .../fubini's-theorem/iteration_methods_check.gif | Bin 0 -> 465521 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.gif new file mode 100644 index 0000000..2e507f9 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.gif differ -- cgit From 6d2ae3ea9e4925cab7482cf56b7ed6da1d7314fb Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Wed, 27 May 2020 10:22:17 +0530 Subject: update file names --- .../fubini's-theorem/file3_iteration_methods.gif | Bin 1762897 -> 0 bytes .../fubini's-theorem/file3_iteration_methods.py | 428 --------------------- .../file3_iteration_methods_checkpoint.gif | Bin 0 -> 465521 bytes .../file3_iteration_methods_checkpoint.py | 226 +++++++++++ .../fubini's-theorem/file4_iteration_methods.gif | Bin 0 -> 1762897 bytes .../fubini's-theorem/file4_iteration_methods.py | 428 +++++++++++++++++++++ .../fubini's-theorem/iteration_methods_check.gif | Bin 465521 -> 0 bytes .../fubini's-theorem/iteration_methods_check.py | 226 ----------- 8 files changed, 654 insertions(+), 654 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif deleted file mode 100644 index e73dd8e..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py deleted file mode 100644 index 662242a..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py +++ /dev/null @@ -1,428 +0,0 @@ -from manimlib.imports import * - -class IterationMethods(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 1, - "y_min" : 0, - "y_max" : 1, - "x_tick_frequency" : 1, - "y_tick_frequency" : 1, - "x_labeled_nums": list(np.arange(0,2)), - "y_labeled_nums": list(np.arange(0 ,2)), - "x_axis_width": 6, - "y_axis_height": 6, - "graph_origin": ORIGIN+4.5*LEFT+3*DOWN, - "area_color": PINK , - "area_opacity": .6, - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - - self.intro_scene() - self.setup_axes(animate=True) - - - curve1= self.get_graph( - lambda x : x**2 , - x_min = 0, - x_max = 1, - color = ORANGE) - c1_eqn=self.get_graph_label( - curve1, - label="y=x^2", - x_val=.5, - direction=RIGHT, - buff=MED_LARGE_BUFF, - color=ORANGE, - ) - - curve2= self.get_graph( - lambda x : x , - x_min = 0, - x_max = 1, - color = YELLOW) - c2_eqn=self.get_graph_label( - curve2, - label="y=x", - x_val=.7, - direction=LEFT, - buff=MED_LARGE_BUFF, - color=YELLOW, - ) - self.curve1=curve1 - self.curve2=curve2 - - caption_limit=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) - int_lim=TextMobject( - "$$\\int_0^1$$" - ).next_to( - caption_limit,DOWN,buff=.5 - ).align_to( - caption_limit,LEFT - ) - - self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) - - self.play(Write(caption_limit)) - self.get_rects() - self.show_integral_values_at_different_x() - self.wait(1) - self.add(int_lim) - - self.integral_setup(int_lim,first_y=True) - - - self.another_method_scene() - self.remove(self.area) - self.wait() - - c1_eqn_y=self.get_graph_label( - curve1, - label="x=\sqrt y", - x_val=.6, - direction=RIGHT, - buff=MED_LARGE_BUFF, - color=ORANGE, - ) - c2_eqn_y=self.get_graph_label( - curve2, - label="x=y", - x_val=.7, - direction=LEFT, - buff=MED_LARGE_BUFF, - color=YELLOW, - ) - self.play( - ReplacementTransform(c1_eqn,c1_eqn_y), - ReplacementTransform(c2_eqn,c2_eqn_y) - ) - self.get_rects(base_y=True) - self.show_integral_values_at_different_y() - self.wait(1) - - int_lim_y=int_lim.copy() - int_lim_y.next_to(int_lim,DOWN) - equal=TextMobject("$$=$$").next_to(int_lim_y,LEFT) - self.add(equal,int_lim_y) - - self.integral_setup(int_lim_y,first_y=False) - - self.wait(2) - - ################### - def intro_scene(self): - text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) - self.play(Write(text),run_time=4) - self.wait(2) - self.play(FadeOut(text)) - - def another_method_scene(self): - text=TextMobject(r"The other method\\ of iteration") - text.next_to(self.curve1,UP,buff=-1) - self.play(GrowFromCenter(text)) - self.wait(2) - self.play(LaggedStart(FadeOut(text),lag_ratio=2)) - - def integral_setup(self,ref_object,first_y=True): - if first_y: - area=self.get_area() - self.area=area - self.play(FadeOut(self.brace_group)) - self.play(ApplyMethod( - self.y_int.next_to, - ref_object,RIGHT,buff=0) - ) - - self.play(ApplyMethod( - self.dx_label.next_to, - self.y_int,RIGHT), - ShowCreation(area),run_time=4 - ) - else: - area=self.get_area(base_y=True) - self.area=area - self.play( - FadeOut(self.y_brace_group), - Rotate(self.x_int,PI/2) - ) - self.play(ApplyMethod( - self.x_int.next_to, - ref_object,RIGHT,buff=0) - ) - self.play(ApplyMethod( - self.dy_label.next_to, - self.x_int,RIGHT), - ShowCreation(area),run_time=4 - ) - - def get_area(self,base_y=False): - if base_y: - area = self.bounded_riemann_rectangles_y( - lambda x: x, - lambda x: np.sqrt(x), - y_min = 0, - y_max = 1, - dy =.001, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - self.y_area = area - else: - area = self.bounded_riemann_rectangles( - self.curve1, - self.curve2, - x_min = 0, - x_max = 1, - dx =.001, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - self.area = area - - # self.transform_between_riemann_rects(self.rects,area) - return area - - def get_rects(self,base_y=False): - if base_y: - rects = self.bounded_riemann_rectangles_y( - lambda x: x, - lambda x: np.sqrt(x), - y_min = 0, - y_max = 1, - dy =.01, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - self.y_rects=rects - else: - rects = self.bounded_riemann_rectangles( - self.curve1, - self.curve2, - x_min = 0, - x_max = 1, - dx =.01, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - self.rects=rects - # self.transform_between_riemann_rects(self.area,rects) - - return rects - - def show_integral_values_at_different_x(self): - rects=self.rects - rect = rects[len(rects)*1//10] - dx_brace = Brace(rect, DOWN, buff = 0) - dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) - dx_brace_group = VGroup(dx_brace,dx_label) - rp=int(len(rects)/20) - rects_subset = rects[6*rp:7*rp] - - last_rect = None - for rect in rects_subset: - brace = Brace(rect, LEFT, buff =.1) - y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) - y_int.next_to(brace, LEFT, MED_SMALL_BUFF) - anims = [ - rect.set_fill, self.area_color, 1, - dx_brace_group.next_to, rect, DOWN, SMALL_BUFF - ] - if last_rect is not None: - anims += [ - last_rect.set_fill, None, 0, - # last_rect.set_fill, self.area_color, self.area_opacity, - ReplacementTransform(last_brace, brace), - ReplacementTransform(last_y_int, y_int), - ] - else: - anims += [ - GrowFromCenter(brace), - Write(y_int) - ] - self.play(*anims) - # self.wait(.2) - - last_rect = rect - last_brace = brace - last_y_int = y_int - - y_int = last_y_int - y_brace = last_brace - self.brace_group=VGroup(y_brace,dx_brace,rect) - self.y_int=y_int - self.dx_label=dx_label - - def show_integral_values_at_different_y(self): - rects=self.y_rects - rect = rects[len(rects)*1//10] - dy_brace = Brace(rect, LEFT, buff = 0) - dy_label = dy_brace.get_text("$dy$", buff = SMALL_BUFF) - dy_brace_group = VGroup(dy_brace,dy_label) - rp=int(len(rects)/20) - rects_subset = rects[5*rp:6*rp] - - last_rect = None - for rect in rects_subset: - brace = Brace(rect, DOWN, buff =.1) - x_int = TexMobject("\\int_{y}^{\sqrt y}dx").rotate(-PI/2) - x_int.next_to(brace, DOWN, SMALL_BUFF) - anims = [ - rect.set_fill, self.area_color, 1, - dy_brace_group.next_to, rect, LEFT, SMALL_BUFF - ] - if last_rect is not None: - anims += [ - last_rect.set_fill, None, 0, - # last_rect.set_fill, self.area_color, self.area_opacity, - ReplacementTransform(last_brace, brace), - ReplacementTransform(last_x_int, x_int), - ] - else: - anims += [ - GrowFromCenter(brace), - Write(x_int) - ] - self.play(*anims) - # self.wait(.2) - - last_rect = rect - last_brace = brace - last_x_int = x_int - - x_int = last_x_int - y_brace = last_brace - self.y_brace_group=VGroup(y_brace,dy_brace,rect) - self.x_int=x_int - self.dy_label=dy_label - - - def bounded_riemann_rectangles( - self, - graph1, - graph2, - x_min=None, - x_max=None, - dx=0.01, - input_sample_type="center", - stroke_width=1, - stroke_color=BLACK, - fill_opacity=1, - start_color=None, - end_color=None, - show_signed_area=True, - width_scale_factor=1.001 - ): - x_min = x_min if x_min is not None else self.x_min - x_max = x_max if x_max is not None else self.x_max - if start_color is None: - start_color = self.default_riemann_start_color - if end_color is None: - end_color = self.default_riemann_end_color - rectangles = VGroup() - x_range = np.arange(x_min, x_max, dx) - colors = color_gradient([start_color, end_color], len(x_range)) - for x, color in zip(x_range, colors): - if input_sample_type == "left": - sample_input = x - elif input_sample_type == "right": - sample_input = x + dx - elif input_sample_type == "center": - sample_input = x + 0.5 * dx - else: - raise Exception("Invalid input sample type") - graph1_point = self.input_to_graph_point(sample_input, graph1) - graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) - graph2_point = self.input_to_graph_point(sample_input, graph2) - - points = VGroup(*list(map(VectorizedPoint, [ - graph1_point, - graph1_point_dx, - graph2_point - ]))) - - rect = Rectangle() - rect.replace(points, stretch=True) - if graph1_point[1] < self.graph_origin[1] and show_signed_area: - fill_color = invert_color(color) - else: - fill_color = color - rect.set_fill(fill_color, opacity=fill_opacity) - rect.set_stroke(stroke_color, width=stroke_width) - rectangles.add(rect) - return rectangles - - def bounded_riemann_rectangles_y( - self, - graph1, - graph2, - y_min=None, - y_max=None, - dy=0.01, - input_sample_type="center", - stroke_width=1, - stroke_color=BLACK, - fill_opacity=1, - start_color=None, - end_color=None, - show_signed_area=True, - width_scale_factor=1.001 - ): - y_min = y_min if y_min is not None else self.y_min - y_max = y_max if y_max is not None else self.y_max - if start_color is None: - start_color = self.default_riemann_start_color - if end_color is None: - end_color = self.default_riemann_end_color - rectangles = VGroup() - y_range = np.arange(y_min, y_max, dy) - colors = color_gradient([start_color, end_color], len(y_range)) - for y, color in zip(y_range, colors): - if input_sample_type == "left": - sample_input = y - elif input_sample_type == "right": - sample_input = y + dy - elif input_sample_type == "center": - sample_input = y + 0.5 * dy - else: - raise Exception("Invalid input sample type") - graph1_point = self.coords_to_point( - graph1(sample_input),sample_input - ) - dy_input=sample_input + width_scale_factor * dy - graph1_point_dy= self.coords_to_point( - graph1(dy_input),dy_input - ) - graph2_point = self.coords_to_point( - graph2(sample_input),sample_input - ) - - points = VGroup(*list(map(VectorizedPoint, [ - graph1_point, - graph1_point_dy, - graph2_point - ]))) - - rect = Rectangle() - rect.replace(points, stretch=True) - if graph1_point[1] < self.graph_origin[1] and show_signed_area: - fill_color = invert_color(color) - else: - fill_color = color - rect.set_fill(fill_color, opacity=fill_opacity) - rect.set_stroke(stroke_color, width=stroke_width) - rectangles.add(rect) - return rectangles - - -#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.gif new file mode 100644 index 0000000..2e507f9 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.py new file mode 100644 index 0000000..55f91d3 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.py @@ -0,0 +1,226 @@ +from manimlib.imports import * + +class IterationMethods(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 1, + "y_min" : 0, + "y_max" : 1, + "x_tick_frequency" : 1, + "y_tick_frequency" : 1, + "x_labeled_nums": list(np.arange(0,2)), + "y_labeled_nums": list(np.arange(0 ,2)), + "x_axis_width": 6, + "y_axis_height": 6, + "graph_origin": ORIGIN+4*LEFT+3*DOWN, + "area_color": PINK , + "area_opacity": .6, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + # self.intro_scene() + self.setup_axes(animate=True) + + + curve1= self.get_graph( + lambda x : x**2 , + x_min = 0, + x_max = 1, + color = ORANGE) + c1_eqn=self.get_graph_label( + curve1, + label="y=x^2", + x_val=.5, + direction=RIGHT, + buff=MED_LARGE_BUFF, + color=ORANGE, + ) + + curve2= self.get_graph( + lambda x : x , + x_min = 0, + x_max = 1, + color = YELLOW) + c2_eqn=self.get_graph_label( + curve2, + label="y=x", + x_val=.5, + direction=LEFT, + buff=MED_LARGE_BUFF, + color=YELLOW, + ) + self.curve1=curve1 + self.curve2=curve2 + + caption_y_int=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) + int_lim=TextMobject( + "$$\\int_0^1$$" + ).next_to( + caption_y_int,DOWN,buff=.5 + ).align_to( + caption_y_int,LEFT + ) + + self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) + rects=self.get_rects() + + self.play(Write(caption_y_int)) + self.show_integral_values_at_different_x() + self.wait(1) + self.add(int_lim) + self.play(FadeOut(self.brace_group)) + self.play(ApplyMethod( + self.y_int.next_to, + int_lim,RIGHT,buff=0)) + + self.play(ApplyMethod( + self.dx_label.next_to, + self.y_int,RIGHT)) + + self.show_area() + + self.wait(2) + + ################### + def intro_scene(self): + text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) + self.play(Write(text),run_time=4) + self.wait(2) + self.play(FadeOut(text)) + + + def show_area(self): + area = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.001, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity = 1, + stroke_width = 0, + ) + self.play(ShowCreation(area)) + # self.transform_between_riemann_rects(self.rects,area) + self.area = area + + def get_rects(self): + rects = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.01, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + # self.transform_between_riemann_rects(self.area,rects) + self.rects=rects + return rects + + def show_integral_values_at_different_x(self): + rects=self.rects + rect = rects[len(rects)*1//10] + dx_brace = Brace(rect, DOWN, buff = 0) + dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) + dx_brace_group = VGroup(dx_brace,dx_label) + rp=int(len(rects)/10) + rects_subset = self.rects[4*rp:5*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, LEFT, buff =.1) + y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) + y_int.next_to(brace, LEFT, MED_SMALL_BUFF) + anims = [ + rect.set_fill, self.area_color, 1, + dx_brace_group.next_to, rect, DOWN, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, self.area_color, self.area_opacity, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_y_int, y_int), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(y_int) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_y_int = y_int + + y_int = last_y_int + y_brace = last_brace + self.brace_group=VGroup(y_brace,dx_brace,rect) + self.y_int=y_int + self.dx_label=dx_label + + + def bounded_riemann_rectangles( + self, + graph1, + graph2, + x_min=None, + x_max=None, + dx=0.01, + input_sample_type="center", + stroke_width=1, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + show_signed_area=True, + width_scale_factor=1.001 + ): + x_min = x_min if x_min is not None else self.x_min + x_max = x_max if x_max is not None else self.x_max + if start_color is None: + start_color = self.default_riemann_start_color + if end_color is None: + end_color = self.default_riemann_end_color + rectangles = VGroup() + x_range = np.arange(x_min, x_max, dx) + colors = color_gradient([start_color, end_color], len(x_range)) + for x, color in zip(x_range, colors): + if input_sample_type == "left": + sample_input = x + elif input_sample_type == "right": + sample_input = x + dx + elif input_sample_type == "center": + sample_input = x + 0.5 * dx + else: + raise Exception("Invalid input sample type") + graph1_point = self.input_to_graph_point(sample_input, graph1) + graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) + graph2_point = self.input_to_graph_point(sample_input, graph2) + + points = VGroup(*list(map(VectorizedPoint, [ + graph1_point, + graph1_point_dx, + graph2_point + ]))) + + rect = Rectangle() + rect.replace(points, stretch=True) + if graph1_point[1] < self.graph_origin[1] and show_signed_area: + fill_color = invert_color(color) + else: + fill_color = color + rect.set_fill(fill_color, opacity=fill_opacity) + rect.set_stroke(stroke_color, width=stroke_width) + rectangles.add(rect) + return rectangles + +#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.gif new file mode 100644 index 0000000..e73dd8e Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.py new file mode 100644 index 0000000..662242a --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.py @@ -0,0 +1,428 @@ +from manimlib.imports import * + +class IterationMethods(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 1, + "y_min" : 0, + "y_max" : 1, + "x_tick_frequency" : 1, + "y_tick_frequency" : 1, + "x_labeled_nums": list(np.arange(0,2)), + "y_labeled_nums": list(np.arange(0 ,2)), + "x_axis_width": 6, + "y_axis_height": 6, + "graph_origin": ORIGIN+4.5*LEFT+3*DOWN, + "area_color": PINK , + "area_opacity": .6, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + self.intro_scene() + self.setup_axes(animate=True) + + + curve1= self.get_graph( + lambda x : x**2 , + x_min = 0, + x_max = 1, + color = ORANGE) + c1_eqn=self.get_graph_label( + curve1, + label="y=x^2", + x_val=.5, + direction=RIGHT, + buff=MED_LARGE_BUFF, + color=ORANGE, + ) + + curve2= self.get_graph( + lambda x : x , + x_min = 0, + x_max = 1, + color = YELLOW) + c2_eqn=self.get_graph_label( + curve2, + label="y=x", + x_val=.7, + direction=LEFT, + buff=MED_LARGE_BUFF, + color=YELLOW, + ) + self.curve1=curve1 + self.curve2=curve2 + + caption_limit=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) + int_lim=TextMobject( + "$$\\int_0^1$$" + ).next_to( + caption_limit,DOWN,buff=.5 + ).align_to( + caption_limit,LEFT + ) + + self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) + + self.play(Write(caption_limit)) + self.get_rects() + self.show_integral_values_at_different_x() + self.wait(1) + self.add(int_lim) + + self.integral_setup(int_lim,first_y=True) + + + self.another_method_scene() + self.remove(self.area) + self.wait() + + c1_eqn_y=self.get_graph_label( + curve1, + label="x=\sqrt y", + x_val=.6, + direction=RIGHT, + buff=MED_LARGE_BUFF, + color=ORANGE, + ) + c2_eqn_y=self.get_graph_label( + curve2, + label="x=y", + x_val=.7, + direction=LEFT, + buff=MED_LARGE_BUFF, + color=YELLOW, + ) + self.play( + ReplacementTransform(c1_eqn,c1_eqn_y), + ReplacementTransform(c2_eqn,c2_eqn_y) + ) + self.get_rects(base_y=True) + self.show_integral_values_at_different_y() + self.wait(1) + + int_lim_y=int_lim.copy() + int_lim_y.next_to(int_lim,DOWN) + equal=TextMobject("$$=$$").next_to(int_lim_y,LEFT) + self.add(equal,int_lim_y) + + self.integral_setup(int_lim_y,first_y=False) + + self.wait(2) + + ################### + def intro_scene(self): + text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) + self.play(Write(text),run_time=4) + self.wait(2) + self.play(FadeOut(text)) + + def another_method_scene(self): + text=TextMobject(r"The other method\\ of iteration") + text.next_to(self.curve1,UP,buff=-1) + self.play(GrowFromCenter(text)) + self.wait(2) + self.play(LaggedStart(FadeOut(text),lag_ratio=2)) + + def integral_setup(self,ref_object,first_y=True): + if first_y: + area=self.get_area() + self.area=area + self.play(FadeOut(self.brace_group)) + self.play(ApplyMethod( + self.y_int.next_to, + ref_object,RIGHT,buff=0) + ) + + self.play(ApplyMethod( + self.dx_label.next_to, + self.y_int,RIGHT), + ShowCreation(area),run_time=4 + ) + else: + area=self.get_area(base_y=True) + self.area=area + self.play( + FadeOut(self.y_brace_group), + Rotate(self.x_int,PI/2) + ) + self.play(ApplyMethod( + self.x_int.next_to, + ref_object,RIGHT,buff=0) + ) + self.play(ApplyMethod( + self.dy_label.next_to, + self.x_int,RIGHT), + ShowCreation(area),run_time=4 + ) + + def get_area(self,base_y=False): + if base_y: + area = self.bounded_riemann_rectangles_y( + lambda x: x, + lambda x: np.sqrt(x), + y_min = 0, + y_max = 1, + dy =.001, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.y_area = area + else: + area = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.001, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.area = area + + # self.transform_between_riemann_rects(self.rects,area) + return area + + def get_rects(self,base_y=False): + if base_y: + rects = self.bounded_riemann_rectangles_y( + lambda x: x, + lambda x: np.sqrt(x), + y_min = 0, + y_max = 1, + dy =.01, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.y_rects=rects + else: + rects = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.01, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.rects=rects + # self.transform_between_riemann_rects(self.area,rects) + + return rects + + def show_integral_values_at_different_x(self): + rects=self.rects + rect = rects[len(rects)*1//10] + dx_brace = Brace(rect, DOWN, buff = 0) + dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) + dx_brace_group = VGroup(dx_brace,dx_label) + rp=int(len(rects)/20) + rects_subset = rects[6*rp:7*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, LEFT, buff =.1) + y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) + y_int.next_to(brace, LEFT, MED_SMALL_BUFF) + anims = [ + rect.set_fill, self.area_color, 1, + dx_brace_group.next_to, rect, DOWN, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, self.area_color, self.area_opacity, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_y_int, y_int), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(y_int) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_y_int = y_int + + y_int = last_y_int + y_brace = last_brace + self.brace_group=VGroup(y_brace,dx_brace,rect) + self.y_int=y_int + self.dx_label=dx_label + + def show_integral_values_at_different_y(self): + rects=self.y_rects + rect = rects[len(rects)*1//10] + dy_brace = Brace(rect, LEFT, buff = 0) + dy_label = dy_brace.get_text("$dy$", buff = SMALL_BUFF) + dy_brace_group = VGroup(dy_brace,dy_label) + rp=int(len(rects)/20) + rects_subset = rects[5*rp:6*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, DOWN, buff =.1) + x_int = TexMobject("\\int_{y}^{\sqrt y}dx").rotate(-PI/2) + x_int.next_to(brace, DOWN, SMALL_BUFF) + anims = [ + rect.set_fill, self.area_color, 1, + dy_brace_group.next_to, rect, LEFT, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, self.area_color, self.area_opacity, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_x_int, x_int), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(x_int) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_x_int = x_int + + x_int = last_x_int + y_brace = last_brace + self.y_brace_group=VGroup(y_brace,dy_brace,rect) + self.x_int=x_int + self.dy_label=dy_label + + + def bounded_riemann_rectangles( + self, + graph1, + graph2, + x_min=None, + x_max=None, + dx=0.01, + input_sample_type="center", + stroke_width=1, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + show_signed_area=True, + width_scale_factor=1.001 + ): + x_min = x_min if x_min is not None else self.x_min + x_max = x_max if x_max is not None else self.x_max + if start_color is None: + start_color = self.default_riemann_start_color + if end_color is None: + end_color = self.default_riemann_end_color + rectangles = VGroup() + x_range = np.arange(x_min, x_max, dx) + colors = color_gradient([start_color, end_color], len(x_range)) + for x, color in zip(x_range, colors): + if input_sample_type == "left": + sample_input = x + elif input_sample_type == "right": + sample_input = x + dx + elif input_sample_type == "center": + sample_input = x + 0.5 * dx + else: + raise Exception("Invalid input sample type") + graph1_point = self.input_to_graph_point(sample_input, graph1) + graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) + graph2_point = self.input_to_graph_point(sample_input, graph2) + + points = VGroup(*list(map(VectorizedPoint, [ + graph1_point, + graph1_point_dx, + graph2_point + ]))) + + rect = Rectangle() + rect.replace(points, stretch=True) + if graph1_point[1] < self.graph_origin[1] and show_signed_area: + fill_color = invert_color(color) + else: + fill_color = color + rect.set_fill(fill_color, opacity=fill_opacity) + rect.set_stroke(stroke_color, width=stroke_width) + rectangles.add(rect) + return rectangles + + def bounded_riemann_rectangles_y( + self, + graph1, + graph2, + y_min=None, + y_max=None, + dy=0.01, + input_sample_type="center", + stroke_width=1, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + show_signed_area=True, + width_scale_factor=1.001 + ): + y_min = y_min if y_min is not None else self.y_min + y_max = y_max if y_max is not None else self.y_max + if start_color is None: + start_color = self.default_riemann_start_color + if end_color is None: + end_color = self.default_riemann_end_color + rectangles = VGroup() + y_range = np.arange(y_min, y_max, dy) + colors = color_gradient([start_color, end_color], len(y_range)) + for y, color in zip(y_range, colors): + if input_sample_type == "left": + sample_input = y + elif input_sample_type == "right": + sample_input = y + dy + elif input_sample_type == "center": + sample_input = y + 0.5 * dy + else: + raise Exception("Invalid input sample type") + graph1_point = self.coords_to_point( + graph1(sample_input),sample_input + ) + dy_input=sample_input + width_scale_factor * dy + graph1_point_dy= self.coords_to_point( + graph1(dy_input),dy_input + ) + graph2_point = self.coords_to_point( + graph2(sample_input),sample_input + ) + + points = VGroup(*list(map(VectorizedPoint, [ + graph1_point, + graph1_point_dy, + graph2_point + ]))) + + rect = Rectangle() + rect.replace(points, stretch=True) + if graph1_point[1] < self.graph_origin[1] and show_signed_area: + fill_color = invert_color(color) + else: + fill_color = color + rect.set_fill(fill_color, opacity=fill_opacity) + rect.set_stroke(stroke_color, width=stroke_width) + rectangles.add(rect) + return rectangles + + +#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.gif deleted file mode 100644 index 2e507f9..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.py deleted file mode 100644 index 55f91d3..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/iteration_methods_check.py +++ /dev/null @@ -1,226 +0,0 @@ -from manimlib.imports import * - -class IterationMethods(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 1, - "y_min" : 0, - "y_max" : 1, - "x_tick_frequency" : 1, - "y_tick_frequency" : 1, - "x_labeled_nums": list(np.arange(0,2)), - "y_labeled_nums": list(np.arange(0 ,2)), - "x_axis_width": 6, - "y_axis_height": 6, - "graph_origin": ORIGIN+4*LEFT+3*DOWN, - "area_color": PINK , - "area_opacity": .6, - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - - # self.intro_scene() - self.setup_axes(animate=True) - - - curve1= self.get_graph( - lambda x : x**2 , - x_min = 0, - x_max = 1, - color = ORANGE) - c1_eqn=self.get_graph_label( - curve1, - label="y=x^2", - x_val=.5, - direction=RIGHT, - buff=MED_LARGE_BUFF, - color=ORANGE, - ) - - curve2= self.get_graph( - lambda x : x , - x_min = 0, - x_max = 1, - color = YELLOW) - c2_eqn=self.get_graph_label( - curve2, - label="y=x", - x_val=.5, - direction=LEFT, - buff=MED_LARGE_BUFF, - color=YELLOW, - ) - self.curve1=curve1 - self.curve2=curve2 - - caption_y_int=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) - int_lim=TextMobject( - "$$\\int_0^1$$" - ).next_to( - caption_y_int,DOWN,buff=.5 - ).align_to( - caption_y_int,LEFT - ) - - self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) - rects=self.get_rects() - - self.play(Write(caption_y_int)) - self.show_integral_values_at_different_x() - self.wait(1) - self.add(int_lim) - self.play(FadeOut(self.brace_group)) - self.play(ApplyMethod( - self.y_int.next_to, - int_lim,RIGHT,buff=0)) - - self.play(ApplyMethod( - self.dx_label.next_to, - self.y_int,RIGHT)) - - self.show_area() - - self.wait(2) - - ################### - def intro_scene(self): - text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) - self.play(Write(text),run_time=4) - self.wait(2) - self.play(FadeOut(text)) - - - def show_area(self): - area = self.bounded_riemann_rectangles( - self.curve1, - self.curve2, - x_min = 0, - x_max = 1, - dx =.001, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity = 1, - stroke_width = 0, - ) - self.play(ShowCreation(area)) - # self.transform_between_riemann_rects(self.rects,area) - self.area = area - - def get_rects(self): - rects = self.bounded_riemann_rectangles( - self.curve1, - self.curve2, - x_min = 0, - x_max = 1, - dx =.01, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - # self.transform_between_riemann_rects(self.area,rects) - self.rects=rects - return rects - - def show_integral_values_at_different_x(self): - rects=self.rects - rect = rects[len(rects)*1//10] - dx_brace = Brace(rect, DOWN, buff = 0) - dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) - dx_brace_group = VGroup(dx_brace,dx_label) - rp=int(len(rects)/10) - rects_subset = self.rects[4*rp:5*rp] - - last_rect = None - for rect in rects_subset: - brace = Brace(rect, LEFT, buff =.1) - y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) - y_int.next_to(brace, LEFT, MED_SMALL_BUFF) - anims = [ - rect.set_fill, self.area_color, 1, - dx_brace_group.next_to, rect, DOWN, SMALL_BUFF - ] - if last_rect is not None: - anims += [ - last_rect.set_fill, None, 0, - # last_rect.set_fill, self.area_color, self.area_opacity, - ReplacementTransform(last_brace, brace), - ReplacementTransform(last_y_int, y_int), - ] - else: - anims += [ - GrowFromCenter(brace), - Write(y_int) - ] - self.play(*anims) - # self.wait(.2) - - last_rect = rect - last_brace = brace - last_y_int = y_int - - y_int = last_y_int - y_brace = last_brace - self.brace_group=VGroup(y_brace,dx_brace,rect) - self.y_int=y_int - self.dx_label=dx_label - - - def bounded_riemann_rectangles( - self, - graph1, - graph2, - x_min=None, - x_max=None, - dx=0.01, - input_sample_type="center", - stroke_width=1, - stroke_color=BLACK, - fill_opacity=1, - start_color=None, - end_color=None, - show_signed_area=True, - width_scale_factor=1.001 - ): - x_min = x_min if x_min is not None else self.x_min - x_max = x_max if x_max is not None else self.x_max - if start_color is None: - start_color = self.default_riemann_start_color - if end_color is None: - end_color = self.default_riemann_end_color - rectangles = VGroup() - x_range = np.arange(x_min, x_max, dx) - colors = color_gradient([start_color, end_color], len(x_range)) - for x, color in zip(x_range, colors): - if input_sample_type == "left": - sample_input = x - elif input_sample_type == "right": - sample_input = x + dx - elif input_sample_type == "center": - sample_input = x + 0.5 * dx - else: - raise Exception("Invalid input sample type") - graph1_point = self.input_to_graph_point(sample_input, graph1) - graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) - graph2_point = self.input_to_graph_point(sample_input, graph2) - - points = VGroup(*list(map(VectorizedPoint, [ - graph1_point, - graph1_point_dx, - graph2_point - ]))) - - rect = Rectangle() - rect.replace(points, stretch=True) - if graph1_point[1] < self.graph_origin[1] and show_signed_area: - fill_color = invert_color(color) - else: - fill_color = color - rect.set_fill(fill_color, opacity=fill_opacity) - rect.set_stroke(stroke_color, width=stroke_width) - rectangles.add(rect) - return rectangles - -#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem -- cgit From a72c9a676fb98c7ea1cfc8cadae197b2e5098623 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Wed, 27 May 2020 18:49:26 +0530 Subject: Uploaded additional files and gifs --- .../file1_epsilon_delta_defn.py | 120 +++++++++++++++++++++ .../file2_limit_approach_point.py | 66 ++++++++++++ .../file3_limit_func.py | 30 ++++++ .../file4_continuity_func.py | 32 ++++++ 4 files changed, 248 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_epsilon_delta_defn.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file2_limit_approach_point.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file3_limit_func.py create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file4_continuity_func.py (limited to 'FSF-2020') 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/file2_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 new file mode 100644 index 0000000..57d1d45 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file2_limit_approach_point.py @@ -0,0 +1,66 @@ +from manimlib.imports import * + +class Limit(GraphScene): + CONFIG = { + "x_min": 0, + "x_max": 4, + "y_min": 0, + "y_max": 4, + "graph_origin": ORIGIN + 3* DOWN+4*LEFT, + "x_labeled_nums": list(range(0, 4)), + "y_labeled_nums": list(range(0, 5)), + } + def construct(self): + topic = TextMobject("Different paths of approach to limit point") + topic.scale(1.5) + topic.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) + self.play(Write(topic)) + self.wait(1) + self.play(FadeOut(topic)) + + + + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + self.setup_axes(animate = True) + + y_x = self.get_graph(lambda x : x, x_min = -1, x_max = 4) + y_x_lab = self.get_graph_label(y_x, label = r"y = x") + + y_xsquare = self.get_graph(lambda x : x*x, x_min = -1, x_max = 4) + y_xsquare_lab = self.get_graph_label(y_xsquare, label = r"y = x^2") + + y_1 = self.get_graph(lambda x : 1, x_min = -1, x_max = 4) + y_1_lab = self.get_graph_label(y_1, label = r"y = 1") + + y_2minusx = self.get_graph(lambda x : 2 - x, x_min = -1, x_max = 4, color = RED) + y_2minusx_lab = self.get_graph_label(y_2minusx, label = r"y = 2 - x") + + limit_point = Dot().shift(self.graph_origin+1*XTD*RIGHT+1*YTD*UP) + limit_point_lab = TextMobject(r"(1,1)") + limit_point_lab.next_to(limit_point, DOWN) + + self.play(ShowCreation(limit_point)) + self.play(Write(limit_point_lab)) + self.wait(1) + + self.play(ShowCreation(y_x)) + self.play(Write(y_x_lab)) + self.wait(1) + + self.play(ShowCreation(y_xsquare)) + self.play(Write(y_xsquare_lab)) + self.wait(1) + + self.play(ShowCreation(y_1)) + self.play(Write(y_1_lab)) + self.wait(1) + + self.play(ShowCreation(y_2minusx)) + self.play(Write(y_2minusx_lab)) + self.wait(1) + + + + \ 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/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 -- cgit From f37fbc5243fd8a60dbd1c1ae6e31536b4c68b2e7 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Wed, 27 May 2020 18:56:42 +0530 Subject: Delete file1_limit_approach_point.py --- .../file1_limit_approach_point.py | 66 ---------------------- 1 file changed, 66 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_limit_approach_point.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_limit_approach_point.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_limit_approach_point.py deleted file mode 100644 index 57d1d45..0000000 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_limit_approach_point.py +++ /dev/null @@ -1,66 +0,0 @@ -from manimlib.imports import * - -class Limit(GraphScene): - CONFIG = { - "x_min": 0, - "x_max": 4, - "y_min": 0, - "y_max": 4, - "graph_origin": ORIGIN + 3* DOWN+4*LEFT, - "x_labeled_nums": list(range(0, 4)), - "y_labeled_nums": list(range(0, 5)), - } - def construct(self): - topic = TextMobject("Different paths of approach to limit point") - topic.scale(1.5) - topic.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE) - self.play(Write(topic)) - self.wait(1) - self.play(FadeOut(topic)) - - - - XTD = self.x_axis_width/(self.x_max- self.x_min) - YTD = self.y_axis_height/(self.y_max- self.y_min) - - self.setup_axes(animate = True) - - y_x = self.get_graph(lambda x : x, x_min = -1, x_max = 4) - y_x_lab = self.get_graph_label(y_x, label = r"y = x") - - y_xsquare = self.get_graph(lambda x : x*x, x_min = -1, x_max = 4) - y_xsquare_lab = self.get_graph_label(y_xsquare, label = r"y = x^2") - - y_1 = self.get_graph(lambda x : 1, x_min = -1, x_max = 4) - y_1_lab = self.get_graph_label(y_1, label = r"y = 1") - - y_2minusx = self.get_graph(lambda x : 2 - x, x_min = -1, x_max = 4, color = RED) - y_2minusx_lab = self.get_graph_label(y_2minusx, label = r"y = 2 - x") - - limit_point = Dot().shift(self.graph_origin+1*XTD*RIGHT+1*YTD*UP) - limit_point_lab = TextMobject(r"(1,1)") - limit_point_lab.next_to(limit_point, DOWN) - - self.play(ShowCreation(limit_point)) - self.play(Write(limit_point_lab)) - self.wait(1) - - self.play(ShowCreation(y_x)) - self.play(Write(y_x_lab)) - self.wait(1) - - self.play(ShowCreation(y_xsquare)) - self.play(Write(y_xsquare_lab)) - self.wait(1) - - self.play(ShowCreation(y_1)) - self.play(Write(y_1_lab)) - self.wait(1) - - self.play(ShowCreation(y_2minusx)) - self.play(Write(y_2minusx_lab)) - self.wait(1) - - - - \ No newline at end of file -- cgit From d7bde4c54d93e0d61a861b0b58ff6f52283f32a6 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Wed, 27 May 2020 18:57:04 +0530 Subject: Delete file1_limit_approach_point.gif --- .../gifs/file1_limit_approach_point.gif | Bin 47411 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_limit_approach_point.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_limit_approach_point.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_limit_approach_point.gif deleted file mode 100644 index 830b6f1..0000000 Binary files a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_limit_approach_point.gif and /dev/null differ -- cgit From 8d1ab085499f062225209afbbe5df719d93ec5a2 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Wed, 27 May 2020 18:57:33 +0530 Subject: Addded gifs --- .../gifs/file1_epsilon_delta_defn.gif | Bin 0 -> 214399 bytes .../gifs/file2_limit_approach_point.gif | Bin 0 -> 47411 bytes .../gifs/file3_limit_func.gif | Bin 0 -> 511560 bytes .../gifs/file4_continuity_func.gif | Bin 0 -> 523873 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_epsilon_delta_defn.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file2_limit_approach_point.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file3_limit_func.gif create mode 100644 FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file4_continuity_func.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..68f637e Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file1_epsilon_delta_defn.gif differ diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file2_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 new file mode 100644 index 0000000..830b6f1 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file2_limit_approach_point.gif differ 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 new file mode 100644 index 0000000..07b23be Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file3_limit_func.gif differ 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 new file mode 100644 index 0000000..560e0f1 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/gifs/file4_continuity_func.gif differ -- cgit From 83522974e3f99b8ce3e844877fd8a7ada081f410 Mon Sep 17 00:00:00 2001 From: nishanpoojary Date: Wed, 27 May 2020 19:38:30 +0530 Subject: Added Limits and Continuity Quiz --- ...s_and_Continuity_of_Multivariable_Function_Quiz.pdf | Bin 0 -> 101435 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 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 (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..99918e5 Binary files /dev/null and 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 differ -- cgit From dd8dcf80f04ff9b3e01518ebfc8de921d8949e7d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:14:53 +0530 Subject: Create file1_TangentPlanes.py Manim code for Video1 of lecture notes on the subtopic Tangent Plane Approximations--- .../file1_TangentPlanes.py | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py new file mode 100644 index 0000000..8e3a19e --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py @@ -0,0 +1,39 @@ +from manimlib.imports import* + +class TangenttoSurface(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + #parabola: -x**2-y**2 + p = 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_C,TEAL_D], + resolution=(20, 20)).scale(1).shift(1*RIGHT+2*UP) + self.set_camera_orientation(phi = 35 * DEGREES,theta = -40 * DEGREES ) + + r = Rectangle(side_length=2,side_breadth= 1, fill_color=PURPLE, fill_opacity=0.2).shift(ORIGIN-1+3*UP+2*RIGHT).scale(0.7) #---tangent plane along x axis + + r_text = TextMobject("Tangent Plane along $x$ axis",color = '#FFE4E1').scale(0.6).to_corner(UL) + r2_text = TextMobject("Tangent Plane along $y$ axis",color = '#FFE4E1').scale(0.6).to_corner(UL) + + a = Arrow(color = '#FFFFF0').shift(ORIGIN-1+3*UP+4*RIGHT).scale(0.5) + a2 = Arrow(color = '#FFFFF0').shift(ORIGIN+0.5+3*UP+RIGHT).scale(0.5) + a2.rotate(1.571) #----1.571 radian = 90 degrees + + self.add(axes) + self.play(Write(p)) + self.begin_ambient_camera_rotation(rate = 0.1) + self.add_fixed_in_frame_mobjects(r_text) + self.play(ShowCreation(r)) + self.play(ShowCreation(a)) + self.wait(1) + self.play(FadeOut(r),FadeOut(a),FadeOut(r_text)) + + r.rotate(1.571) #---tangent plane along y axis + self.play(ShowCreation(r)) + self.play(ShowCreation(a2)) + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(2) -- cgit From 3db080a68a32f82722dd77b7ca65cc8336f6c9fb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:18:01 +0530 Subject: file1_TangentPlanes.mp4 Added gif of file1_TangentPlanes.py--- .../file1_TangentPlanes.mp4 | Bin 0 -> 1483459 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 new file mode 100644 index 0000000..6a3ba6d Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 differ -- cgit From 003d8f6f9c391b675b73fc2610dd86d609ea498b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:27:04 +0530 Subject: file2_Tangent_plane_approximation_visualization.py Manim code for Video 2 of the lecture note on the subtopic Tangent Plane Approximations--- ...e2_Tangent_plane_approximation_visualization.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py new file mode 100644 index 0000000..984db16 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py @@ -0,0 +1,34 @@ +from manimlib.imports import* + +class TangenttoSurface(ThreeDScene): + + def construct(self): + axes = ThreeDAxes() + + #----f(x,y): x**2+y**2 + p = 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_C,GREEN_D], + resolution = (20, 20)).scale(1) + self.set_camera_orientation(phi = 75*DEGREES) + + h_text = TextMobject("The graph tends to coincide with its tangent plane").scale(0.5).to_corner(UL) + d = Dot([0,0,0],color ='#800000') #----critical point + r = Rectangle(height = 2,breadth = 1,color = YELLOW).scale(0.5) #----tangent plane to critical point + line1 = DashedLine(color=RED).shift(4*UP+1.3*RIGHT).rotate(1.571,UP).scale(1.2) + line2 = DashedLine(color=RED).shift(4*UP-1.3*RIGHT).rotate(1.571,UP).scale(1.2) + + r2 = Rectangle(height = 2, breadth = 1,color = GREEN, fill_opacity=0.3).scale(0.5) + + self.add(axes) + self.play(Write(r)) + self.play(Write(p),Write(d)) + self.play(ShowCreation(line1),ShowCreation(line2)) + self.wait(2) + + self.play(FadeOut(line1),FadeOut(line2),ReplacementTransform(p,r2)) + self.add_fixed_in_frame_mobjects(h_text) + self.wait(1) -- cgit From daf039ad46c5c795a4c39a6ab13696eb8f2a2763 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:29:56 +0530 Subject: Gif_2 Added gif of file2_Tangent_plane_approximation_visualization.mp4--- ...file2_Tangent_plane_approximation_visualization.mp4 | Bin 0 -> 336179 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 new file mode 100644 index 0000000..bc3448b Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 differ -- cgit From 9c57f9c032c98ce9e7ea5dda35b08dd2292bc4e7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:30:16 +0530 Subject: Delete file2_Tangent_plane_approximation_visualization.mp4 --- ...file2_Tangent_plane_approximation_visualization.mp4 | Bin 336179 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 deleted file mode 100644 index bc3448b..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 and /dev/null differ -- cgit From aeb9f27dfc12d5d64502f015d13e1a75c32ac7e1 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:31:02 +0530 Subject: Gif_2 Added gif of file2_Tangent_plane_approximation_visualization.py--- ...file2_Tangent_plane_approximation_visualization.mp4 | Bin 0 -> 336179 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 new file mode 100644 index 0000000..bc3448b Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 differ -- cgit From 407c6ad5fda44100792a0e309c2d56a05dfbe228 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:36:37 +0530 Subject: Create file3_non_differentiable_function.py Manim code for Video 3 of lecture note on the subtopic Tangent Plane Approximations--- .../file3_non_differentiable_function.py | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py new file mode 100644 index 0000000..13bd73e --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py @@ -0,0 +1,30 @@ +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() + + #----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) + + self.set_camera_orientation(phi = 75 * DEGREES) + + d = Dot([0,0,0],color = '#800000') #----critical point + d_text = TextMobject("$(0,0)$").scale(0.5).shift(0.2*DOWN) + f_text = TextMobject("$f$ is not differentiable at origin").scale(0.5).to_corner(UL) + + self.begin_ambient_camera_rotation(rate=0.1) + self.add(axes) + self.play(Write(p),Write(d)) + self.add_fixed_in_frame_mobjects(d_text) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) -- cgit From 65853aee28e884322684f8198a755234e6d80239 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:37:24 +0530 Subject: Add file3_non_differentiable_function.mp4 Gif of file3_non_differentiable_function.py--- .../file3_non_differentiable_function.mp4 | Bin 0 -> 424364 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 new file mode 100644 index 0000000..7417a87 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 differ -- cgit From ccf9bdb8caddf9f12e0472c0510eded3e5a895a8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:41:12 +0530 Subject: Create file4_Tangent plane_at_critical_points.py Manim code of Video 4 of the lecture note on the subtopic Tangent Plane Approximations--- .../file4_Tangent plane_at_critical_points.py | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py new file mode 100644 index 0000000..d129213 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.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) -- cgit From 29e1ba7b22ed3ee5485a9689a412b57c6ba30350 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:42:27 +0530 Subject: Add file4_Tangent plane_at_critical_points.mp4 Gif of file4_Tangent plane_at_critical_points.py--- .../file4_Tangent plane_at_critical_points.mp4 | Bin 0 -> 3101810 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 new file mode 100644 index 0000000..2c64f38 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 differ -- cgit From 319f956286f2f4529b0390ca6a535b742a52ae53 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:43:25 +0530 Subject: Rename file1_Total area of cross section A.py to file1_Total_area_of_cross_section.py --- .../file1_Total area of cross section A.py | 31 ---------------------- .../file1_Total_area_of_cross_section.py | 31 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py deleted file mode 100644 index b1ce29c..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py +++ /dev/null @@ -1,31 +0,0 @@ -from manimlib.imports import* - -class MotivationAnimation(Scene): - def construct(self): - - r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip - b = Brace(r,UP) - r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) - m_text = TextMobject("Metal Strip").shift(3*DOWN) - a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) - a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) - START = [1,0,0] - END = [0,3,0] - l = Line(START,END,color = RED).shift(0.9*DOWN) - a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) - - group1 = VGroup(r_text,b,a,l,a2,a2_text) - f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) - - ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip - - self.play(Write(r)) - self.wait(1) - self.play(ShowCreation(m_text)) - self.wait(1) - self.play(Write(group1)) - self.wait(2) - self.play(FadeOut(group1)) - self.wait(1) - self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) - diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py new file mode 100644 index 0000000..b1ce29c --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py @@ -0,0 +1,31 @@ +from manimlib.imports import* + +class MotivationAnimation(Scene): + def construct(self): + + r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip + b = Brace(r,UP) + r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) + m_text = TextMobject("Metal Strip").shift(3*DOWN) + a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) + a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) + START = [1,0,0] + END = [0,3,0] + l = Line(START,END,color = RED).shift(0.9*DOWN) + a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) + + group1 = VGroup(r_text,b,a,l,a2,a2_text) + f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) + + ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip + + self.play(Write(r)) + self.wait(1) + self.play(ShowCreation(m_text)) + self.wait(1) + self.play(Write(group1)) + self.wait(2) + self.play(FadeOut(group1)) + self.wait(1) + self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) + -- cgit From 0122bda3697101b536ade1857b06a7c5814ad3b7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:44:13 +0530 Subject: Rename file2_Tangent plane at extrema of a function.py to file2_Tangent_plane_at_extrema.py --- ...file2_Tangent plane at extrema of a function.py | 55 ---------------------- .../file2_Tangent_plane_at_extrema.py | 55 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py deleted file mode 100644 index 6889a52..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import* - -class TheoremAnimation(ThreeDScene): - def construct(self): - - axes = ThreeDAxes() - - #----parabola: x**2+y**2 - parabola1 = 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_E], - resolution=(20, 20)).scale(1) - - #----parabola: -x**2-y**2 - parabola2 = 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_E,PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi=75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.4) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane - - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) - - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) - - self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) - self.wait(1) - self.play(Write(parabola1)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) - - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py new file mode 100644 index 0000000..6889a52 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py @@ -0,0 +1,55 @@ +from manimlib.imports import* + +class TheoremAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + + #----parabola: x**2+y**2 + parabola1 = 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_E], + resolution=(20, 20)).scale(1) + + #----parabola: -x**2-y**2 + parabola2 = 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_E,PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane + + parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.add(axes) + self.add_fixed_in_frame_mobjects(parabola2_text) + self.wait(1) + self.play(Write(parabola1)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) + self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + + self.wait(1) + self.add_fixed_in_frame_mobjects(parabola1_text) + self.wait(1) + self.play(Write(parabola2)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) -- cgit From 9621629c384f7c91b2170a3a5f467aaeefbc669a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:44:57 +0530 Subject: Rename file3_Visualization of types of critical points.py to file3_Visualization_of_types_of_critical_points.py --- ...e3_Visualization of types of critical points.py | 70 ---------------------- ...e3_Visualization_of_types_of_critical_points.py | 70 ++++++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py deleted file mode 100644 index f9055e6..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py +++ /dev/null @@ -1,70 +0,0 @@ -from manimlib.imports import * - -class TypescpAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - - #----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) - - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) - - #----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) - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----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) - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r3_text) - self.wait(1) - self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py new file mode 100644 index 0000000..f9055e6 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py @@ -0,0 +1,70 @@ +from manimlib.imports import * + +class TypescpAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + #----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) + + r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + #----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) + + r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + #----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) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.play(FadeOut(r2_text)) + self.add(axes) + self.play(Write(f2),Write(d)) + self.add_fixed_in_frame_mobjects(f2_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r3_text) + self.wait(1) + self.play(FadeOut(r3_text)) + self.add(axes) + self.play(Write(f3),Write(d)) + self.add_fixed_in_frame_mobjects(f3_text) + self.wait(2) -- cgit From 9fbf83323d7ed99186887df532ffba98a4edbbce Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:45:29 +0530 Subject: Rename file4_f(x,y) = (y-x)(1-2x-3y).py to file4_f(x,y)=(y-x)(1-2x-3y).py --- .../file4_f(x,y) = (y-x)(1-2x-3y).py | 32 ---------------------- .../Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py deleted file mode 100644 index 72c93b1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = 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_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py new file mode 100644 index 0000000..72c93b1 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py @@ -0,0 +1,32 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point + d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 + r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) + + #----f(x,y) = (y-x)(1-2x-3y) + f = 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_D, PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.5) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(d_text) + self.wait(1) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(3) -- cgit From bb85fa86479bd1e67febb275b157a0c39d0f291a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:47:05 +0530 Subject: Delete file1_Total area of cross section A.mp4 --- .../file1_Total area of cross section A.mp4 | Bin 283509 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 deleted file mode 100644 index 436dedf..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 and /dev/null differ -- cgit From 8f72ec94d5d699d400c4fb32006ca37c39b17048 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:49:34 +0530 Subject: file1_Total_area_of_cross_section.mp4 Gif of Video 1 of lecture notes on Critical Points--- .../file1_Total_area_of_cross_section.mp4 | Bin 0 -> 283509 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 new file mode 100644 index 0000000..436dedf Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 differ -- cgit From f148b9756f1dd70ce30e382f858d22b66c8f096b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:50:03 +0530 Subject: Delete file2_Tangent plane at extrema of a function.mp4 --- .../file2_Tangent plane at extrema of a function.mp4 | Bin 3483550 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 deleted file mode 100644 index 75657be..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 and /dev/null differ -- cgit From 86f55cff7d519184d713c2988759796d3f533692 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:54:00 +0530 Subject: file2_Tangent_plane_at_extrema.mp4 Gif of file2_Tangent_plane_at_extrema.py Video 2 of lecture note on subtopic Critical Points--- .../file2_Tangent_plane_at_extrema.mp4 | Bin 0 -> 3483550 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 new file mode 100644 index 0000000..75657be Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 differ -- cgit From 00ff12bd3bfcad540ff14e7ecf40b5d88406a08f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:54:29 +0530 Subject: Delete file3_Visualization of types of critical points.mp4 --- ...ile3_Visualization of types of critical points.mp4 | Bin 1035267 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 deleted file mode 100644 index ea6b781..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 and /dev/null differ -- cgit From fdec91753096122b57ab787d005d08c2aa8b4386 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:56:32 +0530 Subject: Gif 3 Gif of file3_Visualization of_types_of _critical_points.py Video 3 of lecture note on subtopic Critical Points--- ...le3_Visualization of_types_of _critical_points.mp4 | Bin 0 -> 1035267 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 new file mode 100644 index 0000000..ea6b781 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 differ -- cgit From f516d1b082ed5e107e37e0c5a43916ca14816bef Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 28 May 2020 10:19:46 +0530 Subject: draft submission --- .../fubini's-theorem/file2_surface2.gif | Bin 2556585 -> 3791121 bytes .../fubini's-theorem/file2_surface2.py | 16 +- .../file3.o_iteration_methods_checkpoint.gif | Bin 0 -> 465521 bytes .../file3.o_iteration_methods_checkpoint.py | 226 +++++++++++ .../fubini's-theorem/file3_iteration_methods.gif | Bin 0 -> 1762897 bytes .../fubini's-theorem/file3_iteration_methods.py | 428 +++++++++++++++++++++ .../file3_iteration_methods_checkpoint.gif | Bin 465521 -> 0 bytes .../file3_iteration_methods_checkpoint.py | 226 ----------- .../fubini's-theorem/file4_iteration_methods.gif | Bin 1762897 -> 0 bytes .../fubini's-theorem/file4_iteration_methods.py | 428 --------------------- 10 files changed, 664 insertions(+), 660 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3.o_iteration_methods_checkpoint.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3.o_iteration_methods_checkpoint.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif index ac13f21..37c4b1d 100644 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.py index c998f3b..3160fdb 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.py +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.py @@ -63,7 +63,7 @@ class SurfacesAnimation(ThreeDScene): surface.set_style( fill_opacity=.5, fill_color=BLUE_E, - stroke_width=0.2, + stroke_width=0.4, stroke_color=WHITE, ) #get boundary curves @@ -85,17 +85,18 @@ class SurfacesAnimation(ThreeDScene): self.add(c1,c2,c1_label,c2_label) - self.begin_ambient_camera_rotation(rate=0.4) + self.begin_ambient_camera_rotation(rate=0.24) self.get_region(self.axes,c1,c2) self.play(Write(surface)) self.get_lines() - self.wait(1) + self.wait(3.5) self.stop_ambient_camera_rotation() + self.wait(.5) self.move_camera( distance=20, phi=10 * DEGREES, theta=80 * DEGREES, - run_time=2.5 + run_time=3 ) self.wait(2) @@ -128,7 +129,7 @@ class SurfacesAnimation(ThreeDScene): R=TextMobject("R").set_color(PINK).scale(2).rotate(180*DEGREES , OUT) R.move_to(region,IN+RIGHT) - self.play(Write(region)) + self.play(ShowCreation(region)) self.add(R) def get_surface(self,axes, func, **kwargs): @@ -279,8 +280,11 @@ class SurfacesAnimation(ThreeDScene): axes.z_axis.label = z_label for axis in axes: axis.add(axis.label) - return axes + return axes #uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem + + + diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3.o_iteration_methods_checkpoint.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3.o_iteration_methods_checkpoint.gif new file mode 100644 index 0000000..2e507f9 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3.o_iteration_methods_checkpoint.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3.o_iteration_methods_checkpoint.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3.o_iteration_methods_checkpoint.py new file mode 100644 index 0000000..55f91d3 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3.o_iteration_methods_checkpoint.py @@ -0,0 +1,226 @@ +from manimlib.imports import * + +class IterationMethods(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 1, + "y_min" : 0, + "y_max" : 1, + "x_tick_frequency" : 1, + "y_tick_frequency" : 1, + "x_labeled_nums": list(np.arange(0,2)), + "y_labeled_nums": list(np.arange(0 ,2)), + "x_axis_width": 6, + "y_axis_height": 6, + "graph_origin": ORIGIN+4*LEFT+3*DOWN, + "area_color": PINK , + "area_opacity": .6, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + # self.intro_scene() + self.setup_axes(animate=True) + + + curve1= self.get_graph( + lambda x : x**2 , + x_min = 0, + x_max = 1, + color = ORANGE) + c1_eqn=self.get_graph_label( + curve1, + label="y=x^2", + x_val=.5, + direction=RIGHT, + buff=MED_LARGE_BUFF, + color=ORANGE, + ) + + curve2= self.get_graph( + lambda x : x , + x_min = 0, + x_max = 1, + color = YELLOW) + c2_eqn=self.get_graph_label( + curve2, + label="y=x", + x_val=.5, + direction=LEFT, + buff=MED_LARGE_BUFF, + color=YELLOW, + ) + self.curve1=curve1 + self.curve2=curve2 + + caption_y_int=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) + int_lim=TextMobject( + "$$\\int_0^1$$" + ).next_to( + caption_y_int,DOWN,buff=.5 + ).align_to( + caption_y_int,LEFT + ) + + self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) + rects=self.get_rects() + + self.play(Write(caption_y_int)) + self.show_integral_values_at_different_x() + self.wait(1) + self.add(int_lim) + self.play(FadeOut(self.brace_group)) + self.play(ApplyMethod( + self.y_int.next_to, + int_lim,RIGHT,buff=0)) + + self.play(ApplyMethod( + self.dx_label.next_to, + self.y_int,RIGHT)) + + self.show_area() + + self.wait(2) + + ################### + def intro_scene(self): + text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) + self.play(Write(text),run_time=4) + self.wait(2) + self.play(FadeOut(text)) + + + def show_area(self): + area = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.001, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity = 1, + stroke_width = 0, + ) + self.play(ShowCreation(area)) + # self.transform_between_riemann_rects(self.rects,area) + self.area = area + + def get_rects(self): + rects = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.01, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + # self.transform_between_riemann_rects(self.area,rects) + self.rects=rects + return rects + + def show_integral_values_at_different_x(self): + rects=self.rects + rect = rects[len(rects)*1//10] + dx_brace = Brace(rect, DOWN, buff = 0) + dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) + dx_brace_group = VGroup(dx_brace,dx_label) + rp=int(len(rects)/10) + rects_subset = self.rects[4*rp:5*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, LEFT, buff =.1) + y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) + y_int.next_to(brace, LEFT, MED_SMALL_BUFF) + anims = [ + rect.set_fill, self.area_color, 1, + dx_brace_group.next_to, rect, DOWN, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, self.area_color, self.area_opacity, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_y_int, y_int), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(y_int) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_y_int = y_int + + y_int = last_y_int + y_brace = last_brace + self.brace_group=VGroup(y_brace,dx_brace,rect) + self.y_int=y_int + self.dx_label=dx_label + + + def bounded_riemann_rectangles( + self, + graph1, + graph2, + x_min=None, + x_max=None, + dx=0.01, + input_sample_type="center", + stroke_width=1, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + show_signed_area=True, + width_scale_factor=1.001 + ): + x_min = x_min if x_min is not None else self.x_min + x_max = x_max if x_max is not None else self.x_max + if start_color is None: + start_color = self.default_riemann_start_color + if end_color is None: + end_color = self.default_riemann_end_color + rectangles = VGroup() + x_range = np.arange(x_min, x_max, dx) + colors = color_gradient([start_color, end_color], len(x_range)) + for x, color in zip(x_range, colors): + if input_sample_type == "left": + sample_input = x + elif input_sample_type == "right": + sample_input = x + dx + elif input_sample_type == "center": + sample_input = x + 0.5 * dx + else: + raise Exception("Invalid input sample type") + graph1_point = self.input_to_graph_point(sample_input, graph1) + graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) + graph2_point = self.input_to_graph_point(sample_input, graph2) + + points = VGroup(*list(map(VectorizedPoint, [ + graph1_point, + graph1_point_dx, + graph2_point + ]))) + + rect = Rectangle() + rect.replace(points, stretch=True) + if graph1_point[1] < self.graph_origin[1] and show_signed_area: + fill_color = invert_color(color) + else: + fill_color = color + rect.set_fill(fill_color, opacity=fill_opacity) + rect.set_stroke(stroke_color, width=stroke_width) + rectangles.add(rect) + return rectangles + +#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif new file mode 100644 index 0000000..e73dd8e Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py new file mode 100644 index 0000000..662242a --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py @@ -0,0 +1,428 @@ +from manimlib.imports import * + +class IterationMethods(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 1, + "y_min" : 0, + "y_max" : 1, + "x_tick_frequency" : 1, + "y_tick_frequency" : 1, + "x_labeled_nums": list(np.arange(0,2)), + "y_labeled_nums": list(np.arange(0 ,2)), + "x_axis_width": 6, + "y_axis_height": 6, + "graph_origin": ORIGIN+4.5*LEFT+3*DOWN, + "area_color": PINK , + "area_opacity": .6, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + self.intro_scene() + self.setup_axes(animate=True) + + + curve1= self.get_graph( + lambda x : x**2 , + x_min = 0, + x_max = 1, + color = ORANGE) + c1_eqn=self.get_graph_label( + curve1, + label="y=x^2", + x_val=.5, + direction=RIGHT, + buff=MED_LARGE_BUFF, + color=ORANGE, + ) + + curve2= self.get_graph( + lambda x : x , + x_min = 0, + x_max = 1, + color = YELLOW) + c2_eqn=self.get_graph_label( + curve2, + label="y=x", + x_val=.7, + direction=LEFT, + buff=MED_LARGE_BUFF, + color=YELLOW, + ) + self.curve1=curve1 + self.curve2=curve2 + + caption_limit=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) + int_lim=TextMobject( + "$$\\int_0^1$$" + ).next_to( + caption_limit,DOWN,buff=.5 + ).align_to( + caption_limit,LEFT + ) + + self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) + + self.play(Write(caption_limit)) + self.get_rects() + self.show_integral_values_at_different_x() + self.wait(1) + self.add(int_lim) + + self.integral_setup(int_lim,first_y=True) + + + self.another_method_scene() + self.remove(self.area) + self.wait() + + c1_eqn_y=self.get_graph_label( + curve1, + label="x=\sqrt y", + x_val=.6, + direction=RIGHT, + buff=MED_LARGE_BUFF, + color=ORANGE, + ) + c2_eqn_y=self.get_graph_label( + curve2, + label="x=y", + x_val=.7, + direction=LEFT, + buff=MED_LARGE_BUFF, + color=YELLOW, + ) + self.play( + ReplacementTransform(c1_eqn,c1_eqn_y), + ReplacementTransform(c2_eqn,c2_eqn_y) + ) + self.get_rects(base_y=True) + self.show_integral_values_at_different_y() + self.wait(1) + + int_lim_y=int_lim.copy() + int_lim_y.next_to(int_lim,DOWN) + equal=TextMobject("$$=$$").next_to(int_lim_y,LEFT) + self.add(equal,int_lim_y) + + self.integral_setup(int_lim_y,first_y=False) + + self.wait(2) + + ################### + def intro_scene(self): + text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) + self.play(Write(text),run_time=4) + self.wait(2) + self.play(FadeOut(text)) + + def another_method_scene(self): + text=TextMobject(r"The other method\\ of iteration") + text.next_to(self.curve1,UP,buff=-1) + self.play(GrowFromCenter(text)) + self.wait(2) + self.play(LaggedStart(FadeOut(text),lag_ratio=2)) + + def integral_setup(self,ref_object,first_y=True): + if first_y: + area=self.get_area() + self.area=area + self.play(FadeOut(self.brace_group)) + self.play(ApplyMethod( + self.y_int.next_to, + ref_object,RIGHT,buff=0) + ) + + self.play(ApplyMethod( + self.dx_label.next_to, + self.y_int,RIGHT), + ShowCreation(area),run_time=4 + ) + else: + area=self.get_area(base_y=True) + self.area=area + self.play( + FadeOut(self.y_brace_group), + Rotate(self.x_int,PI/2) + ) + self.play(ApplyMethod( + self.x_int.next_to, + ref_object,RIGHT,buff=0) + ) + self.play(ApplyMethod( + self.dy_label.next_to, + self.x_int,RIGHT), + ShowCreation(area),run_time=4 + ) + + def get_area(self,base_y=False): + if base_y: + area = self.bounded_riemann_rectangles_y( + lambda x: x, + lambda x: np.sqrt(x), + y_min = 0, + y_max = 1, + dy =.001, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.y_area = area + else: + area = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.001, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.area = area + + # self.transform_between_riemann_rects(self.rects,area) + return area + + def get_rects(self,base_y=False): + if base_y: + rects = self.bounded_riemann_rectangles_y( + lambda x: x, + lambda x: np.sqrt(x), + y_min = 0, + y_max = 1, + dy =.01, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.y_rects=rects + else: + rects = self.bounded_riemann_rectangles( + self.curve1, + self.curve2, + x_min = 0, + x_max = 1, + dx =.01, + start_color = self.area_color, + end_color = self.area_color, + fill_opacity =self.area_opacity, + stroke_width = 0, + ) + self.rects=rects + # self.transform_between_riemann_rects(self.area,rects) + + return rects + + def show_integral_values_at_different_x(self): + rects=self.rects + rect = rects[len(rects)*1//10] + dx_brace = Brace(rect, DOWN, buff = 0) + dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) + dx_brace_group = VGroup(dx_brace,dx_label) + rp=int(len(rects)/20) + rects_subset = rects[6*rp:7*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, LEFT, buff =.1) + y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) + y_int.next_to(brace, LEFT, MED_SMALL_BUFF) + anims = [ + rect.set_fill, self.area_color, 1, + dx_brace_group.next_to, rect, DOWN, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, self.area_color, self.area_opacity, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_y_int, y_int), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(y_int) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_y_int = y_int + + y_int = last_y_int + y_brace = last_brace + self.brace_group=VGroup(y_brace,dx_brace,rect) + self.y_int=y_int + self.dx_label=dx_label + + def show_integral_values_at_different_y(self): + rects=self.y_rects + rect = rects[len(rects)*1//10] + dy_brace = Brace(rect, LEFT, buff = 0) + dy_label = dy_brace.get_text("$dy$", buff = SMALL_BUFF) + dy_brace_group = VGroup(dy_brace,dy_label) + rp=int(len(rects)/20) + rects_subset = rects[5*rp:6*rp] + + last_rect = None + for rect in rects_subset: + brace = Brace(rect, DOWN, buff =.1) + x_int = TexMobject("\\int_{y}^{\sqrt y}dx").rotate(-PI/2) + x_int.next_to(brace, DOWN, SMALL_BUFF) + anims = [ + rect.set_fill, self.area_color, 1, + dy_brace_group.next_to, rect, LEFT, SMALL_BUFF + ] + if last_rect is not None: + anims += [ + last_rect.set_fill, None, 0, + # last_rect.set_fill, self.area_color, self.area_opacity, + ReplacementTransform(last_brace, brace), + ReplacementTransform(last_x_int, x_int), + ] + else: + anims += [ + GrowFromCenter(brace), + Write(x_int) + ] + self.play(*anims) + # self.wait(.2) + + last_rect = rect + last_brace = brace + last_x_int = x_int + + x_int = last_x_int + y_brace = last_brace + self.y_brace_group=VGroup(y_brace,dy_brace,rect) + self.x_int=x_int + self.dy_label=dy_label + + + def bounded_riemann_rectangles( + self, + graph1, + graph2, + x_min=None, + x_max=None, + dx=0.01, + input_sample_type="center", + stroke_width=1, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + show_signed_area=True, + width_scale_factor=1.001 + ): + x_min = x_min if x_min is not None else self.x_min + x_max = x_max if x_max is not None else self.x_max + if start_color is None: + start_color = self.default_riemann_start_color + if end_color is None: + end_color = self.default_riemann_end_color + rectangles = VGroup() + x_range = np.arange(x_min, x_max, dx) + colors = color_gradient([start_color, end_color], len(x_range)) + for x, color in zip(x_range, colors): + if input_sample_type == "left": + sample_input = x + elif input_sample_type == "right": + sample_input = x + dx + elif input_sample_type == "center": + sample_input = x + 0.5 * dx + else: + raise Exception("Invalid input sample type") + graph1_point = self.input_to_graph_point(sample_input, graph1) + graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) + graph2_point = self.input_to_graph_point(sample_input, graph2) + + points = VGroup(*list(map(VectorizedPoint, [ + graph1_point, + graph1_point_dx, + graph2_point + ]))) + + rect = Rectangle() + rect.replace(points, stretch=True) + if graph1_point[1] < self.graph_origin[1] and show_signed_area: + fill_color = invert_color(color) + else: + fill_color = color + rect.set_fill(fill_color, opacity=fill_opacity) + rect.set_stroke(stroke_color, width=stroke_width) + rectangles.add(rect) + return rectangles + + def bounded_riemann_rectangles_y( + self, + graph1, + graph2, + y_min=None, + y_max=None, + dy=0.01, + input_sample_type="center", + stroke_width=1, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + show_signed_area=True, + width_scale_factor=1.001 + ): + y_min = y_min if y_min is not None else self.y_min + y_max = y_max if y_max is not None else self.y_max + if start_color is None: + start_color = self.default_riemann_start_color + if end_color is None: + end_color = self.default_riemann_end_color + rectangles = VGroup() + y_range = np.arange(y_min, y_max, dy) + colors = color_gradient([start_color, end_color], len(y_range)) + for y, color in zip(y_range, colors): + if input_sample_type == "left": + sample_input = y + elif input_sample_type == "right": + sample_input = y + dy + elif input_sample_type == "center": + sample_input = y + 0.5 * dy + else: + raise Exception("Invalid input sample type") + graph1_point = self.coords_to_point( + graph1(sample_input),sample_input + ) + dy_input=sample_input + width_scale_factor * dy + graph1_point_dy= self.coords_to_point( + graph1(dy_input),dy_input + ) + graph2_point = self.coords_to_point( + graph2(sample_input),sample_input + ) + + points = VGroup(*list(map(VectorizedPoint, [ + graph1_point, + graph1_point_dy, + graph2_point + ]))) + + rect = Rectangle() + rect.replace(points, stretch=True) + if graph1_point[1] < self.graph_origin[1] and show_signed_area: + fill_color = invert_color(color) + else: + fill_color = color + rect.set_fill(fill_color, opacity=fill_opacity) + rect.set_stroke(stroke_color, width=stroke_width) + rectangles.add(rect) + return rectangles + + +#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.gif deleted file mode 100644 index 2e507f9..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.py deleted file mode 100644 index 55f91d3..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods_checkpoint.py +++ /dev/null @@ -1,226 +0,0 @@ -from manimlib.imports import * - -class IterationMethods(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 1, - "y_min" : 0, - "y_max" : 1, - "x_tick_frequency" : 1, - "y_tick_frequency" : 1, - "x_labeled_nums": list(np.arange(0,2)), - "y_labeled_nums": list(np.arange(0 ,2)), - "x_axis_width": 6, - "y_axis_height": 6, - "graph_origin": ORIGIN+4*LEFT+3*DOWN, - "area_color": PINK , - "area_opacity": .6, - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - - # self.intro_scene() - self.setup_axes(animate=True) - - - curve1= self.get_graph( - lambda x : x**2 , - x_min = 0, - x_max = 1, - color = ORANGE) - c1_eqn=self.get_graph_label( - curve1, - label="y=x^2", - x_val=.5, - direction=RIGHT, - buff=MED_LARGE_BUFF, - color=ORANGE, - ) - - curve2= self.get_graph( - lambda x : x , - x_min = 0, - x_max = 1, - color = YELLOW) - c2_eqn=self.get_graph_label( - curve2, - label="y=x", - x_val=.5, - direction=LEFT, - buff=MED_LARGE_BUFF, - color=YELLOW, - ) - self.curve1=curve1 - self.curve2=curve2 - - caption_y_int=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) - int_lim=TextMobject( - "$$\\int_0^1$$" - ).next_to( - caption_y_int,DOWN,buff=.5 - ).align_to( - caption_y_int,LEFT - ) - - self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) - rects=self.get_rects() - - self.play(Write(caption_y_int)) - self.show_integral_values_at_different_x() - self.wait(1) - self.add(int_lim) - self.play(FadeOut(self.brace_group)) - self.play(ApplyMethod( - self.y_int.next_to, - int_lim,RIGHT,buff=0)) - - self.play(ApplyMethod( - self.dx_label.next_to, - self.y_int,RIGHT)) - - self.show_area() - - self.wait(2) - - ################### - def intro_scene(self): - text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) - self.play(Write(text),run_time=4) - self.wait(2) - self.play(FadeOut(text)) - - - def show_area(self): - area = self.bounded_riemann_rectangles( - self.curve1, - self.curve2, - x_min = 0, - x_max = 1, - dx =.001, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity = 1, - stroke_width = 0, - ) - self.play(ShowCreation(area)) - # self.transform_between_riemann_rects(self.rects,area) - self.area = area - - def get_rects(self): - rects = self.bounded_riemann_rectangles( - self.curve1, - self.curve2, - x_min = 0, - x_max = 1, - dx =.01, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - # self.transform_between_riemann_rects(self.area,rects) - self.rects=rects - return rects - - def show_integral_values_at_different_x(self): - rects=self.rects - rect = rects[len(rects)*1//10] - dx_brace = Brace(rect, DOWN, buff = 0) - dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) - dx_brace_group = VGroup(dx_brace,dx_label) - rp=int(len(rects)/10) - rects_subset = self.rects[4*rp:5*rp] - - last_rect = None - for rect in rects_subset: - brace = Brace(rect, LEFT, buff =.1) - y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) - y_int.next_to(brace, LEFT, MED_SMALL_BUFF) - anims = [ - rect.set_fill, self.area_color, 1, - dx_brace_group.next_to, rect, DOWN, SMALL_BUFF - ] - if last_rect is not None: - anims += [ - last_rect.set_fill, None, 0, - # last_rect.set_fill, self.area_color, self.area_opacity, - ReplacementTransform(last_brace, brace), - ReplacementTransform(last_y_int, y_int), - ] - else: - anims += [ - GrowFromCenter(brace), - Write(y_int) - ] - self.play(*anims) - # self.wait(.2) - - last_rect = rect - last_brace = brace - last_y_int = y_int - - y_int = last_y_int - y_brace = last_brace - self.brace_group=VGroup(y_brace,dx_brace,rect) - self.y_int=y_int - self.dx_label=dx_label - - - def bounded_riemann_rectangles( - self, - graph1, - graph2, - x_min=None, - x_max=None, - dx=0.01, - input_sample_type="center", - stroke_width=1, - stroke_color=BLACK, - fill_opacity=1, - start_color=None, - end_color=None, - show_signed_area=True, - width_scale_factor=1.001 - ): - x_min = x_min if x_min is not None else self.x_min - x_max = x_max if x_max is not None else self.x_max - if start_color is None: - start_color = self.default_riemann_start_color - if end_color is None: - end_color = self.default_riemann_end_color - rectangles = VGroup() - x_range = np.arange(x_min, x_max, dx) - colors = color_gradient([start_color, end_color], len(x_range)) - for x, color in zip(x_range, colors): - if input_sample_type == "left": - sample_input = x - elif input_sample_type == "right": - sample_input = x + dx - elif input_sample_type == "center": - sample_input = x + 0.5 * dx - else: - raise Exception("Invalid input sample type") - graph1_point = self.input_to_graph_point(sample_input, graph1) - graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) - graph2_point = self.input_to_graph_point(sample_input, graph2) - - points = VGroup(*list(map(VectorizedPoint, [ - graph1_point, - graph1_point_dx, - graph2_point - ]))) - - rect = Rectangle() - rect.replace(points, stretch=True) - if graph1_point[1] < self.graph_origin[1] and show_signed_area: - fill_color = invert_color(color) - else: - fill_color = color - rect.set_fill(fill_color, opacity=fill_opacity) - rect.set_stroke(stroke_color, width=stroke_width) - rectangles.add(rect) - return rectangles - -#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.gif deleted file mode 100644 index e73dd8e..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.py deleted file mode 100644 index 662242a..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_iteration_methods.py +++ /dev/null @@ -1,428 +0,0 @@ -from manimlib.imports import * - -class IterationMethods(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 1, - "y_min" : 0, - "y_max" : 1, - "x_tick_frequency" : 1, - "y_tick_frequency" : 1, - "x_labeled_nums": list(np.arange(0,2)), - "y_labeled_nums": list(np.arange(0 ,2)), - "x_axis_width": 6, - "y_axis_height": 6, - "graph_origin": ORIGIN+4.5*LEFT+3*DOWN, - "area_color": PINK , - "area_opacity": .6, - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - - self.intro_scene() - self.setup_axes(animate=True) - - - curve1= self.get_graph( - lambda x : x**2 , - x_min = 0, - x_max = 1, - color = ORANGE) - c1_eqn=self.get_graph_label( - curve1, - label="y=x^2", - x_val=.5, - direction=RIGHT, - buff=MED_LARGE_BUFF, - color=ORANGE, - ) - - curve2= self.get_graph( - lambda x : x , - x_min = 0, - x_max = 1, - color = YELLOW) - c2_eqn=self.get_graph_label( - curve2, - label="y=x", - x_val=.7, - direction=LEFT, - buff=MED_LARGE_BUFF, - color=YELLOW, - ) - self.curve1=curve1 - self.curve2=curve2 - - caption_limit=TextMobject(r"Observe the limits\\ of integration").to_corner(UR) - int_lim=TextMobject( - "$$\\int_0^1$$" - ).next_to( - caption_limit,DOWN,buff=.5 - ).align_to( - caption_limit,LEFT - ) - - self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) - - self.play(Write(caption_limit)) - self.get_rects() - self.show_integral_values_at_different_x() - self.wait(1) - self.add(int_lim) - - self.integral_setup(int_lim,first_y=True) - - - self.another_method_scene() - self.remove(self.area) - self.wait() - - c1_eqn_y=self.get_graph_label( - curve1, - label="x=\sqrt y", - x_val=.6, - direction=RIGHT, - buff=MED_LARGE_BUFF, - color=ORANGE, - ) - c2_eqn_y=self.get_graph_label( - curve2, - label="x=y", - x_val=.7, - direction=LEFT, - buff=MED_LARGE_BUFF, - color=YELLOW, - ) - self.play( - ReplacementTransform(c1_eqn,c1_eqn_y), - ReplacementTransform(c2_eqn,c2_eqn_y) - ) - self.get_rects(base_y=True) - self.show_integral_values_at_different_y() - self.wait(1) - - int_lim_y=int_lim.copy() - int_lim_y.next_to(int_lim,DOWN) - equal=TextMobject("$$=$$").next_to(int_lim_y,LEFT) - self.add(equal,int_lim_y) - - self.integral_setup(int_lim_y,first_y=False) - - self.wait(2) - - ################### - def intro_scene(self): - text=TextMobject(r"How different orders of \textbf{iterated integral}\\ works over the same region ?" ) - self.play(Write(text),run_time=4) - self.wait(2) - self.play(FadeOut(text)) - - def another_method_scene(self): - text=TextMobject(r"The other method\\ of iteration") - text.next_to(self.curve1,UP,buff=-1) - self.play(GrowFromCenter(text)) - self.wait(2) - self.play(LaggedStart(FadeOut(text),lag_ratio=2)) - - def integral_setup(self,ref_object,first_y=True): - if first_y: - area=self.get_area() - self.area=area - self.play(FadeOut(self.brace_group)) - self.play(ApplyMethod( - self.y_int.next_to, - ref_object,RIGHT,buff=0) - ) - - self.play(ApplyMethod( - self.dx_label.next_to, - self.y_int,RIGHT), - ShowCreation(area),run_time=4 - ) - else: - area=self.get_area(base_y=True) - self.area=area - self.play( - FadeOut(self.y_brace_group), - Rotate(self.x_int,PI/2) - ) - self.play(ApplyMethod( - self.x_int.next_to, - ref_object,RIGHT,buff=0) - ) - self.play(ApplyMethod( - self.dy_label.next_to, - self.x_int,RIGHT), - ShowCreation(area),run_time=4 - ) - - def get_area(self,base_y=False): - if base_y: - area = self.bounded_riemann_rectangles_y( - lambda x: x, - lambda x: np.sqrt(x), - y_min = 0, - y_max = 1, - dy =.001, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - self.y_area = area - else: - area = self.bounded_riemann_rectangles( - self.curve1, - self.curve2, - x_min = 0, - x_max = 1, - dx =.001, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - self.area = area - - # self.transform_between_riemann_rects(self.rects,area) - return area - - def get_rects(self,base_y=False): - if base_y: - rects = self.bounded_riemann_rectangles_y( - lambda x: x, - lambda x: np.sqrt(x), - y_min = 0, - y_max = 1, - dy =.01, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - self.y_rects=rects - else: - rects = self.bounded_riemann_rectangles( - self.curve1, - self.curve2, - x_min = 0, - x_max = 1, - dx =.01, - start_color = self.area_color, - end_color = self.area_color, - fill_opacity =self.area_opacity, - stroke_width = 0, - ) - self.rects=rects - # self.transform_between_riemann_rects(self.area,rects) - - return rects - - def show_integral_values_at_different_x(self): - rects=self.rects - rect = rects[len(rects)*1//10] - dx_brace = Brace(rect, DOWN, buff = 0) - dx_label = dx_brace.get_text("$dx$", buff = SMALL_BUFF) - dx_brace_group = VGroup(dx_brace,dx_label) - rp=int(len(rects)/20) - rects_subset = rects[6*rp:7*rp] - - last_rect = None - for rect in rects_subset: - brace = Brace(rect, LEFT, buff =.1) - y_int = TexMobject("\\int_{x^2}^{x}dy")#.rotate(PI/2) - y_int.next_to(brace, LEFT, MED_SMALL_BUFF) - anims = [ - rect.set_fill, self.area_color, 1, - dx_brace_group.next_to, rect, DOWN, SMALL_BUFF - ] - if last_rect is not None: - anims += [ - last_rect.set_fill, None, 0, - # last_rect.set_fill, self.area_color, self.area_opacity, - ReplacementTransform(last_brace, brace), - ReplacementTransform(last_y_int, y_int), - ] - else: - anims += [ - GrowFromCenter(brace), - Write(y_int) - ] - self.play(*anims) - # self.wait(.2) - - last_rect = rect - last_brace = brace - last_y_int = y_int - - y_int = last_y_int - y_brace = last_brace - self.brace_group=VGroup(y_brace,dx_brace,rect) - self.y_int=y_int - self.dx_label=dx_label - - def show_integral_values_at_different_y(self): - rects=self.y_rects - rect = rects[len(rects)*1//10] - dy_brace = Brace(rect, LEFT, buff = 0) - dy_label = dy_brace.get_text("$dy$", buff = SMALL_BUFF) - dy_brace_group = VGroup(dy_brace,dy_label) - rp=int(len(rects)/20) - rects_subset = rects[5*rp:6*rp] - - last_rect = None - for rect in rects_subset: - brace = Brace(rect, DOWN, buff =.1) - x_int = TexMobject("\\int_{y}^{\sqrt y}dx").rotate(-PI/2) - x_int.next_to(brace, DOWN, SMALL_BUFF) - anims = [ - rect.set_fill, self.area_color, 1, - dy_brace_group.next_to, rect, LEFT, SMALL_BUFF - ] - if last_rect is not None: - anims += [ - last_rect.set_fill, None, 0, - # last_rect.set_fill, self.area_color, self.area_opacity, - ReplacementTransform(last_brace, brace), - ReplacementTransform(last_x_int, x_int), - ] - else: - anims += [ - GrowFromCenter(brace), - Write(x_int) - ] - self.play(*anims) - # self.wait(.2) - - last_rect = rect - last_brace = brace - last_x_int = x_int - - x_int = last_x_int - y_brace = last_brace - self.y_brace_group=VGroup(y_brace,dy_brace,rect) - self.x_int=x_int - self.dy_label=dy_label - - - def bounded_riemann_rectangles( - self, - graph1, - graph2, - x_min=None, - x_max=None, - dx=0.01, - input_sample_type="center", - stroke_width=1, - stroke_color=BLACK, - fill_opacity=1, - start_color=None, - end_color=None, - show_signed_area=True, - width_scale_factor=1.001 - ): - x_min = x_min if x_min is not None else self.x_min - x_max = x_max if x_max is not None else self.x_max - if start_color is None: - start_color = self.default_riemann_start_color - if end_color is None: - end_color = self.default_riemann_end_color - rectangles = VGroup() - x_range = np.arange(x_min, x_max, dx) - colors = color_gradient([start_color, end_color], len(x_range)) - for x, color in zip(x_range, colors): - if input_sample_type == "left": - sample_input = x - elif input_sample_type == "right": - sample_input = x + dx - elif input_sample_type == "center": - sample_input = x + 0.5 * dx - else: - raise Exception("Invalid input sample type") - graph1_point = self.input_to_graph_point(sample_input, graph1) - graph1_point_dx= self.input_to_graph_point(sample_input + width_scale_factor * dx, graph1) - graph2_point = self.input_to_graph_point(sample_input, graph2) - - points = VGroup(*list(map(VectorizedPoint, [ - graph1_point, - graph1_point_dx, - graph2_point - ]))) - - rect = Rectangle() - rect.replace(points, stretch=True) - if graph1_point[1] < self.graph_origin[1] and show_signed_area: - fill_color = invert_color(color) - else: - fill_color = color - rect.set_fill(fill_color, opacity=fill_opacity) - rect.set_stroke(stroke_color, width=stroke_width) - rectangles.add(rect) - return rectangles - - def bounded_riemann_rectangles_y( - self, - graph1, - graph2, - y_min=None, - y_max=None, - dy=0.01, - input_sample_type="center", - stroke_width=1, - stroke_color=BLACK, - fill_opacity=1, - start_color=None, - end_color=None, - show_signed_area=True, - width_scale_factor=1.001 - ): - y_min = y_min if y_min is not None else self.y_min - y_max = y_max if y_max is not None else self.y_max - if start_color is None: - start_color = self.default_riemann_start_color - if end_color is None: - end_color = self.default_riemann_end_color - rectangles = VGroup() - y_range = np.arange(y_min, y_max, dy) - colors = color_gradient([start_color, end_color], len(y_range)) - for y, color in zip(y_range, colors): - if input_sample_type == "left": - sample_input = y - elif input_sample_type == "right": - sample_input = y + dy - elif input_sample_type == "center": - sample_input = y + 0.5 * dy - else: - raise Exception("Invalid input sample type") - graph1_point = self.coords_to_point( - graph1(sample_input),sample_input - ) - dy_input=sample_input + width_scale_factor * dy - graph1_point_dy= self.coords_to_point( - graph1(dy_input),dy_input - ) - graph2_point = self.coords_to_point( - graph2(sample_input),sample_input - ) - - points = VGroup(*list(map(VectorizedPoint, [ - graph1_point, - graph1_point_dy, - graph2_point - ]))) - - rect = Rectangle() - rect.replace(points, stretch=True) - if graph1_point[1] < self.graph_origin[1] and show_signed_area: - fill_color = invert_color(color) - else: - fill_color = color - rect.set_fill(fill_color, opacity=fill_opacity) - rect.set_stroke(stroke_color, width=stroke_width) - rectangles.add(rect) - return rectangles - - -#uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem -- cgit From 624869428ba1be7a499b837dfff9d26793fc1c3b Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 28 May 2020 11:19:24 +0530 Subject: update README --- .../integrals-of-multivariable-functions/README.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md index a321caf..02914ad 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md @@ -1 +1,6 @@ FSF2020--Somnath Pandit + +**Topics:** + +1. Double Integral +2. Fubini's Theorem -- cgit From c0fe39d398631f5b8bb251d9b22033a1f1c4a8dd Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 28 May 2020 11:47:13 +0530 Subject: Update README.md --- .../integrals-of-multivariable-functions/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md index 02914ad..58b9c1a 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md @@ -3,4 +3,21 @@ FSF2020--Somnath Pandit **Topics:** 1. Double Integral + +![file1_surface](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif?raw=true) + +![file2_area_under_func](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif?raw=true) + +![file3_y_limit_dependent_on_x](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals?raw=true/file3_y_limit_dependent_on_x.gif) + +![file4_non_rect_region](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif?raw=true) + +![file5_elementary_area](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif?raw=true) + 2. Fubini's Theorem + +![file1_surface1](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif?raw=true) + +![file2_surface2](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif?raw=true) + +![file3_iteration_methods](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif?raw=true) -- cgit From 848e6a16dc79e41b3242e934ec7df3954680a2ad Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 28 May 2020 11:48:47 +0530 Subject: Update README.md --- .../integrals-of-multivariable-functions/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md index 58b9c1a..c738f08 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md @@ -8,7 +8,7 @@ FSF2020--Somnath Pandit ![file2_area_under_func](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif?raw=true) -![file3_y_limit_dependent_on_x](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals?raw=true/file3_y_limit_dependent_on_x.gif) +![file3_y_limit_dependent_on_x](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif) ![file4_non_rect_region](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif?raw=true) -- cgit From 788ce8d1cc33eff2f2f543fcacceb5a80e79d7ea Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 28 May 2020 11:55:28 +0530 Subject: Update README.md --- .../integrals-of-multivariable-functions/README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md index c738f08..80ecad8 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md @@ -2,22 +2,30 @@ FSF2020--Somnath Pandit **Topics:** -1. Double Integral +# Double Integral +**file1_surface** ![file1_surface](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif?raw=true) +**file2_area_under_func** ![file2_area_under_func](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif?raw=true) +**file3_y_limit_dependent_on_x** ![file3_y_limit_dependent_on_x](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif) +**file4_non_rect_region** ![file4_non_rect_region](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif?raw=true) +**file5_elementary_area** ![file5_elementary_area](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif?raw=true) -2. Fubini's Theorem +# Fubini's Theorem +**file1_surface1** ![file1_surface1](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif?raw=true) +**file2_surface2** ![file2_surface2](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif?raw=true) +**file3_iteration_methods** ![file3_iteration_methods](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif?raw=true) -- cgit From 6f7c072b4e19fbdad05de3158b4d262417ded2c5 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 28 May 2020 11:58:49 +0530 Subject: Update README.md --- .../integrals-of-multivariable-functions/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md index 80ecad8..23e2423 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md @@ -5,27 +5,27 @@ FSF2020--Somnath Pandit # Double Integral **file1_surface** -![file1_surface](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif?raw=true) +![file1_surface](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif) **file2_area_under_func** -![file2_area_under_func](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif?raw=true) +![file2_area_under_func](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif) **file3_y_limit_dependent_on_x** ![file3_y_limit_dependent_on_x](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif) **file4_non_rect_region** -![file4_non_rect_region](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif?raw=true) +![file4_non_rect_region](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif) **file5_elementary_area** -![file5_elementary_area](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif?raw=true) +![file5_elementary_area](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif) # Fubini's Theorem **file1_surface1** -![file1_surface1](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif?raw=true) +![file1_surface1](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif) **file2_surface2** -![file2_surface2](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif?raw=true) +![file2_surface2](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif) **file3_iteration_methods** -![file3_iteration_methods](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif?raw=true) +![file3_iteration_methods](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif) -- cgit From a805f5b76f0a82a230acbc79f3dafce13e3b37be Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 28 May 2020 14:29:50 +0530 Subject: added curvy_region --- .../integrals-of-multivariable-functions/README.md | 5 + .../fubini's-theorem/file4_curvy_region.gif | Bin 0 -> 1282583 bytes .../fubini's-theorem/file4_curvy_region.py | 102 +++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md index 23e2423..0cd6968 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md @@ -29,3 +29,8 @@ FSF2020--Somnath Pandit **file3_iteration_methods** ![file3_iteration_methods](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif) + +**file4_curvy_limits** +![file4_curvy_limits](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.gif) + + diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.gif new file mode 100644 index 0000000..b0620e5 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.py new file mode 100644 index 0000000..46134a7 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.py @@ -0,0 +1,102 @@ +from manimlib.imports import * + +class CurvyRegion(GraphScene): + CONFIG = { + "x_min": 0, + "x_max": 8, + "y_min": 0, + "y_max": 6, + "graph_origin": ORIGIN+4.5*LEFT+3*DOWN, + "x_labeled_nums": np.arange(0, 9,2), + "y_labeled_nums": np.arange(0, 7,2), + "x_axis_width": 6, + "y_axis_height": 6, + } + + def construct(self): + XD = self.x_axis_width/(self.x_max- self.x_min) + YD = self.y_axis_height/(self.y_max- self.y_min) + self.X=XD*RIGHT ;self.Y=YD*UP + + sin_curve_points=[self.graph_origin+(2+.5*np.sin(2*y),y,0) + for y in np.arange(1,5,.005)] + + cos_curve_points=[self.graph_origin+( + 5+.5*np.cos(2*y),y,0) + for y in np.arange(1,5,.005)] + cos_curve_points.reverse() + + region=Polygon( + *sin_curve_points+cos_curve_points, + color=YELLOW, + stroke_width=1, + fill_color=BLUE_E, + fill_opacity=.75 + ) + + line=Line((1,0,0),(1,6,0),color=RED) + line.move_to(self.graph_origin+2.5*self.X,DOWN) + self.line=line + self.setup_axes(animate = False) + + self.add(region) + self.wait() + self.first_y_int_scene() + self.try_x_first_scene() + + + def first_y_int_scene(self): + talk=TextMobject(r"For doing the $y$ integration\\ first we need to set\\ proper $y$ limts").to_corner(UR,buff=LARGE_BUFF) + problem=TextMobject(r"But here we get\\ more than two $y$ values\\ for a single $x$ value" ).to_corner(UR,buff=LARGE_BUFF) + int_y=TextMobject("$$\\int_?^? dy$$").next_to(problem,DOWN,buff=.5) + + self.play(Write(talk)) + self.play(FadeIn(self.line)) + self.wait(2) + self.play(ReplacementTransform(talk,problem)) + self.play( + ApplyMethod(self.line.shift,3.7*self.X), + run_time=4 + ) + self.wait() + self.play(Write(int_y)) + self.wait(3) + self.play(FadeOut(VGroup(problem,int_y,self.line))) + + def try_x_first_scene(self): + try_text=TextMobject(r"But if we try to integrate\\ along $x$ first ...." ).to_corner(UR,buff=LARGE_BUFF) + good_limits=TextMobject(r"For one $y$ value we get\\ only \textbf{two} $x$ values $\dots$").to_corner(UR,buff=LARGE_BUFF) + limit_values= TextMobject(r"one Lower limit\\ one Upper limit ").next_to(good_limits,DOWN,buff=.5) + int_x=TextMobject("$$\\int_{f(y)}^{g(y)} dx$$").next_to(limit_values,DOWN) + + self.setup_line() + self.play(Write(try_text)) + self.play(FadeIn(self.line)) + self.wait() + self.play(ReplacementTransform(try_text,good_limits)) + self.wait() + self.play( + ApplyMethod(self.line.shift,3*self.Y), + run_time=4 + ) + self.play(Write(limit_values)) + self.wait() + self.show_functions() + self.play(Write(int_x)) + self.wait(3) + + def setup_line(self): + line=self.line.rotate(PI/2) + line.move_to(self.graph_origin+.5*self.X+1.5*self.Y,LEFT) + self.line=line + + def show_functions(self): + fy=TextMobject("$$f(y)$$") + gy=TextMobject("$$g(y)$$") + fy.move_to(self.graph_origin+2*self.X+3.3*self.Y) + gy.move_to(self.graph_origin+7*self.X+2*self.Y) + self.play(FadeIn(VGroup(fy,gy))) + + + #uploaded by Somnath Pandit.FSF2020_Fubini's_Theorem + -- cgit From a069621544a5e21857979af1a630e85c73f31ba7 Mon Sep 17 00:00:00 2001 From: Archit Sangal Date: Sun, 31 May 2020 06:35:41 +0530 Subject: gif(with code) added --- .../Column_Space.gif | Bin 0 -> 1182328 bytes .../The-Four-Fundamental-Subspaces/Column_Space.py | 30 +++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.gif create mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.py (limited to 'FSF-2020') diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.gif b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.gif new file mode 100644 index 0000000..7d8d2e1 Binary files /dev/null and b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.gif differ diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.py b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.py new file mode 100644 index 0000000..afe4f9a --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.py @@ -0,0 +1,30 @@ +from manimlib.imports import * + +class Column_Space(Scene): + def construct(self): + + A = TextMobject(r"$A = $",r"$\left( \begin{array}{c c c} 1 & 2 & 1 \\ 1 & 3 & 1 \\ 2 & 1 & 4 \\ 3 & 2 & 3 \end{array} \right)$") + A.move_to(2*UP) + A[1].set_color(color = DARK_BLUE) + A.scale(0.75) + + self.play(Write(A),run_time = 1) + + CS_A = TextMobject(r"Column Space of $A = x_{1}$",r"$\left( \begin{array}{c} 1 \\ 1 \\ 2 \\ 3 \end{array} \right)$",r"$+x_{2}$",r"$ \left( \begin{array}{c} 2 \\ 3 \\ 1 \\ 2 \end{array} \right)$",r"$ + x_{3}$",r"$\left( \begin{array}{c} 1 \\ 1 \\ 4 \\ 3 \end{array} \right)$") + CS_A.move_to(1.5*LEFT+1*DOWN) + CS_A[1].set_color(color = DARK_BLUE) + CS_A[3].set_color(color = DARK_BLUE) + CS_A[5].set_color(color = DARK_BLUE) + CS_A.scale(0.75) + + self.play(Write(CS_A),run_time = 2) + + arrow1 = Arrow(start = 1.25*UP,end = 0.25*DOWN+1.75*LEFT) + arrow2 = Arrow(start = 1.35*UP+0.5*RIGHT,end = 0.25*DOWN+0.5*RIGHT) + arrow3 = Arrow(start = 1.25*UP+0.75*RIGHT,end = 0.25*DOWN+2.9*RIGHT) + + Defn = TextMobject("Linear Combination of Columns of Matrix") + Defn.move_to(3*DOWN) + + self.play(Write(Defn), ShowCreation(arrow1), ShowCreation(arrow2), ShowCreation(arrow3),run_time = 1) + self.wait(1) \ No newline at end of file -- cgit From 774fda4a9da1a3a0f87ce8d365e206a7eff58551 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Sun, 31 May 2020 16:41:12 +0530 Subject: modification and new files --- .../file3_y_limit_dependent_on_x.gif | Bin 1170435 -> 1165354 bytes .../file3_y_limit_dependent_on_x.py | 2 +- .../double-integrals/file6_doing_integration.gif | Bin 0 -> 6661372 bytes .../double-integrals/file6_doing_integration.py | 332 +++++++++++++++++++++ .../file7_int_process_of_example.gif | Bin 0 -> 6100824 bytes .../file7_int_process_of_example.py | 328 ++++++++++++++++++++ .../fubini's-theorem/file3_iteration_methods.gif | Bin 1762897 -> 1813461 bytes .../fubini's-theorem/file3_iteration_methods.py | 13 +- 8 files changed, 668 insertions(+), 7 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif index a2bfd9d..dcfacb6 100644 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.py index 4894ebf..f755495 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.py +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.py @@ -29,7 +29,7 @@ class YlimitXdependent(GraphScene): line_eqn=TextMobject("2x+y=2").move_to(self.graph_origin+.8*X+Y).rotate(np.arctan(-2)) self.line=line - caption=TextMobject(r"See the value of $y$ \\ is changing with $x$").move_to(self.graph_origin+1.2*X+1.8*Y) + caption=TextMobject(r"The value of $y$ is\\ changing with $x$").move_to(self.graph_origin+1.2*X+1.8*Y) self.play(ShowCreation(line),Write(line_eqn)) # self.show_area() self.show_rects() diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.gif new file mode 100644 index 0000000..cafed44 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.py new file mode 100644 index 0000000..34d1769 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.py @@ -0,0 +1,332 @@ +from manimlib.imports import * + +class IntegrationProcess(SpecialThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": 0, + "x_max": 8, + "y_min": 0, + "y_max": 8, + "z_min": 0, + "z_max": 6, + "a":1 ,"b": 6, "c":2 , "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.cos(x) + } + + + def construct(self): + + self.setup_axes() + axes=self.axes + self.set_camera_orientation(distance=35, + phi=85 * DEGREES, + theta=-80 * DEGREES, + ) + + fn_text=TextMobject("$z=f(x,y)$").set_color(PINK) + self.add_fixed_in_frame_mobjects(fn_text) + fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) + + R=TextMobject("R").set_color(BLACK).scale(3) + R.move_to(axes.input_plane,IN) + self.add(R) + + #get the surface + surface= self.get_surface( + axes, lambda x , y: + self.Func(x,y) + ) + surface.set_style( + fill_opacity=0.75, + fill_color=PINK, + stroke_width=0.8, + stroke_color=WHITE, + ) + + slice_curve=(self.get_y_slice_graph( + axes,self.Func,5,color=YELLOW)) + + + self.begin_ambient_camera_rotation(rate=0.08) + # self.play(Write(surface)) + self.add(surface) + + self.get_lines() + + self.show_process(axes) + + self.wait(2) + + + + def show_process(self,axes): + y_tracker = ValueTracker(axes.c) + self.y_tracker=y_tracker + y=y_tracker.get_value + graph = always_redraw( + lambda: self.get_y_slice_graph( + axes, self.Func, y(), + stroke_color=YELLOW, + stroke_width=4, + ) + ) + graph.suspend_updating() + + + plane = always_redraw(lambda: Polygon( + *[ + axes.c2p(x,y(),self.Func(x,y())) + for x in np.arange(axes.a,axes.b,0.01) + ], + *[ + axes.c2p(x, y(), 0) + for x in [ axes.b, axes.a,] + ], + stroke_width=0, + fill_color=BLUE_E, + fill_opacity=.5, + )) + plane.suspend_updating() + + self.play(Write(VGroup(graph,plane)),run_time=4) + graph.resume_updating() + plane.resume_updating() + self.play( + ApplyMethod( + y_tracker.set_value, axes.d, + rate_func=linear, + run_time=6, + ) + ) + + + def get_y_slice_graph(self, axes, func, y, **kwargs): + config = dict() + config.update(self.default_graph_style) + config.update({ + "t_min": axes.a, + "t_max": axes.b, + }) + config.update(kwargs) + slice_curve=ParametricFunction( + lambda x: axes.c2p( + x, y, func(x, y) + ), + **config, + ) + return slice_curve + + '''def get_y_slice_plane(self, axes): + self.y_tracker=y_tracker + y=y_tracker.get_value() + curve_points=[ + axes.c2p(x,y,self.Func(x,y)) + for x in np.arange(axes.a,axes.b,0.01) + ] + base_points=[ + axes.c2p(x, y, 0) + for x in [ axes.b, axes.a,] + ] + plane_points= curve_points+base_points + plane = always_redraw(lambda: Polygon( + *plane_points, + stroke_width=.4, + fill_color=BLUE, + fill_opacity=0.2 + )) + plane.add_updater(lambda m: m.shift( + axes.c2p( + axes.a, + y_tracker.get_value(), + 1, + ) - plane.points[0] + )) + plane.y_tracker = y_tracker + + return plane ''' + + def get_surface(self,axes, func, **kwargs): + config = { + "u_min": axes.a, + "u_max": axes.b, + "v_min": axes.c, + "v_max": axes.d, + "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,"RED")) + + 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)) + self.add(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: 0 + ) + 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 + + + + #uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.gif new file mode 100644 index 0000000..d48656b Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.py new file mode 100644 index 0000000..ab9337d --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.py @@ -0,0 +1,328 @@ +from manimlib.imports import * + +class IntegrationProcess(SpecialThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": 0, + "x_max": 5, + "y_min": 0, + "y_max": 7, + "z_min": 0, + "z_max": 3, + "a":0 ,"b":4 , "c":0 , "d":6, + "axes_shift":1.5*IN+2*LEFT+4*DOWN, + "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*(1+(x+y)/10) + } + + + def construct(self): + + self.setup_axes() + axes=self.axes + self.set_camera_orientation(#distance=35, + phi=60 * DEGREES, + theta=10 * DEGREES, + ) + + fn_text=TextMobject("$z=(1+x+y)$").set_color(PINK) + self.add_fixed_in_frame_mobjects(fn_text) + fn_text.to_edge(TOP,buff=.1) + self.fn_text=fn_text + + R=TextMobject("R").set_color(BLACK).scale(3).rotate(PI/2) + R.move_to(axes.input_plane,IN) + self.add(R) + + #get the surface + surface= self.get_surface( + axes, lambda x , y: + self.Func(x,y) + ) + surface.set_style( + fill_opacity=0.75, + fill_color=PINK, + stroke_width=0.8, + stroke_color=WHITE, + ) + + slice_curve=(self.get_y_slice_graph( + axes,self.Func,5,color=YELLOW)) + + + self.begin_ambient_camera_rotation(rate=0.04) + # self.play(Write(surface)) + self.add(surface) + + self.get_lines() + + self.show_process(axes) + + self.wait() + + + + def show_process(self,axes): + y_tracker = ValueTracker(axes.c) + self.y_tracker=y_tracker + y=y_tracker.get_value + graph = always_redraw( + lambda: self.get_y_slice_graph( + axes, self.Func, y(), + stroke_color=YELLOW, + stroke_width=4, + ) + ) + graph.suspend_updating() + + plane = always_redraw(lambda: Polygon( + *[ + axes.c2p(x,y(),self.Func(x,y())) + for x in np.arange(axes.a,axes.b,0.01) + ], + *[ + axes.c2p(x, y(), 0) + for x in [ axes.b, axes.a,] + ], + stroke_width=0, + fill_color=BLUE_E, + fill_opacity=.65, + )) + plane.suspend_updating() + + first_x_text=TextMobject("First the $x$ integration..",color=YELLOW) + first_x_text.to_corner(UR,buff=1.1) + + x_func=TextMobject("$\\frac 3 2 + y$",color=BLUE) + '''x_func.next_to(self.fn_text,DOWN) + x_func.align_to(self.fn_text,LEFT)''' + x_func.to_edge(LEFT,buff=1) + + then_y_text=TextMobject("Then the $y$ integration..",color=YELLOW) + then_y_text.to_corner(UR,buff=1.1) + + self.add_fixed_in_frame_mobjects(first_x_text) + self.play(Write(first_x_text)) + self.add_fixed_in_frame_mobjects(x_func) + self.play( + Write(VGroup(graph,plane,x_func)), + run_time=3 + ) + + self.wait() + self.remove(first_x_text) + self.add_fixed_in_frame_mobjects(then_y_text) + self.play(Write(then_y_text)) + graph.resume_updating() + plane.resume_updating() + self.play( + ApplyMethod( + y_tracker.set_value, axes.d, + rate_func=linear, + run_time=6, + ) + ) + + + def get_y_slice_graph(self, axes, func, y, **kwargs): + config = dict() + config.update(self.default_graph_style) + config.update({ + "t_min": axes.a, + "t_max": axes.b, + }) + config.update(kwargs) + slice_curve=ParametricFunction( + lambda x: axes.c2p( + x, y, func(x, y) + ), + **config, + ) + return slice_curve + + + def get_surface(self,axes, func, **kwargs): + config = { + "u_min": axes.a, + "u_max": axes.b, + "v_min": axes.c, + "v_max": axes.d, + "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,"RED")) + + 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)) + self.add(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 + + + #customize 3D axes + 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, LEFT, + 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: 0 + ) + input_plane.set_style( + fill_opacity=0.3, + fill_color=TEAL, + stroke_width=.2, + 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 = [ + + ("1", axes.b), + ] + tex_vals_y=[ + + ("2", 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) + label.rotate(180 * DEGREES) + 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) + 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, LEFT) + z_label.next_to(axes.z_axis.get_zenith(), LEFT) + axes.z_axis.label = z_label + for axis in axes: + axis.add(axis.label) + return axes + + + + #uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif index e73dd8e..4e1611b 100644 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py index 662242a..ad78a0b 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.py @@ -63,15 +63,13 @@ class IterationMethods(GraphScene): ).align_to( caption_limit,LEFT ) - + self.int_lim=int_lim self.play(ShowCreation(VGroup(curve1,curve2)),Write(VGroup(c2_eqn,c1_eqn))) self.play(Write(caption_limit)) self.get_rects() self.show_integral_values_at_different_x() self.wait(1) - self.add(int_lim) - self.integral_setup(int_lim,first_y=True) @@ -105,8 +103,9 @@ class IterationMethods(GraphScene): int_lim_y=int_lim.copy() int_lim_y.next_to(int_lim,DOWN) + self.int_lim_y=int_lim_y equal=TextMobject("$$=$$").next_to(int_lim_y,LEFT) - self.add(equal,int_lim_y) + self.add(equal) self.integral_setup(int_lim_y,first_y=False) @@ -139,7 +138,8 @@ class IterationMethods(GraphScene): self.play(ApplyMethod( self.dx_label.next_to, self.y_int,RIGHT), - ShowCreation(area),run_time=4 + ShowCreation(area), + Write(self.int_lim),run_time=4 ) else: area=self.get_area(base_y=True) @@ -155,7 +155,8 @@ class IterationMethods(GraphScene): self.play(ApplyMethod( self.dy_label.next_to, self.x_int,RIGHT), - ShowCreation(area),run_time=4 + ShowCreation(area), + Write(self.int_lim_y),run_time=4 ) def get_area(self,base_y=False): -- cgit From 5c7407ce38cc135e6f72d4bd690c8739bd619511 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Sun, 31 May 2020 16:54:10 +0530 Subject: Update README.md --- .../integrals-of-multivariable-functions/README.md | 29 +--------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md index 0cd6968..25eb3c8 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md @@ -4,33 +4,6 @@ FSF2020--Somnath Pandit # Double Integral -**file1_surface** -![file1_surface](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif) - -**file2_area_under_func** -![file2_area_under_func](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif) - -**file3_y_limit_dependent_on_x** -![file3_y_limit_dependent_on_x](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif) - -**file4_non_rect_region** -![file4_non_rect_region](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif) - -**file5_elementary_area** -![file5_elementary_area](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif) - # Fubini's Theorem -**file1_surface1** -![file1_surface1](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif) - -**file2_surface2** -![file2_surface2](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif) - -**file3_iteration_methods** -![file3_iteration_methods](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif) - -**file4_curvy_limits** -![file4_curvy_limits](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.gif) - - +# Line Integrals -- cgit From 7540f66931aa7fe35a432af5ccda59f7269b0c04 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Sun, 31 May 2020 16:55:22 +0530 Subject: Create Animations.md --- .../fubini's-theorem/Animations.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/Animations.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/Animations.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/Animations.md new file mode 100644 index 0000000..c1c6e8e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/Animations.md @@ -0,0 +1,14 @@ + +**file1_surface1** +![file1_surface1](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif) + +**file2_surface2** +![file2_surface2](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif) + +**file3_iteration_methods** +![file3_iteration_methods](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif) + +**file4_curvy_limits** +![file4_curvy_limits](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.gif) + + -- cgit From 9d057283b06096be29f468dba9618828ccd14925 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Sun, 31 May 2020 16:56:45 +0530 Subject: Rename Animations.md to README.md --- .../fubini's-theorem/Animations.md | 14 -------------- .../fubini's-theorem/README.md | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/Animations.md create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/Animations.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/Animations.md deleted file mode 100644 index c1c6e8e..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/Animations.md +++ /dev/null @@ -1,14 +0,0 @@ - -**file1_surface1** -![file1_surface1](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif) - -**file2_surface2** -![file2_surface2](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif) - -**file3_iteration_methods** -![file3_iteration_methods](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif) - -**file4_curvy_limits** -![file4_curvy_limits](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.gif) - - diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/README.md new file mode 100644 index 0000000..c1c6e8e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/README.md @@ -0,0 +1,14 @@ + +**file1_surface1** +![file1_surface1](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file1_surface1.gif) + +**file2_surface2** +![file2_surface2](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file2_surface2.gif) + +**file3_iteration_methods** +![file3_iteration_methods](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file3_iteration_methods.gif) + +**file4_curvy_limits** +![file4_curvy_limits](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fubini's-theorem/file4_curvy_region.gif) + + -- cgit From 5baeb584839361cd7b5c0eadbe15edbfb0e84a00 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Sun, 31 May 2020 17:04:19 +0530 Subject: Update README.md --- .../integrals-of-multivariable-functions/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md index 25eb3c8..221e78d 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md @@ -1,9 +1,9 @@ FSF2020--Somnath Pandit -**Topics:** +# **Topics:** -# Double Integral +## Double Integral -# Fubini's Theorem +## Fubini's Theorem -# Line Integrals +## Line Integrals -- cgit From 3ed5bc5ee874d84982c443d3cbde0828f124de2c Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Sun, 31 May 2020 17:10:21 +0530 Subject: Create README.md --- .../double-integrals/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/README.md new file mode 100644 index 0000000..fe4d73a --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/README.md @@ -0,0 +1,21 @@ +**file1_surface** +![file1_surface](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif) + +**file2_area_under_func** +![file2_area_under_func](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif) + +**file3_y_limit_dependent_on_x** +![file3_y_limit_dependent_on_x](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif) + +**file4_non_rect_region** +![file4_non_rect_region](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file4_non_rect_region.gif) + +**file5_elementary_area** +![file5_elementary_area](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file5_elementary_area.gif) + +**file6_doing_integration** +![file6_doing_integration](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.gif) + +**file7_int_process_of_example** +![file7_int_process_of_example](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.gif) + -- cgit From 29f26bf517b4cd42e75d41d2bdf3e77f0b04a514 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Tue, 2 Jun 2020 23:07:03 +0530 Subject: Scalar func sum method --- .../line-integral/file1_scalar_line_int_as_sum.gif | Bin 0 -> 1051018 bytes .../line-integral/file1_scalar_line_int_as_sum.py | 227 +++++++++++++++++++++ 2 files changed, 227 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.gif new file mode 100644 index 0000000..1984b08 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.py new file mode 100644 index 0000000..e3f3574 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.py @@ -0,0 +1,227 @@ +from manimlib.imports import * + + +class LineIntegrationAsSum(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 10, + "y_min" : 0, + "y_max" : 6, + "graph_origin": ORIGIN+5*LEFT+3*DOWN, + "x_axis_width": 10, + "y_axis_height": 6 , + "x_tick_frequency": 2, + "y_tick_frequency": 2, + "Func":lambda x : 1+x**1.3*np.exp(-.12*(x-2)**2)*np.sin(x/4), + "a": 1 ,"b": 9, "n": 15, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + self.X=X ;self.Y=Y + + self.setup_axes(animate=False) + + curve=self.get_graph( + self.Func, + x_min=self.a, + x_max=self.b, + ) + curve.set_color([BLACK,BLUE,BLUE,BLUE,BLACK]) + curve_label= self.get_graph_label( + curve, + label="\\text{path of intgration}", + x_val=4, + direction=UR, + buff=.6, + color=BLUE + ) + self.curve=curve + self.curve_label=curve_label + + self.play(ShowCreation(VGroup(curve,curve_label))) + self.wait(.6) + self.break_in_arcs() + self.show_the_sum() + self.construct_equation() + self.wait(2) + + + + def break_in_arcs(self): + + self.write_about_breaking() + + dl=0.8 + self.get_breakers(dl) + self.wait(2) + self.play(FadeOut(self.upto_break_text)) + self.dl=dl + + def write_about_breaking(self): + breaking_text=TextMobject("\\texttt{..broken}"," into small", "subarcs") + breaking_text.set_color_by_tex_to_color_map({ + "broken":RED,"subarcs": BLUE + }) + breaking_text.next_to(self.curve_label,DOWN) + breaking_text.align_to(self.curve_label,LEFT) + self.play( + Write(breaking_text) + ) + + self.upto_break_text=VGroup( + self.curve_label, + breaking_text, + ) + + def get_breakers(self,dl): + point=self.a + points=[] + while point<(self.b-dl) : + start=point + end=point+dl + points += [end] + breaker=Line( + self.input_to_graph_point(start,self.curve), + self.input_to_graph_point(end,self.curve), + stroke_width=2, + color=RED, + ) + breaker.rotate(PI/2).scale(.5) + + point=end + self.play(FadeIn(breaker),run_time=.2) + # self.add(breaker) + + del points[-1] + self.points=points + + + def show_the_sum(self): + at_any_points_text=TextMobject("At any ","point", "in each ", "subarc") + at_any_points_text.set_color_by_tex_to_color_map({ + "point":YELLOW , "subarc": BLUE + }) + at_any_points_text.to_edge(TOP,buff=SMALL_BUFF) + + evaluate_text=TextMobject("$f(x,y)$ ", "is evaluated").next_to(at_any_points_text,DOWN) + evaluate_text.set_color_by_tex("$f(x,y)$",ORANGE) + + self.at_any_points_text=at_any_points_text + self.evaluate_text=evaluate_text + + + dots=[] + for point in self.points: + + dot=Dot( + point=self.input_to_graph_point(point,self.curve), + radius= .7*DEFAULT_DOT_RADIUS, + stroke_width= 0, + fill_opacity= 1.0, + color= YELLOW, + ) + dots+=[dot] + + self.play( + Write(at_any_points_text), + FadeIn(VGroup(*dots)),run_time=1.5 + ) + self.wait() + self.position_of_point_irrelevent() + self.multiply_with_function(dots) + + + + def multiply_with_function(self,dots): + index=-(len(self.points)//3) + dot=dots[index] + + + multiply_text=TexMobject("f(x_i,y_i)", "\\text{ is multiplied with }","\\Delta s_i") + multiply_text.set_color_by_tex_to_color_map({ + "f(x_i,y_i)":ORANGE , "\\Delta s_i": BLUE + }) + multiply_text.to_edge(TOP,buff=MED_SMALL_BUFF) + + point_coord=TextMobject("$(x_i,y_i)$",color=YELLOW) + point_coord.next_to(dot,DL,buff=.01).scale(.8) + + func_val=TextMobject("$f(x_i,y_i)$",color=ORANGE) + func_val.next_to(dot,UR) + + sum_up_text=TextMobject("and "," summed ", "for all i' s") + sum_up_text.set_color_by_tex("summed",PURPLE) + sum_up_text.next_to(multiply_text,DOWN) + + dot.set_color(ORANGE).scale(1.2) + + self.play(FadeIn(VGroup( + point_coord,dot + ))) + self.play(Write(self.evaluate_text)) + self.play(Write(func_val)) + self.play(FadeIn(VGroup(*[ + dot.set_color(ORANGE).scale(1.4) + for dot in dots ] + ))) + self.wait(2) + self.remove(point_coord) + self.get_ds(dots,index) + self.play(GrowFromCenter(self.ds_brace_group)) + self.wait(2) + self.play(FadeOut(VGroup( + self.ds_brace, + self.at_any_points_text, + self.evaluate_text + ))) + self.play(Write(multiply_text)) + self.play(ApplyMethod( + self.ds_brace_label.next_to, + func_val, RIGHT,buff=.2 + )) + self.play(Write(sum_up_text)) + + self.func_val=func_val + self.sum_text_group=VGroup(multiply_text,sum_up_text) + + def position_of_point_irrelevent(self): + pass + + + + def get_ds(self,dots,index): + p1= dots[index] + p2= dots[index+1] + ds_brace=Brace(VGroup(p1,p2),DL) + ds_brace.move_to(p1,UR) + ds_brace_label=ds_brace.get_text("$\Delta s_i$", buff = .05) + ds_brace_label.set_color(BLUE) + self.ds_brace=ds_brace + self.ds_brace_label=ds_brace_label + self.ds_brace_group=VGroup(ds_brace,ds_brace_label) + + + def construct_equation(self): + sum_eqn=TextMobject("$$\\sum_i^{ } $$").set_color(PURPLE) + sum_eqn.move_to(self.graph_origin+7*self.X+4*self.Y) + + line_integral_text=TextMobject("The Value of the line integral is").next_to(self.sum_text_group,IN) + approx=TextMobject("$\\approx$",color=RED).next_to(sum_eqn,LEFT) + multipled=VGroup(self.func_val,self.ds_brace_label) + self.play(FadeIn(sum_eqn)) + self.play(ApplyMethod( + multipled.next_to,sum_eqn,RIGHT + )) + self.wait() + self.play(FadeOut(self.sum_text_group)) + self.play(Write(line_integral_text)) + self.play(FadeIn(approx)) + + + +#uploaded by Somnath Pandit.FSF2020_Line Integrals + + + -- cgit From e531d1c5a95d57266de08d098bfea7bc4dde3fd7 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Tue, 2 Jun 2020 23:11:09 +0530 Subject: Update folder name and README --- .../line-integral/file1_scalar_line_int_as_sum.gif | Bin 1051018 -> 0 bytes .../line-integral/file1_scalar_line_int_as_sum.py | 227 --------------------- .../line-integrals/README.md | 11 + .../file1_scalar_line_int_as_sum.gif | Bin 0 -> 1051018 bytes .../line-integrals/file1_scalar_line_int_as_sum.py | 227 +++++++++++++++++++++ 5 files changed, 238 insertions(+), 227 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.gif deleted file mode 100644 index 1984b08..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.py deleted file mode 100644 index e3f3574..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integral/file1_scalar_line_int_as_sum.py +++ /dev/null @@ -1,227 +0,0 @@ -from manimlib.imports import * - - -class LineIntegrationAsSum(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 10, - "y_min" : 0, - "y_max" : 6, - "graph_origin": ORIGIN+5*LEFT+3*DOWN, - "x_axis_width": 10, - "y_axis_height": 6 , - "x_tick_frequency": 2, - "y_tick_frequency": 2, - "Func":lambda x : 1+x**1.3*np.exp(-.12*(x-2)**2)*np.sin(x/4), - "a": 1 ,"b": 9, "n": 15, - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - self.X=X ;self.Y=Y - - self.setup_axes(animate=False) - - curve=self.get_graph( - self.Func, - x_min=self.a, - x_max=self.b, - ) - curve.set_color([BLACK,BLUE,BLUE,BLUE,BLACK]) - curve_label= self.get_graph_label( - curve, - label="\\text{path of intgration}", - x_val=4, - direction=UR, - buff=.6, - color=BLUE - ) - self.curve=curve - self.curve_label=curve_label - - self.play(ShowCreation(VGroup(curve,curve_label))) - self.wait(.6) - self.break_in_arcs() - self.show_the_sum() - self.construct_equation() - self.wait(2) - - - - def break_in_arcs(self): - - self.write_about_breaking() - - dl=0.8 - self.get_breakers(dl) - self.wait(2) - self.play(FadeOut(self.upto_break_text)) - self.dl=dl - - def write_about_breaking(self): - breaking_text=TextMobject("\\texttt{..broken}"," into small", "subarcs") - breaking_text.set_color_by_tex_to_color_map({ - "broken":RED,"subarcs": BLUE - }) - breaking_text.next_to(self.curve_label,DOWN) - breaking_text.align_to(self.curve_label,LEFT) - self.play( - Write(breaking_text) - ) - - self.upto_break_text=VGroup( - self.curve_label, - breaking_text, - ) - - def get_breakers(self,dl): - point=self.a - points=[] - while point<(self.b-dl) : - start=point - end=point+dl - points += [end] - breaker=Line( - self.input_to_graph_point(start,self.curve), - self.input_to_graph_point(end,self.curve), - stroke_width=2, - color=RED, - ) - breaker.rotate(PI/2).scale(.5) - - point=end - self.play(FadeIn(breaker),run_time=.2) - # self.add(breaker) - - del points[-1] - self.points=points - - - def show_the_sum(self): - at_any_points_text=TextMobject("At any ","point", "in each ", "subarc") - at_any_points_text.set_color_by_tex_to_color_map({ - "point":YELLOW , "subarc": BLUE - }) - at_any_points_text.to_edge(TOP,buff=SMALL_BUFF) - - evaluate_text=TextMobject("$f(x,y)$ ", "is evaluated").next_to(at_any_points_text,DOWN) - evaluate_text.set_color_by_tex("$f(x,y)$",ORANGE) - - self.at_any_points_text=at_any_points_text - self.evaluate_text=evaluate_text - - - dots=[] - for point in self.points: - - dot=Dot( - point=self.input_to_graph_point(point,self.curve), - radius= .7*DEFAULT_DOT_RADIUS, - stroke_width= 0, - fill_opacity= 1.0, - color= YELLOW, - ) - dots+=[dot] - - self.play( - Write(at_any_points_text), - FadeIn(VGroup(*dots)),run_time=1.5 - ) - self.wait() - self.position_of_point_irrelevent() - self.multiply_with_function(dots) - - - - def multiply_with_function(self,dots): - index=-(len(self.points)//3) - dot=dots[index] - - - multiply_text=TexMobject("f(x_i,y_i)", "\\text{ is multiplied with }","\\Delta s_i") - multiply_text.set_color_by_tex_to_color_map({ - "f(x_i,y_i)":ORANGE , "\\Delta s_i": BLUE - }) - multiply_text.to_edge(TOP,buff=MED_SMALL_BUFF) - - point_coord=TextMobject("$(x_i,y_i)$",color=YELLOW) - point_coord.next_to(dot,DL,buff=.01).scale(.8) - - func_val=TextMobject("$f(x_i,y_i)$",color=ORANGE) - func_val.next_to(dot,UR) - - sum_up_text=TextMobject("and "," summed ", "for all i' s") - sum_up_text.set_color_by_tex("summed",PURPLE) - sum_up_text.next_to(multiply_text,DOWN) - - dot.set_color(ORANGE).scale(1.2) - - self.play(FadeIn(VGroup( - point_coord,dot - ))) - self.play(Write(self.evaluate_text)) - self.play(Write(func_val)) - self.play(FadeIn(VGroup(*[ - dot.set_color(ORANGE).scale(1.4) - for dot in dots ] - ))) - self.wait(2) - self.remove(point_coord) - self.get_ds(dots,index) - self.play(GrowFromCenter(self.ds_brace_group)) - self.wait(2) - self.play(FadeOut(VGroup( - self.ds_brace, - self.at_any_points_text, - self.evaluate_text - ))) - self.play(Write(multiply_text)) - self.play(ApplyMethod( - self.ds_brace_label.next_to, - func_val, RIGHT,buff=.2 - )) - self.play(Write(sum_up_text)) - - self.func_val=func_val - self.sum_text_group=VGroup(multiply_text,sum_up_text) - - def position_of_point_irrelevent(self): - pass - - - - def get_ds(self,dots,index): - p1= dots[index] - p2= dots[index+1] - ds_brace=Brace(VGroup(p1,p2),DL) - ds_brace.move_to(p1,UR) - ds_brace_label=ds_brace.get_text("$\Delta s_i$", buff = .05) - ds_brace_label.set_color(BLUE) - self.ds_brace=ds_brace - self.ds_brace_label=ds_brace_label - self.ds_brace_group=VGroup(ds_brace,ds_brace_label) - - - def construct_equation(self): - sum_eqn=TextMobject("$$\\sum_i^{ } $$").set_color(PURPLE) - sum_eqn.move_to(self.graph_origin+7*self.X+4*self.Y) - - line_integral_text=TextMobject("The Value of the line integral is").next_to(self.sum_text_group,IN) - approx=TextMobject("$\\approx$",color=RED).next_to(sum_eqn,LEFT) - multipled=VGroup(self.func_val,self.ds_brace_label) - self.play(FadeIn(sum_eqn)) - self.play(ApplyMethod( - multipled.next_to,sum_eqn,RIGHT - )) - self.wait() - self.play(FadeOut(self.sum_text_group)) - self.play(Write(line_integral_text)) - self.play(FadeIn(approx)) - - - -#uploaded by Somnath Pandit.FSF2020_Line Integrals - - - diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md new file mode 100644 index 0000000..b96c308 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md @@ -0,0 +1,11 @@ +** +![]() + +** +![]() + +** +![]() + +** +![]() diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.gif new file mode 100644 index 0000000..1984b08 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.py new file mode 100644 index 0000000..e3f3574 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.py @@ -0,0 +1,227 @@ +from manimlib.imports import * + + +class LineIntegrationAsSum(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 10, + "y_min" : 0, + "y_max" : 6, + "graph_origin": ORIGIN+5*LEFT+3*DOWN, + "x_axis_width": 10, + "y_axis_height": 6 , + "x_tick_frequency": 2, + "y_tick_frequency": 2, + "Func":lambda x : 1+x**1.3*np.exp(-.12*(x-2)**2)*np.sin(x/4), + "a": 1 ,"b": 9, "n": 15, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + self.X=X ;self.Y=Y + + self.setup_axes(animate=False) + + curve=self.get_graph( + self.Func, + x_min=self.a, + x_max=self.b, + ) + curve.set_color([BLACK,BLUE,BLUE,BLUE,BLACK]) + curve_label= self.get_graph_label( + curve, + label="\\text{path of intgration}", + x_val=4, + direction=UR, + buff=.6, + color=BLUE + ) + self.curve=curve + self.curve_label=curve_label + + self.play(ShowCreation(VGroup(curve,curve_label))) + self.wait(.6) + self.break_in_arcs() + self.show_the_sum() + self.construct_equation() + self.wait(2) + + + + def break_in_arcs(self): + + self.write_about_breaking() + + dl=0.8 + self.get_breakers(dl) + self.wait(2) + self.play(FadeOut(self.upto_break_text)) + self.dl=dl + + def write_about_breaking(self): + breaking_text=TextMobject("\\texttt{..broken}"," into small", "subarcs") + breaking_text.set_color_by_tex_to_color_map({ + "broken":RED,"subarcs": BLUE + }) + breaking_text.next_to(self.curve_label,DOWN) + breaking_text.align_to(self.curve_label,LEFT) + self.play( + Write(breaking_text) + ) + + self.upto_break_text=VGroup( + self.curve_label, + breaking_text, + ) + + def get_breakers(self,dl): + point=self.a + points=[] + while point<(self.b-dl) : + start=point + end=point+dl + points += [end] + breaker=Line( + self.input_to_graph_point(start,self.curve), + self.input_to_graph_point(end,self.curve), + stroke_width=2, + color=RED, + ) + breaker.rotate(PI/2).scale(.5) + + point=end + self.play(FadeIn(breaker),run_time=.2) + # self.add(breaker) + + del points[-1] + self.points=points + + + def show_the_sum(self): + at_any_points_text=TextMobject("At any ","point", "in each ", "subarc") + at_any_points_text.set_color_by_tex_to_color_map({ + "point":YELLOW , "subarc": BLUE + }) + at_any_points_text.to_edge(TOP,buff=SMALL_BUFF) + + evaluate_text=TextMobject("$f(x,y)$ ", "is evaluated").next_to(at_any_points_text,DOWN) + evaluate_text.set_color_by_tex("$f(x,y)$",ORANGE) + + self.at_any_points_text=at_any_points_text + self.evaluate_text=evaluate_text + + + dots=[] + for point in self.points: + + dot=Dot( + point=self.input_to_graph_point(point,self.curve), + radius= .7*DEFAULT_DOT_RADIUS, + stroke_width= 0, + fill_opacity= 1.0, + color= YELLOW, + ) + dots+=[dot] + + self.play( + Write(at_any_points_text), + FadeIn(VGroup(*dots)),run_time=1.5 + ) + self.wait() + self.position_of_point_irrelevent() + self.multiply_with_function(dots) + + + + def multiply_with_function(self,dots): + index=-(len(self.points)//3) + dot=dots[index] + + + multiply_text=TexMobject("f(x_i,y_i)", "\\text{ is multiplied with }","\\Delta s_i") + multiply_text.set_color_by_tex_to_color_map({ + "f(x_i,y_i)":ORANGE , "\\Delta s_i": BLUE + }) + multiply_text.to_edge(TOP,buff=MED_SMALL_BUFF) + + point_coord=TextMobject("$(x_i,y_i)$",color=YELLOW) + point_coord.next_to(dot,DL,buff=.01).scale(.8) + + func_val=TextMobject("$f(x_i,y_i)$",color=ORANGE) + func_val.next_to(dot,UR) + + sum_up_text=TextMobject("and "," summed ", "for all i' s") + sum_up_text.set_color_by_tex("summed",PURPLE) + sum_up_text.next_to(multiply_text,DOWN) + + dot.set_color(ORANGE).scale(1.2) + + self.play(FadeIn(VGroup( + point_coord,dot + ))) + self.play(Write(self.evaluate_text)) + self.play(Write(func_val)) + self.play(FadeIn(VGroup(*[ + dot.set_color(ORANGE).scale(1.4) + for dot in dots ] + ))) + self.wait(2) + self.remove(point_coord) + self.get_ds(dots,index) + self.play(GrowFromCenter(self.ds_brace_group)) + self.wait(2) + self.play(FadeOut(VGroup( + self.ds_brace, + self.at_any_points_text, + self.evaluate_text + ))) + self.play(Write(multiply_text)) + self.play(ApplyMethod( + self.ds_brace_label.next_to, + func_val, RIGHT,buff=.2 + )) + self.play(Write(sum_up_text)) + + self.func_val=func_val + self.sum_text_group=VGroup(multiply_text,sum_up_text) + + def position_of_point_irrelevent(self): + pass + + + + def get_ds(self,dots,index): + p1= dots[index] + p2= dots[index+1] + ds_brace=Brace(VGroup(p1,p2),DL) + ds_brace.move_to(p1,UR) + ds_brace_label=ds_brace.get_text("$\Delta s_i$", buff = .05) + ds_brace_label.set_color(BLUE) + self.ds_brace=ds_brace + self.ds_brace_label=ds_brace_label + self.ds_brace_group=VGroup(ds_brace,ds_brace_label) + + + def construct_equation(self): + sum_eqn=TextMobject("$$\\sum_i^{ } $$").set_color(PURPLE) + sum_eqn.move_to(self.graph_origin+7*self.X+4*self.Y) + + line_integral_text=TextMobject("The Value of the line integral is").next_to(self.sum_text_group,IN) + approx=TextMobject("$\\approx$",color=RED).next_to(sum_eqn,LEFT) + multipled=VGroup(self.func_val,self.ds_brace_label) + self.play(FadeIn(sum_eqn)) + self.play(ApplyMethod( + multipled.next_to,sum_eqn,RIGHT + )) + self.wait() + self.play(FadeOut(self.sum_text_group)) + self.play(Write(line_integral_text)) + self.play(FadeIn(approx)) + + + +#uploaded by Somnath Pandit.FSF2020_Line Integrals + + + -- cgit From a3318e22d7f309ec3955ad4f2c53f31797484fc1 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Tue, 2 Jun 2020 23:15:54 +0530 Subject: update README --- .../integrals-of-multivariable-functions/line-integrals/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md index b96c308..b7e1846 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md @@ -1,5 +1,5 @@ -** -![]() +**file1_scalar_line_int_as_sum** +![file1_scalar_line_int_as_sum](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.gif) ** ![]() -- cgit From b9a88691d72bab96e46fd26650308d05904c0b1d Mon Sep 17 00:00:00 2001 From: Archit Sangal Date: Wed, 3 Jun 2020 10:10:02 +0530 Subject: gif 1 and video 1 for lecture 2 --- .../Column_Space.gif | Bin 1182328 -> 0 bytes .../The-Four-Fundamental-Subspaces/Column_Space.py | 30 ----- .../file1_Column_Space.gif | Bin 0 -> 1182328 bytes .../file1_Column_Space.py | 30 +++++ .../file2_Row_Space.py | 145 +++++++++++++++++++++ 5 files changed, 175 insertions(+), 30 deletions(-) delete mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.gif delete mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file1_Column_Space.gif create mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file1_Column_Space.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file2_Row_Space.py (limited to 'FSF-2020') diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.gif b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.gif deleted file mode 100644 index 7d8d2e1..0000000 Binary files a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.gif and /dev/null differ diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.py b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.py deleted file mode 100644 index afe4f9a..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Column_Space.py +++ /dev/null @@ -1,30 +0,0 @@ -from manimlib.imports import * - -class Column_Space(Scene): - def construct(self): - - A = TextMobject(r"$A = $",r"$\left( \begin{array}{c c c} 1 & 2 & 1 \\ 1 & 3 & 1 \\ 2 & 1 & 4 \\ 3 & 2 & 3 \end{array} \right)$") - A.move_to(2*UP) - A[1].set_color(color = DARK_BLUE) - A.scale(0.75) - - self.play(Write(A),run_time = 1) - - CS_A = TextMobject(r"Column Space of $A = x_{1}$",r"$\left( \begin{array}{c} 1 \\ 1 \\ 2 \\ 3 \end{array} \right)$",r"$+x_{2}$",r"$ \left( \begin{array}{c} 2 \\ 3 \\ 1 \\ 2 \end{array} \right)$",r"$ + x_{3}$",r"$\left( \begin{array}{c} 1 \\ 1 \\ 4 \\ 3 \end{array} \right)$") - CS_A.move_to(1.5*LEFT+1*DOWN) - CS_A[1].set_color(color = DARK_BLUE) - CS_A[3].set_color(color = DARK_BLUE) - CS_A[5].set_color(color = DARK_BLUE) - CS_A.scale(0.75) - - self.play(Write(CS_A),run_time = 2) - - arrow1 = Arrow(start = 1.25*UP,end = 0.25*DOWN+1.75*LEFT) - arrow2 = Arrow(start = 1.35*UP+0.5*RIGHT,end = 0.25*DOWN+0.5*RIGHT) - arrow3 = Arrow(start = 1.25*UP+0.75*RIGHT,end = 0.25*DOWN+2.9*RIGHT) - - Defn = TextMobject("Linear Combination of Columns of Matrix") - Defn.move_to(3*DOWN) - - self.play(Write(Defn), ShowCreation(arrow1), ShowCreation(arrow2), ShowCreation(arrow3),run_time = 1) - self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file1_Column_Space.gif b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file1_Column_Space.gif new file mode 100644 index 0000000..7d8d2e1 Binary files /dev/null and b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file1_Column_Space.gif differ diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file1_Column_Space.py b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file1_Column_Space.py new file mode 100644 index 0000000..afe4f9a --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file1_Column_Space.py @@ -0,0 +1,30 @@ +from manimlib.imports import * + +class Column_Space(Scene): + def construct(self): + + A = TextMobject(r"$A = $",r"$\left( \begin{array}{c c c} 1 & 2 & 1 \\ 1 & 3 & 1 \\ 2 & 1 & 4 \\ 3 & 2 & 3 \end{array} \right)$") + A.move_to(2*UP) + A[1].set_color(color = DARK_BLUE) + A.scale(0.75) + + self.play(Write(A),run_time = 1) + + CS_A = TextMobject(r"Column Space of $A = x_{1}$",r"$\left( \begin{array}{c} 1 \\ 1 \\ 2 \\ 3 \end{array} \right)$",r"$+x_{2}$",r"$ \left( \begin{array}{c} 2 \\ 3 \\ 1 \\ 2 \end{array} \right)$",r"$ + x_{3}$",r"$\left( \begin{array}{c} 1 \\ 1 \\ 4 \\ 3 \end{array} \right)$") + CS_A.move_to(1.5*LEFT+1*DOWN) + CS_A[1].set_color(color = DARK_BLUE) + CS_A[3].set_color(color = DARK_BLUE) + CS_A[5].set_color(color = DARK_BLUE) + CS_A.scale(0.75) + + self.play(Write(CS_A),run_time = 2) + + arrow1 = Arrow(start = 1.25*UP,end = 0.25*DOWN+1.75*LEFT) + arrow2 = Arrow(start = 1.35*UP+0.5*RIGHT,end = 0.25*DOWN+0.5*RIGHT) + arrow3 = Arrow(start = 1.25*UP+0.75*RIGHT,end = 0.25*DOWN+2.9*RIGHT) + + Defn = TextMobject("Linear Combination of Columns of Matrix") + Defn.move_to(3*DOWN) + + self.play(Write(Defn), ShowCreation(arrow1), ShowCreation(arrow2), ShowCreation(arrow3),run_time = 1) + self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file2_Row_Space.py b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file2_Row_Space.py new file mode 100644 index 0000000..b16a32a --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/file2_Row_Space.py @@ -0,0 +1,145 @@ +from manimlib.imports import * + +class Row_Space(Scene): + def construct(self): + + Heading = TextMobject("Row Space") + defn1 = TextMobject("Definition 1: Row Space of a matrix is the linear combination of the rows of that matrix.") + defn2 = TextMobject("Definition 2: It is a vector space generated by a linear combination of the columns of $A^{T}$.") + equivalent = TextMobject(r"Definition 1 $\equiv$ Definition 2") + + Heading.move_to(2*UP) + Heading.set_color(color = DARK_BLUE) + + defn1.move_to(UP) + defn1.scale(0.75) + + defn2.scale(0.75) + + equivalent.move_to(DOWN) + + self.play(Write(Heading)) + self.play(Write(defn1)) + self.play(Write(defn2)) + self.play(Write(equivalent)) + + self.wait(2) + self.play(FadeOut(Heading),FadeOut(defn1),FadeOut(defn2),ApplyMethod(equivalent.move_to,2*UP)) + + how = TextMobject("Let us see, How?") + how.move_to(UP) + self.play(Write(how)) + self.play(FadeOut(equivalent),FadeOut(how)) + + A = TextMobject(r"$A = $",r"$\left( \begin{array}{c c c} 1 & 2 & 1 \\ 1 & 3 & 1 \\ 2 & 1 & 4 \\ 3 & 2 & 3 \end{array} \right)$") + A.move_to(2*UP+3*LEFT) + A[1].set_color(color = DARK_BLUE) + A.scale(0.80) + + self.play(Write(A)) + + rows = TextMobject(r"Rows of A $\rightarrow$", + r"$\left( \begin{array}{c c c} 1 & 2 & 1 \end{array} \right)$,", + r"$ \left( \begin{array}{c c c} 1 & 3 & 1 \end{array} \right)$,", + r"$\left( \begin{array}{c c c} 2 & 1 & 4 \end{array} \right)$,", + r"$ \left( \begin{array}{c c c} 3 & 2 & 3 \end{array} \right)$") + rows.scale(0.75) + rows[1:5].set_color(DARK_BLUE) + self.play(Write(rows)) + + ac_defn1 = TextMobject("According to Definition 1 : ") + ac_defn1.move_to(DOWN) + + RS_A = TextMobject(r"Row Space of $A = x_{1}$", + r"$\left( \begin{array}{c c c} 1 & 2 & 1 \end{array} \right)$", + r"$+x_{2}$", + r"$ \left( \begin{array}{c c c} 1 & 3 & 1 \end{array} \right)$", + r"$ + x_{3}$", + r"$\left( \begin{array}{c c c} 2 & 1 & 4 \end{array} \right)$", + r"$+x_{4}$", + r"$ \left( \begin{array}{c c c} 3 & 2 & 3 \end{array} \right)$") + RS_A.move_to(DOWN+DOWN) + RS_A[6].move_to(2*DOWN+DOWN) + RS_A[7].move_to(2*DOWN+2*RIGHT+DOWN) + RS_A[1].set_color(color = DARK_BLUE) + RS_A[3].set_color(color = DARK_BLUE) + RS_A[5].set_color(color = DARK_BLUE) + RS_A[7].set_color(color = DARK_BLUE) + RS_A.scale(0.75) + + self.play(FadeOut(rows[0]),Transform(rows[1],RS_A[1]),Transform(rows[2],RS_A[3]),Transform(rows[3],RS_A[5]),Transform(rows[4],RS_A[7])) + self.play(FadeIn(ac_defn1), Write(RS_A)) + self.wait(1) + + self.play(FadeOut(rows[1]), FadeOut(rows[2]), FadeOut(rows[3]), FadeOut(rows[4]), FadeOut(RS_A), FadeOut(ac_defn1)) + + A_T = TextMobject(r"$A^{T} = $",r"$\left( \begin{array}{c c c c} 1 & 1 & 2 & 3 \\ 2 & 3 & 1 & 2 \\ 1 & 1 & 4 & 3 \end{array} \right)$") + A_T.move_to(2*UP+3*RIGHT) + A_T[1].set_color(color = DARK_BLUE) + A_T.scale(0.80) + + self.play(Write(A_T)) + + change1 = TextMobject(r"Rows of $A\equiv$ Columns of $A^{T}$") + change2 = TextMobject(r"Columns of $A\equiv$ Rows of $A^{T}$") + change2.move_to(DOWN) + + change3 = TextMobject(r"Row Space of $A$ = Linear Combination of",r"Rows","of",r"A") + change3.move_to(2*DOWN) + change3[1].set_color(DARK_BLUE) + change3[3].set_color(DARK_BLUE) + + self.play(Write(change1)) + self.play(Write(change2)) + self.play(Write(change3)) + + columns = TextMobject("Columns") + columns.scale(0.6) + columns.set_color(DARK_BLUE) + columns.move_to(2*DOWN+4.1*RIGHT) + + a = TextMobject(r"$A^{T}$") + a.set_color(DARK_BLUE) + a.move_to(1.95*DOWN+5.6*RIGHT) + + self.wait(0.5) + + self.play(Transform(change3[1],columns), Transform(change3[3],a)) + + equal = TextMobject(r"= Column Space($A^{T}$)") + equal.move_to(3*DOWN+0.5*RIGHT) + + self.play(Write(equal)) + + self.play(FadeOut(A_T), FadeOut(change1), FadeOut(change2), FadeOut(change3), FadeOut(A), FadeOut(equal)) + + ac_defn1.move_to(3*UP) + RS_A.move_to(1.5*UP) + RS_A[6].move_to(UP) + RS_A[7].move_to(UP+1.5*RIGHT) + + self.play(Write(RS_A),FadeIn(ac_defn1)) + + CS_AT = TextMobject(r"Row Space of $A = x_{1}$", + r"$\left( \begin{array}{c} 1 \\ 2 \\ 1 \end{array} \right)$", + r"$+x_{2}$", + r"$ \left( \begin{array}{c} 1 \\ 3 \\ 1 \end{array} \right)$", + r"$ + x_{3}$", + r"$\left( \begin{array}{c} 2 \\ 1 \\ 4 \end{array} \right)$", + r"$+x_{4}$", + r"$ \left( \begin{array}{c} 3 \\ 2 \\ 3 \end{array} \right)$") + CS_AT.move_to(1.5*DOWN) + CS_AT[1].set_color(color = DARK_BLUE) + CS_AT[3].set_color(color = DARK_BLUE) + CS_AT[5].set_color(color = DARK_BLUE) + CS_AT[7].set_color(color = DARK_BLUE) + CS_AT.scale(0.75) + + ac_defn2 = TextMobject("According to Definition 2 : ") + equivalent = TextMobject(r"Hence, Definition 1 $\equiv$ Definition 2") + equivalent.move_to(3*DOWN) + + self.play(Write(CS_AT),FadeIn(ac_defn2)) + self.play(Write(equivalent)) + + self.wait() -- cgit From 989ed38029bb9a7fb8e6d0124d544bd51555fb16 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Wed, 3 Jun 2020 21:35:07 +0530 Subject: new animation --- .../line-integrals/README.md | 7 +- .../file3_vector_line_int_as_sum.gif | Bin 0 -> 1670998 bytes .../line-integrals/file3_vector_line_int_as_sum.py | 326 +++++++++++++++++++++ 3 files changed, 331 insertions(+), 2 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file3_vector_line_int_as_sum.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file3_vector_line_int_as_sum.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md index b7e1846..bd7e520 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md @@ -4,8 +4,11 @@ ** ![]() -** -![]() + +**file3_vector_line_int_as_sum** +![file3_vector_line_int_as_sum](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file3_vector_line_int_as_sum.gif) + + ** ![]() diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file3_vector_line_int_as_sum.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file3_vector_line_int_as_sum.gif new file mode 100644 index 0000000..46b35bc Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file3_vector_line_int_as_sum.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file3_vector_line_int_as_sum.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file3_vector_line_int_as_sum.py new file mode 100644 index 0000000..78294cc --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file3_vector_line_int_as_sum.py @@ -0,0 +1,326 @@ +from manimlib.imports import * + + +class LineIntegrationAsSum(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 10, + "y_min" : 0, + "y_max" : 6, + "graph_origin": ORIGIN+5*LEFT+3*DOWN, + "x_axis_width": 10, + "y_axis_height": 6 , + "x_tick_frequency": 2, + "y_tick_frequency": 2, + "Func":lambda x : 1+x**1.3*np.exp(-.12*(x-2)**2)*np.sin(x/4), + "a": 1 ,"b": 9, "n": 15, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + self.X=X ;self.Y=Y + + self.setup_axes(animate=False) + + + curve=self.get_graph( + self.Func, + x_min=self.a, + x_max=self.b, + ) + curve.set_color([BLACK,BLUE,BLUE,BLUE,BLACK]) + curve_label= self.get_graph_label( + curve, + label="\\text{path of intgration}", + x_val=4, + direction=UR, + buff=.6, + color=BLUE + ) + self.curve=curve + self.curve_label=curve_label + + self.get_vector_field() + + + self.play(ShowCreation(VGroup(curve,curve_label))) + self.wait(.6) + self.break_in_arcs() + self.show_the_sum() + + self.wait(2) + + + def get_vector_field(self): + func = lambda v: np.array([ + v[0], # x + -v[1], # y + 0 # z + ]) + vector_field= VectorField( + func, + delta_x=1, + delta_y=1, + colors=[GREEN_A,GREEN_C], + length_func= lambda norm: .8*sigmoid(norm), + vector_config={ + "stroke_width": 2 + } + ) + + self.vector_field= vector_field + + + def break_in_arcs(self): + + self.write_about_breaking() + + dl=0.8 + self.get_breakers(dl) + self.wait(2) + self.play(FadeOut(self.upto_break_text)) + self.dl=dl + + def write_about_breaking(self): + breaking_text=TextMobject("\\texttt{..broken}"," into small", "subarcs") + breaking_text.set_color_by_tex_to_color_map({ + "broken":RED,"subarcs": BLUE + }) + breaking_text.next_to(self.curve_label,DOWN) + breaking_text.align_to(self.curve_label,LEFT) + self.play( + Write(breaking_text) + ) + + self.upto_break_text=VGroup( + self.curve_label, + breaking_text, + ) + + def get_breakers(self,dl): + point=self.a + points=[] + while point<(self.b-dl) : + start=point + end=point+dl + points += [end] + breaker=Line( + self.input_to_graph_point(start,self.curve), + self.input_to_graph_point(end,self.curve), + stroke_width=2, + color=RED, + ) + breaker.rotate(PI/2).scale(.5) + + point=end + self.play(FadeIn(breaker),run_time=.2) + # self.add(breaker) + + del points[-1] + self.points=points + + + def show_the_sum(self): + at_any_points_text=TextMobject("At any ","point", "in each ", "subarc") + at_any_points_text.set_color_by_tex_to_color_map({ + "point":YELLOW , "subarc": BLUE + }) + at_any_points_text.to_edge(TOP,buff=SMALL_BUFF) + + evaluate_text=TextMobject("$\\vec F(x,y)$ ", "is evaluated").next_to(at_any_points_text,DOWN) + evaluate_text.set_color_by_tex("$\\vec F(x,y)$",ORANGE) + + multiply_text=TextMobject("...is multiplied with ","$\\Delta s_i$") + multiply_text.set_color_by_tex("\\Delta s_i", BLUE) + multiply_text.next_to(at_any_points_text,DOWN) + + + + self.at_any_points_text=at_any_points_text + self.evaluate_text=evaluate_text + self.multiply_text=multiply_text + + dots=[] + for point in self.points: + + dot=Dot( + point=self.input_to_graph_point(point,self.curve), + radius= .7*DEFAULT_DOT_RADIUS, + stroke_width= 0, + fill_opacity= 1.0, + color= YELLOW, + ) + dots+=[dot] + + self.play( + Write(at_any_points_text), + FadeIn(VGroup(*dots)),run_time=1.5 + ) + self.dots=dots + + self.wait() + self.show_the_dot_product() + self.multiply_with_ds() + self.construct_equation() + + + def show_the_dot_product(self): + index=-(len(self.points)//3) + self.index=index + + dot=self.dots[index] + + + dot_prod_text=TextMobject("Dot Product of", "$\\vec F(x_i,y_i)$", "and","$\\vec T(x_i,y_i)$") + dot_prod_text.set_color_by_tex_to_color_map({ + "\\vec F(x_i,y_i)":ORANGE , + "\\vec T(x_i,y_i)": "#DC75CD" , + }) + dot_prod_text.to_edge(TOP,buff=SMALL_BUFF) + + + point_coord=TextMobject("$(x_i,y_i)$",color=YELLOW) + point_coord.next_to(dot,DL,buff=.01).scale(.8) + + func_val=TextMobject("$\\vec F(x_i,y_i)$",color=ORANGE) + func_val.next_to(dot,UR).scale(.8) + + self.dot_prod_text=dot_prod_text + self.func_val=func_val + + dot.set_color(ORANGE).scale(1.2) + + + self.play(FadeIn(VGroup(point_coord,dot))) + self.play(Write(self.evaluate_text)) + self.wait(1) + self.play(FadeOut(self.vector_field)) + self.get_vector_and_tangent() + self.dot_product() + + + self.wait(2) + self.remove(point_coord) + + + def get_vector_and_tangent(self): + dot=self.dots[self.index] + self.show_specific_vectors(dot) + self.play(Write(self.func_val)) + self.wait(1) + self.show_tangent(dot) + self.play(FadeIn(VGroup(*[ + dot.set_color(ORANGE).scale(1.4) + for dot in self.dots ] + ))) + + + def show_specific_vectors(self,dots): + for dot in dots: + vector=self.vector_field.get_vector(dot.get_center()) + vector.set_color(ORANGE) + + self.play(Write(vector),run_time=.2) + + + def show_tangent(self,dot): + tangent_sym=TextMobject("$\\vec T(x_i,y_i)$",color="#DC75CD").scale(.8) + x=dot.get_center() + angle=self.angle_of_tangent( + self.point_to_coords(x)[0], + self.curve, + dx=0.01 + ) + vect = Vector().rotate(angle,about_point=x) + vect.set_color("#DC75CD") + tangent=vect.next_to(x,DR,buff=0) + tangent_sym.next_to(tangent,DOWN,buff=.1) + self.play(Write(VGroup(tangent,tangent_sym))) + + self.tangent_sym=tangent_sym + + def dot_product(self): + + dot_sym=Dot().next_to(self.func_val,RIGHT) + + self.play(FadeOut(VGroup( + self.at_any_points_text, + self.evaluate_text + ))) + self.play(Write(self.dot_prod_text)) + self.play( + FadeIn(dot_sym), + ApplyMethod( + self.tangent_sym.next_to, + dot_sym, RIGHT + )) + + self.dot_sym=dot_sym + + def multiply_with_ds(self): + self.get_ds() + + self.play(GrowFromCenter(self.ds_brace_group)) + self.wait(2) + self.play(Write(self.multiply_text)) + self.play(ApplyMethod( + self.ds_brace_label.next_to, + self.tangent_sym, RIGHT,buff=.15 + )) + + + + def get_ds(self): + p1= self.dots[self.index] + p2= self.dots[self.index+1] + ds_brace=Brace(VGroup(p1,p2),DL) + ds_brace.move_to(p1,UR) + ds_brace_label=ds_brace.get_text("$\Delta s_i$", buff = .05) + ds_brace_label.set_color(BLUE) + self.ds_brace=ds_brace + self.ds_brace_label=ds_brace_label + self.ds_brace_group=VGroup(ds_brace,ds_brace_label) + + + def construct_equation(self): + sum_up_text=TextMobject("and"," summed ", "for all i' s") + sum_up_text.set_color_by_tex("summed",PURPLE_A) + sum_up_text.next_to(self.multiply_text,DOWN,buff=MED_SMALL_BUFF) + sum_up_text.shift(LEFT) + + sum_eqn=TextMobject("$$\\sum_i^{ } $$").set_color(PURPLE_A) + sum_eqn.move_to(self.graph_origin+6.5*self.X+4*self.Y) + + line_integral_text=TextMobject("The Value of the"," line ","integral is").to_edge(TOP,buff=MED_SMALL_BUFF) + line_integral_text.set_color_by_tex("line",BLUE_C) + approx=TextMobject("$\\approx$",color=RED).next_to(sum_eqn,LEFT) + multipled=VGroup( + self.func_val, + self.dot_sym, + self.tangent_sym, + self.ds_brace_label + ) + + + self.play(Write(sum_up_text)) + self.show_specific_vectors(self.dots) + self.play(FadeIn(sum_eqn)) + self.play(ApplyMethod( + multipled.next_to,sum_eqn,RIGHT + )) + self.wait() + self.play(FadeOut(VGroup( + self.dot_prod_text, + self.multiply_text, + sum_up_text + ))) + self.play(Write(line_integral_text)) + self.play(FadeIn(approx)) + + + +#uploaded by Somnath Pandit.FSF2020_Line Integrals + + + -- cgit From 9807fbcd45a04d79afcfef0f8f79d49a8626efaa Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 4 Jun 2020 03:42:07 +0530 Subject: New animation --- .../line-integrals/README.md | 4 +- .../line-integrals/file2_scalar_line_integral.gif | Bin 0 -> 4833220 bytes .../line-integrals/file2_scalar_line_integral.py | 422 +++++++++++++++++++++ 3 files changed, 424 insertions(+), 2 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md index bd7e520..871eeaa 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md @@ -1,8 +1,8 @@ **file1_scalar_line_int_as_sum** ![file1_scalar_line_int_as_sum](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file1_scalar_line_int_as_sum.gif) -** -![]() +**file2_scalar_line_integral** +![file2_scalar_line_integral](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.gif) **file3_vector_line_int_as_sum** diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.gif new file mode 100644 index 0000000..dc4477d Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py new file mode 100644 index 0000000..310cac0 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py @@ -0,0 +1,422 @@ +from manimlib.imports import * + +class LineIntegrationProcess(SpecialThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": -4, + "x_max": 4, + "y_min": 0, + "y_max": 4, + "z_min": 0, + "z_max": 4, + "a":-3 ,"b": 3, "c":0 , "d":3.5, + "axes_shift":3*IN, + "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.2, + "stroke_color": WHITE, + "stroke_opacity": 0.75, + }, + "Func": lambda x,y: 1+x**2*y/15 + } + + + def construct(self): + + self.setup_axes() + axes=self.axes + + self.set_camera_orientation(distance=35, + phi=65 * DEGREES, + theta=-65 * DEGREES, + ) + + fn_text=TextMobject("$z=2+x^2y$").set_color(BLUE) + self.add_fixed_in_frame_mobjects(fn_text) + fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) + + + #get the surface + surface= self.get_surface( + lambda x , y: + self.Func(x,y) + ) + surface.set_style( + fill_opacity=0.5, + fill_color=BLUE_D, + stroke_width=0.5, + stroke_color=WHITE, + ) + + + # self.play(Write(surface)) + self.add(surface) + self.get_line_of_int(fn_text) + self.begin_ambient_camera_rotation(rate=-0.02) + self.get_field_values_on_line() + self.wait(1.5) + self.area=self.get_area() + area_text=TextMobject("Line"," Integral in the",r" scalar field\\"," means this" ,"area") + area_text.set_color_by_tex_to_color_map({ + "Line": PINK, "scalar":BLUE, "area":TEAL_A + }) + area_text.to_edge(TOP,buff=MED_SMALL_BUFF) + + self.remove(self.values_on_line_text) + self.add_fixed_in_frame_mobjects(area_text) + self.play(Write(area_text)) + self.play(Write(self.area),run_time=2) + self.play(FadeOut(surface)) + self.wait() + + self.stop_ambient_camera_rotation() + # self.get_lines() + + self.remove(axes,surface) + self.trasform_to_graphs() + self.wait(2) + + + + + def get_line_of_int(self,fn_text): + self.remove(fn_text) + + line_of_int_text=TextMobject(r"Line of integration is\\","$\\vec r(t)=\cos(t)\hat x+\sin(t)\hat y$") + line_of_int_text[1].set_color(PINK) + line_of_int_text.to_edge(TOP,buff=SMALL_BUFF) + + + line_of_int=(self.get_curve( + self.Func,on_surface=False + )) + line_of_int.set_style( + stroke_width=5, + stroke_color=PINK, + ) + + self.add_fixed_in_frame_mobjects(line_of_int_text) + self.play(Write(line_of_int_text)) + self.wait() + self.play(ShowCreation(line_of_int),run_time=3) + # self.add(line_of_int) + + self.line_of_int=line_of_int + self.line_of_int_text=line_of_int_text + + def get_field_values_on_line(self): + self.remove(self.line_of_int_text) + + values_on_line_text=TextMobject("Values"," of"," function","on the ","line") + values_on_line_text.set_color_by_tex_to_color_map({ + "Values":YELLOW, "function":BLUE,"line":PINK + }) + values_on_line_text.to_edge(TOP,buff=SMALL_BUFF) + + values_on_surface=(self.get_curve( + self.Func,on_surface=True + )) + values_on_surface.set_style( + stroke_width=5, + stroke_color=YELLOW, + ) + + self.add_fixed_in_frame_mobjects(values_on_line_text) + self.play(Write(values_on_line_text)) + # self.wait() + self.play(ShowCreation(values_on_surface),run_time=3) + # self.add(values_on_surface) + + self.values_on_surface=values_on_surface + self.values_on_line_text=values_on_line_text + + + def trasform_to_graphs(self): + on_surface_graph=(self.get_graph( + self.Func,on_surface=True + )) + on_surface_graph.set_style( + stroke_width=5, + stroke_color=YELLOW, + ) + + line_graph=(self.get_graph( + self.Func,on_surface=False + )) + line_graph.set_style( + stroke_width=5, + stroke_color=PINK, + ) + + self.on_surface_graph=on_surface_graph + self.line_graph=line_graph + graph_area=self.get_area(graph=True) + + into_graph=[ + ReplacementTransform( + self.values_on_surface, + on_surface_graph + ), + ReplacementTransform( + self.line_of_int, + line_graph + ), + ReplacementTransform( + self.area, + graph_area + ), + ] + + self.move_camera( + # distance=20, + phi=90 * DEGREES, + theta=-90 * DEGREES, + added_anims=into_graph, + run_time=2 + ) + + def get_area(self,graph=False): + axes=self.axes + if graph: + on_surface=self.on_surface_graph + on_base=self.line_graph + else: + on_surface=self.values_on_surface + on_base=self.line_of_int + area =Polygon( + *[ + on_surface.get_point_from_function(t) + for t in np.arange(0,PI,0.01) + ], + *[ + on_base.get_point_from_function(t) + for t in np.arange(PI,0,-0.01) + ], + stroke_width=0, + fill_color=TEAL_A, + fill_opacity=.6, + ) + + return area + + def get_curve(self,func,on_surface=False ,**kwargs): + config = dict() + config.update(self.default_graph_style) + config.update({ + "t_min": 0, + "t_max": PI, + }) + config.update(kwargs) + r=abs(self.axes.a) + curve=ParametricFunction( + lambda t: self.axes.c2p( + r*np.cos(t), + r*np.sin(t), + func(r*np.cos(t), r*np.sin(t))*bool(on_surface) + ), + **config, + ) + return curve + + + def get_surface(self, func, **kwargs): + axes=self.axes + config = { + "u_min": axes.a-.2, + "u_max": axes.b+.2, + "v_min": axes.c-.1, + "v_max": axes.d, + "resolution": ( + 2*(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_graph(self,func,on_surface=False ,**kwargs): + config = dict() + config.update(self.default_graph_style) + config.update({ + "t_min": 0, + "t_max": PI, + }) + config.update(kwargs) + slice_curve=ParametricFunction( + lambda t: self.axes.c2p( + 4*np.cos(t), + 0, + 2+func(3*np.cos(t), 3*np.sin(t))*bool(on_surface) + ), + **config, + ) + return slice_curve + + def get_lines(self): + pass + 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,"PINK")) + + 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)) + self.add(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 + + #customize 3D axes + 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) + self.axes=axes + + 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, LEFT, + 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( + lambda x, t: 0 + ) + '''input_plane.set_style( + fill_opacity=0.3, + fill_color=PINK, + stroke_width=.2, + 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 = [ + + ("1", axes.b), + ("-1", axes.a), + ] + tex_vals_y=[ + + ("1", 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) + # label.rotate(180 * DEGREES) + 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) + 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(), LEFT) + axes.z_axis.label = z_label + for axis in axes: + axis.add(axis.label) + return axes + + + + #uploaded by Somnath Pandit.FSF2020_Line_Integrals -- cgit From eaa80a0103a8f84a455c331e3a3684f5ce4382dd Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 4 Jun 2020 10:50:38 +0530 Subject: updated --- .../line-integrals/file2_scalar_line_integral.gif | Bin 4833220 -> 5612895 bytes .../line-integrals/file2_scalar_line_integral.py | 19 ++++++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.gif index dc4477d..71c97d6 100644 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.gif and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py index 310cac0..eb5f4ab 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py @@ -52,9 +52,7 @@ class LineIntegrationProcess(SpecialThreeDScene): ) fn_text=TextMobject("$z=2+x^2y$").set_color(BLUE) - self.add_fixed_in_frame_mobjects(fn_text) - fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) - + fn_text.to_corner(UR,buff=.8).shift(DOWN) #get the surface surface= self.get_surface( @@ -69,10 +67,11 @@ class LineIntegrationProcess(SpecialThreeDScene): ) - # self.play(Write(surface)) - self.add(surface) - self.get_line_of_int(fn_text) - self.begin_ambient_camera_rotation(rate=-0.02) + # self.play(Write(surface)) + self.add_fixed_in_frame_mobjects(fn_text) + self.play(Write(surface),Write(fn_text)) + self.get_line_of_int() + self.begin_ambient_camera_rotation(rate=-0.035) self.get_field_values_on_line() self.wait(1.5) self.area=self.get_area() @@ -86,7 +85,7 @@ class LineIntegrationProcess(SpecialThreeDScene): self.add_fixed_in_frame_mobjects(area_text) self.play(Write(area_text)) self.play(Write(self.area),run_time=2) - self.play(FadeOut(surface)) + self.play(FadeOut(VGroup(surface,fn_text))) self.wait() self.stop_ambient_camera_rotation() @@ -99,9 +98,7 @@ class LineIntegrationProcess(SpecialThreeDScene): - def get_line_of_int(self,fn_text): - self.remove(fn_text) - + def get_line_of_int(self): line_of_int_text=TextMobject(r"Line of integration is\\","$\\vec r(t)=\cos(t)\hat x+\sin(t)\hat y$") line_of_int_text[1].set_color(PINK) line_of_int_text.to_edge(TOP,buff=SMALL_BUFF) -- cgit From 1f5c1963da6ff76b58910063d31138f104759a1c Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 4 Jun 2020 17:35:27 +0530 Subject: new animation --- .../line-integrals/README.md | 4 +- .../line-integrals/file2_scalar_line_integral.py | 2 + .../line-integrals/file4_helix.gif | Bin 0 -> 1237895 bytes .../line-integrals/file4_helix.py | 245 +++++++++++++++++++++ 4 files changed, 249 insertions(+), 2 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file4_helix.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file4_helix.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md index 871eeaa..17077b6 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/README.md @@ -10,5 +10,5 @@ -** -![]() +**file4_helix** +![file4_helix](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file4_helix.gif) diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py index eb5f4ab..996ead1 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file2_scalar_line_integral.py @@ -417,3 +417,5 @@ class LineIntegrationProcess(SpecialThreeDScene): #uploaded by Somnath Pandit.FSF2020_Line_Integrals + + diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file4_helix.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file4_helix.gif new file mode 100644 index 0000000..ceedb1f Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file4_helix.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file4_helix.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file4_helix.py new file mode 100644 index 0000000..50aeb33 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/line-integrals/file4_helix.py @@ -0,0 +1,245 @@ +from manimlib.imports import * + +class ParametricCurve(ThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": 0, + "x_max": 3, + "y_min": 0, + "y_max": 3, + "z_min": 0, + "z_max": 4, + "a":0 ,"b": 2, "c":0 , "d":2, + "axes_shift":2*IN+1.4*RIGHT+1.4*DOWN, + "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, + }, + }, + + } + + + def construct(self): + + self.setup_axes() + + self.set_camera_orientation( + distance=25, + phi=60 * DEGREES, + theta=40 * DEGREES, + ) + + label=TextMobject("Helix",color=PURPLE).scale(1.6) + label.to_corner(UR,buff=2) + self.add_fixed_in_frame_mobjects(label) + + helix=self.get_helix( + radius=1.5, + t_min= 0, + t_max= 4*PI, + color=PURPLE + ) + parameter_label=TextMobject( + "Parametric equation: ", + color=TEAL + ).next_to(label,DOWN,buff=.3 + ) + parametric_eqn=TextMobject( + "$x=\cos$ (","t", + r")\\$y=\sin $(","t", + r")\\$z$=","t" + ).next_to(parameter_label,DOWN,buff=.1) + parametric_eqn.set_color_by_tex("t",RED) + self.parametric_eqn=parametric_eqn + + parametriztion=VGroup( + parameter_label, + parametric_eqn + ) + + + self.play(ShowCreation(helix),run_time=2) + self.begin_ambient_camera_rotation(.1) + self.wait(1) + self.add_fixed_in_frame_mobjects(parametriztion) + self.play(Write(parametriztion)) + self.wait(1) + self.stop_ambient_camera_rotation() + self.move_camera( + distance=20, + phi=85 * DEGREES, + # theta=-90 * DEGREES, + run_time=3 + ) + scale_axes=VGroup(self.axes,helix).scale(1.2) + self.show_the_parameter() + self.wait(2) + + + + def get_helix(self,radius=1, **kwargs): + config = { + "t_min": 0, + "t_max": 2*PI, + } + config.update(kwargs) + helix= ParametricFunction( + lambda t : self.axes.c2p( + radius*np.cos(t), + radius*np.sin(t), + t/4 + ), + **config + ) + + self.helix=helix + return helix + + def show_the_parameter(self): + t_tracker = ValueTracker(0) + t=t_tracker.get_value + + t_label = TexMobject( + "t = ",color=RED + ).next_to(self.parametric_eqn,DL,buff=.85) + + t_text = always_redraw( + lambda: DecimalNumber( + t(), + color=GOLD, + ).next_to(t_label, RIGHT, MED_SMALL_BUFF) + ) + t_text.suspend_updating() + + dot = Sphere( + radius= 1.5*DEFAULT_DOT_RADIUS, + stroke_width= 1, + fill_opacity= 1.0, + ) + dot.set_color(GOLD) + dot.add_updater(lambda v: v.move_to( + self.helix.get_point_from_function(PI*t()) + )) + + pi = TexMobject( + "\\pi ", + color=GOLD, + ).next_to(t_text,RIGHT,buff=-.3) + + group = VGroup(t_text,t_label,pi).scale(1.5) + + self.wait(1) + self.add_fixed_in_frame_mobjects(group) + t_text.resume_updating() + self.play(FadeIn(group)) + self.add(dot) + self.play( + t_tracker.set_value,2, + rate_func=linear, + run_time=5 + ) + + +#-------------------------------------------------------- + + #customize 3D axes + def get_three_d_axes(self, include_labels=True, include_numbers=False, **kwargs): + config = dict(self.axes_config) + config.update(kwargs) + axes = ThreeDAxes(**config) + axes.set_stroke(width=1.5) + + 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, LEFT, + about_point=axes.c2p(0, 0, 0), + ) + axes.y_axis.rotate( + 90 * DEGREES, UP, + about_point=axes.c2p(0, 0, 0), + ) + + + return axes + + + def setup_axes(self): + axes = self.get_three_d_axes(include_labels=True) + 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 = [ + ("1", axes.b), + ] + tex_vals_y=[ + ("1", 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) + label.rotate(180 * DEGREES) + 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) + 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, LEFT) + z_label.next_to(axes.z_axis.get_zenith(), LEFT) + axes.z_axis.label = z_label + for axis in axes: + axis.add(axis.label) + return axes + + #uploaded by Somnath Pandit.FSF2020_Line_integrals + + + + + -- cgit From 16dd9a4ceb110a5f8b900ed83c4a27d99464940c Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Mon, 8 Jun 2020 17:26:02 +0530 Subject: new animation --- .../fundamental-theorem-of-line-integral/README.md | 5 + .../file1_grad_of_scalar_function.gif | Bin 0 -> 4012467 bytes .../grad_of_scalar_function.py | 304 +++++++++++++++++++++ 3 files changed, 309 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/grad_of_scalar_function.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md new file mode 100644 index 0000000..6fcbe68 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md @@ -0,0 +1,5 @@ +**file1_grad_of_scalar_function** +![file1_grad_of_scalar_function](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.gif) + +** +![](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/ .gif) diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.gif new file mode 100644 index 0000000..5a6e102 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/grad_of_scalar_function.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/grad_of_scalar_function.py new file mode 100644 index 0000000..3a2c3f7 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/grad_of_scalar_function.py @@ -0,0 +1,304 @@ +from manimlib.imports import * + +class GradOfScalar(ThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": -3, + "x_max": 3, + "y_min": -3, + "y_max": 3, + "z_min": 0, + "z_max": 3, + "a":-3 ,"b": 3, "c":-3 , "d":3, + "axes_shift": ORIGIN+IN, + "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_vector_field_config": { + "delta_x": 1, + "delta_y": 1, + "x_min": -3, + "x_max": 3, + "y_min": -3, + "y_max": 3, + "min_magnitude": 0, + "max_magnitude": 2, + "colors": [TEAL,GREEN,GREEN,GREEN,YELLOW,RED], + "length_func": lambda norm : norm*np.exp(-.38*norm)/2, + "opacity": 1.0, + "vector_config": { + "stroke_width":8 + }, + }, + "default_surface_config": { + "fill_opacity": 0.5, + "checkerboard_colors": [BLUE_E], + "stroke_width": .5, + "stroke_color": WHITE, + "stroke_opacity": 0.75, + }, + } + + + def construct(self): + + self.setup_axes() + axes=self.axes + + self.set_camera_orientation(distance=35, + phi=70 * DEGREES, + theta=-135 * DEGREES, + ) + + scalar_fn_text=TexMobject("f(x,y,z)=","xy").set_color(BLUE) + scalar_fn_text.to_corner(UR,buff=.6) + + operator=TexMobject("\\vec\\nabla").next_to( + scalar_fn_text,LEFT,buff=.2 + ).set_color(GOLD) + grad_text=TexMobject(r"\dfrac{\partial f}{\partial x} \hat i+\dfrac{\partial f}{\partial y} \hat j+\dfrac{\partial f}{\partial z} \hat k").set_color(GOLD) + grad_text.next_to(scalar_fn_text,DOWN).scale(.9) + + VGroup(grad_text[0][1],grad_text[0][9],grad_text[0][17]).set_color(BLUE) + VGroup(grad_text[0][5:8],grad_text[0][13:16],grad_text[0][21:23]).set_color(WHITE) + + vector_field_text=TexMobject("\\vec F=y\hat i+x\hat j").set_color_by_gradient(*self.default_vector_field_config["colors"]) + vector_field_text.next_to(scalar_fn_text,DOWN) + + + #always generate the scalar field first + s_field1=self.get_scalar_field( + func= lambda u ,v : u*v/7 + ) + v_field1=self.get_vector_field( + lambda v: np.array([ + v[1], + v[0], + 0, + ]), + on_surface=True, + ) + + self.add_fixed_in_frame_mobjects(scalar_fn_text) + + self.begin_ambient_camera_rotation(rate=.2) + self.play(Write(s_field1)) + self.wait(1) + self.stop_ambient_camera_rotation() + + self.add_fixed_in_frame_mobjects(operator) + self.play(Write(operator),FadeOut(scalar_fn_text[1])) + self.add_fixed_in_frame_mobjects(grad_text) + self.play(Write(grad_text)) + self.wait(2) + + self.play(FadeOut(grad_text)) + self.add_fixed_in_frame_mobjects(vector_field_text) + show_vec_field=[ + FadeIn(v_field1), + Write(vector_field_text), + ] + + self.begin_ambient_camera_rotation(rate=.2) + self.move_camera( + # distance=20, + phi=60 * DEGREES, + added_anims=show_vec_field, + run_time=4.5 + ) + + self.wait(2) + self.stop_ambient_camera_rotation() + + fadeout= [FadeOut(s_field1)] + self.move_camera( + # distance=20, + phi=0 * DEGREES, + theta=-90 * DEGREES, + added_anims=fadeout, + run_time=2 + ) + self.wait(2) + + + + + + def get_scalar_field(self,func,**kwargs): + surface= self.get_surface( + lambda x , y: + func(x,y), + ) + + self.surface_points=self.get_points(func) + return surface + + def get_points(self,func): + axes=self.axes + dn=.5 + x_vals=np.arange(axes.a,axes.b,dn) + y_vals=np.arange(axes.c,axes.d,dn) + points=[] + for x_val in x_vals: + for y_val in y_vals: + points+=[axes.c2p(x_val,y_val,func(x_val,y_val)+.05)] + return points + + def get_vector_field(self,func,on_surface=True,**kwargs): + config = dict() + config.update(self.default_vector_field_config) + config.update(kwargs) + vector_field= VectorField(func,**config) + self.vector_field=vector_field + + if on_surface: + vector_field1=self.get_vectors_on_surface() + + return vector_field1 + + + + def get_vectors_on_surface(self): + config = dict() + config.update(self.default_vector_field_config["vector_config"]) + vectors_on_surface = VGroup(*[ + self.vector_field.get_vector(point,**config) + for point in self.surface_points + ]) + + return vectors_on_surface + + + def get_surface(self, func, **kwargs): + axes=self.axes + config = { + "u_min": axes.a, + "u_max": axes.b, + "v_min": axes.c, + "v_max": axes.d, + "resolution": ( + 2*(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 + ) + + + +#------------------------------------------------------- + #customize 3D axes + def get_three_d_axes(self, include_labels=True, include_numbers=False, **kwargs): + config = dict(self.axes_config) + config.update(kwargs) + axes = ThreeDAxes(**config) + axes.set_stroke(width=2) + self.axes=axes + + 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, LEFT, + about_point=axes.c2p(0, 0, 0), + ) + axes.y_axis.rotate( + 90 * DEGREES, UP, + about_point=axes.c2p(0, 0, 0), + ) + + return axes + + + def setup_axes(self): + axes = self.get_three_d_axes(include_labels=True) + 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 = [ + + ("1", axes.b), + ("-1", axes.a), + ] + tex_vals_y=[ + + ("1", 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) + # label.rotate(180 * DEGREES) + 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) + 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(), LEFT) + axes.z_axis.label = z_label + for axis in axes: + axis.add(axis.label) + return axes + + + + #uploaded by Somnath Pandit.FSF2020_Line_Integrals -- cgit From 4699b0b1a773db4376711c7d67e3d82a90d03f28 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Tue, 9 Jun 2020 12:50:17 +0530 Subject: update --- .../fundamental-theorem-of-line-integral/README.md | 4 +- .../file1_grad_of_scalar_function.py | 308 +++++++++++++++++++++ 2 files changed, 310 insertions(+), 2 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md index 6fcbe68..edd176f 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md @@ -1,5 +1,5 @@ **file1_grad_of_scalar_function** ![file1_grad_of_scalar_function](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.gif) -** -![](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/ .gif) +**file2_line_int_example** +![file2_line_int_example](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif) diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.py new file mode 100644 index 0000000..c9f479c --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.py @@ -0,0 +1,308 @@ +from manimlib.imports import * + +class GradOfScalar(ThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": -3, + "x_max": 3, + "y_min": -3, + "y_max": 3, + "z_min": 0, + "z_max": 3, + "a":-3 ,"b": 3, "c":-3 , "d":3, + "axes_shift": ORIGIN+IN, + "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_vector_field_config": { + "delta_x": 1, + "delta_y": 1, + "x_min": -3, + "x_max": 3, + "y_min": -3, + "y_max": 3, + "min_magnitude": 0, + "max_magnitude": 2, + "colors": [TEAL,GREEN,GREEN,GREEN,YELLOW,RED], + "length_func": lambda norm : norm*np.exp(-.38*norm)/2, + "opacity": 1.0, + "vector_config": { + "stroke_width":8 + }, + }, + "default_surface_config": { + "fill_opacity": 0.5, + "checkerboard_colors": [BLUE_E], + "stroke_width": .5, + "stroke_color": WHITE, + "stroke_opacity": 0.75, + }, + } + + + def construct(self): + + self.setup_axes() + axes=self.axes + + self.set_camera_orientation(distance=35, + phi=70 * DEGREES, + theta=-135 * DEGREES, + ) + + scalar_fn_text=TexMobject("f(x,y,z)=","xy").set_color(BLUE) + scalar_fn_text.to_corner(UR,buff=.6) + + operator=TexMobject("\\vec\\nabla").next_to( + scalar_fn_text,LEFT,buff=.2 + ).set_color(GOLD) + grad_text=TexMobject(r"\dfrac{\partial f}{\partial x} \hat i+\dfrac{\partial f}{\partial y} \hat j+\dfrac{\partial f}{\partial z} \hat k").set_color(GOLD) + grad_text.next_to(scalar_fn_text,DOWN).scale(.9) + + VGroup(grad_text[0][1],grad_text[0][9],grad_text[0][17]).set_color(BLUE) + VGroup(grad_text[0][5:8],grad_text[0][13:16],grad_text[0][21:23]).set_color(WHITE) + + vector_field_text=TexMobject("\\vec F=y\hat i+x\hat j").set_color_by_gradient(*self.default_vector_field_config["colors"]) + vector_field_text.next_to(scalar_fn_text,DOWN) + + + #always generate the scalar field first + s_field1=self.get_scalar_field( + func= lambda u ,v : u*v/7 + ) + v_field1=self.get_vector_field( + lambda v: np.array([ + v[1], + v[0], + 0, + ]), + on_surface=True, + ) + + self.add_fixed_in_frame_mobjects(scalar_fn_text) + + self.begin_ambient_camera_rotation(rate=.2) + self.play(Write(s_field1)) + self.wait(1) + self.stop_ambient_camera_rotation() + + self.add_fixed_in_frame_mobjects(operator) + self.play(Write(operator),FadeOut(scalar_fn_text[1])) + self.add_fixed_in_frame_mobjects(grad_text) + self.play(Write(grad_text)) + self.wait(2) + + self.play(FadeOut(grad_text)) + self.add_fixed_in_frame_mobjects(vector_field_text) + show_vec_field=[ + FadeIn(v_field1), + Write(vector_field_text), + ] + + self.begin_ambient_camera_rotation(rate=.2) + self.move_camera( + # distance=20, + phi=60 * DEGREES, + added_anims=show_vec_field, + run_time=4.5 + ) + + self.wait(2) + self.stop_ambient_camera_rotation() + + fadeout= [FadeOut(s_field1)] + self.move_camera( + # distance=20, + phi=0 * DEGREES, + theta=-90 * DEGREES, + added_anims=fadeout, + run_time=2 + ) + self.wait(2) + + + + + + def get_scalar_field(self,func,**kwargs): + surface= self.get_surface( + lambda x , y: + func(x,y), + ) + + self.surface_points=self.get_points(func) + return surface + + def get_points(self,func): + axes=self.axes + dn=.5 + x_vals=np.arange(axes.a,axes.b,dn) + y_vals=np.arange(axes.c,axes.d,dn) + points=[] + for x_val in x_vals: + for y_val in y_vals: + points+=[axes.c2p(x_val,y_val,func(x_val,y_val)+.05)] + return points + + def get_vector_field(self,func,on_surface=True,**kwargs): + config = dict() + config.update(self.default_vector_field_config) + config.update(kwargs) + vector_field= VectorField(func,**config) + self.vector_field=vector_field + + if on_surface: + vector_field=self.get_vectors_on_surface() + + return vector_field + + + + def get_vectors_on_surface(self): + config = dict() + config.update(self.default_vector_field_config["vector_config"]) + vectors_on_surface = VGroup(*[ + self.vector_field.get_vector(point,**config) + for point in self.surface_points + ]) + + return vectors_on_surface + + + def get_surface(self, func, **kwargs): + axes=self.axes + config = { + "u_min": axes.a, + "u_max": axes.b, + "v_min": axes.c, + "v_max": axes.d, + "resolution": ( + 2*(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 + ) + + + +#------------------------------------------------------- + #customize 3D axes + def get_three_d_axes(self, include_labels=True, include_numbers=False, **kwargs): + config = dict(self.axes_config) + config.update(kwargs) + axes = ThreeDAxes(**config) + axes.set_stroke(width=2) + self.axes=axes + + 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, LEFT, + about_point=axes.c2p(0, 0, 0), + ) + axes.y_axis.rotate( + 90 * DEGREES, UP, + about_point=axes.c2p(0, 0, 0), + ) + + return axes + + + def setup_axes(self): + axes = self.get_three_d_axes(include_labels=True) + 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 = [ + + ("1", axes.b), + ("-1", axes.a), + ] + tex_vals_y=[ + + ("1", 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) + # label.rotate(180 * DEGREES) + 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) + 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(), LEFT) + axes.z_axis.label = z_label + for axis in axes: + axis.add(axis.label) + return axes + + + + #uploaded by Somnath Pandit. FSF2020_Fundamental_Theorem_of_Line_Integrals + + + + -- cgit From 9928ee6cdbc0d12c3ebef22bdd509c199e5b7949 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Tue, 9 Jun 2020 12:53:32 +0530 Subject: new file --- .../file2_line_int_example.gif | Bin 0 -> 1385308 bytes .../file2_line_int_example.py | 159 +++++++++++ .../grad_of_scalar_function.py | 304 --------------------- 3 files changed, 159 insertions(+), 304 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/grad_of_scalar_function.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif new file mode 100644 index 0000000..20ed081 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.py new file mode 100644 index 0000000..6dabe49 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.py @@ -0,0 +1,159 @@ +from manimlib.imports import * + + +class LineIntegration(GraphScene): + CONFIG = { + "x_min" : -1, + "x_max" : 2, + "y_min" : -1, + "y_max" : 2, + "graph_origin": ORIGIN+3*LEFT+1.5*DOWN, + "x_axis_width": 10, + "y_axis_height": 10 , + "x_tick_frequency": 1, + "y_tick_frequency": 1, + "default_vector_field_config": { + "delta_x": .5, + "delta_y": .5, + "min_magnitude": 0, + "max_magnitude": .5, + "colors": [GREEN,BLUE,BLUE,TEAL], + "length_func": lambda norm : .4*sigmoid(norm), + "opacity": .75, + "vector_config": { + "stroke_width":2 + }, + }, + + "a": .45,"b": 2, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + self.X=X ;self.Y=Y + + self.setup_axes(animate=False) + + + + + vector_field=self.get_vector_field( + lambda v: np.array([ + v[1]-self.graph_origin[1], + v[0]-self.graph_origin[0], + 0, + ]) + ) + vector_field_text=TexMobject( + "\\vec F=y\hat i+x\hat j", + stroke_width=2 + ).to_corner(UR,buff=.75).scale(1.2) + + vector_field_text[0][0:3].set_color(TEAL), + self.add(vector_field,) + self.play(Write(vector_field_text)) + self.wait() + self.get_endpoints_of_curve() + self.wait(.6) + self.play( + vector_field_text.shift,5*LEFT, + + ) + vector_field.set_fill(opacity=.2) + self.show_line_integral() + self.wait(2) + + + + + + def get_vector_field(self,func,**kwargs): + config = dict() + config.update(self.default_vector_field_config) + config.update(kwargs) + vector_field= VectorField(func,**config) + + self.vector_field= vector_field + + return vector_field + + + + def get_points(self): + dn=.1 + x_vals=np.arange(self.a,self.b,dn) + y_vals=np.arange(self.a,self.b,dn) + points=[] + for x_val in x_vals: + for y_val in y_vals: + points+=[self.coords_to_point(x_val,y_val)] + return points + + def get_endpoints_of_curve(self): + dots=[[1,1],[0,0]] + dot_labels= ["(1,1)","(0,0)"] + for dot,label in zip(dots,dot_labels): + dot=Dot(self.coords_to_point(*dot)).set_color(RED) + dot_label=TexMobject(label) + dot_label.next_to(dot,DR) + self.add(dot,dot_label) + self.end_points=dots + + def show_line_integral(self): + int_text=TexMobject( + "\\int_\\text{\\textbf{path}}\\vec F \\cdot d\\vec r= 1", + color=BLUE, + stroke_width=1.5 + ).scale(1.2) + int_text[0][0].set_color(RED_C) + int_text[0][5:7].set_color(TEAL) + int_text.to_edge(RIGHT+UP,buff=1) + + close_int=TexMobject("O").set_color(RED).scale(1.3) + close_int.move_to(int_text[0][0],OUT) + close_int_val=TexMobject("0",color=BLUE).scale(1.4) + close_int_val.move_to(int_text[0][-1],OUT) + + self.play(Write(int_text)) + + + self.show_method([[0,1]]) + self.play(Indicate(int_text)) + self.wait() + + self.show_method([[1,0]]) + self.play(Indicate(int_text)) + self.wait() + self.remove(int_text[0][-1]) + self.add(close_int) + + for i in range(2): + self.play(self.paths[i].rotate,PI) + self.play(Indicate(close_int)) + self.play(Write(close_int_val)) + self.wait() + + + def show_method(self,points): + points=points+self.end_points + paths=[] + for i in range(-1,len(points)-2): + path=Arrow( + self.coords_to_point(*points[i]), + self.coords_to_point(*points[i+1]), + buff=0 + ).set_color(BLUE) + paths+=VGroup(path) + self.play(GrowArrow(path),run_time=1.5) + + self.paths=paths + + + + + +#uploaded by Somnath Pandit. FSF2020_Fundamental_Theorem_of_Line_Integrals + + + diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/grad_of_scalar_function.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/grad_of_scalar_function.py deleted file mode 100644 index 3a2c3f7..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/grad_of_scalar_function.py +++ /dev/null @@ -1,304 +0,0 @@ -from manimlib.imports import * - -class GradOfScalar(ThreeDScene): - - CONFIG = { - "axes_config": { - "x_min": -3, - "x_max": 3, - "y_min": -3, - "y_max": 3, - "z_min": 0, - "z_max": 3, - "a":-3 ,"b": 3, "c":-3 , "d":3, - "axes_shift": ORIGIN+IN, - "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_vector_field_config": { - "delta_x": 1, - "delta_y": 1, - "x_min": -3, - "x_max": 3, - "y_min": -3, - "y_max": 3, - "min_magnitude": 0, - "max_magnitude": 2, - "colors": [TEAL,GREEN,GREEN,GREEN,YELLOW,RED], - "length_func": lambda norm : norm*np.exp(-.38*norm)/2, - "opacity": 1.0, - "vector_config": { - "stroke_width":8 - }, - }, - "default_surface_config": { - "fill_opacity": 0.5, - "checkerboard_colors": [BLUE_E], - "stroke_width": .5, - "stroke_color": WHITE, - "stroke_opacity": 0.75, - }, - } - - - def construct(self): - - self.setup_axes() - axes=self.axes - - self.set_camera_orientation(distance=35, - phi=70 * DEGREES, - theta=-135 * DEGREES, - ) - - scalar_fn_text=TexMobject("f(x,y,z)=","xy").set_color(BLUE) - scalar_fn_text.to_corner(UR,buff=.6) - - operator=TexMobject("\\vec\\nabla").next_to( - scalar_fn_text,LEFT,buff=.2 - ).set_color(GOLD) - grad_text=TexMobject(r"\dfrac{\partial f}{\partial x} \hat i+\dfrac{\partial f}{\partial y} \hat j+\dfrac{\partial f}{\partial z} \hat k").set_color(GOLD) - grad_text.next_to(scalar_fn_text,DOWN).scale(.9) - - VGroup(grad_text[0][1],grad_text[0][9],grad_text[0][17]).set_color(BLUE) - VGroup(grad_text[0][5:8],grad_text[0][13:16],grad_text[0][21:23]).set_color(WHITE) - - vector_field_text=TexMobject("\\vec F=y\hat i+x\hat j").set_color_by_gradient(*self.default_vector_field_config["colors"]) - vector_field_text.next_to(scalar_fn_text,DOWN) - - - #always generate the scalar field first - s_field1=self.get_scalar_field( - func= lambda u ,v : u*v/7 - ) - v_field1=self.get_vector_field( - lambda v: np.array([ - v[1], - v[0], - 0, - ]), - on_surface=True, - ) - - self.add_fixed_in_frame_mobjects(scalar_fn_text) - - self.begin_ambient_camera_rotation(rate=.2) - self.play(Write(s_field1)) - self.wait(1) - self.stop_ambient_camera_rotation() - - self.add_fixed_in_frame_mobjects(operator) - self.play(Write(operator),FadeOut(scalar_fn_text[1])) - self.add_fixed_in_frame_mobjects(grad_text) - self.play(Write(grad_text)) - self.wait(2) - - self.play(FadeOut(grad_text)) - self.add_fixed_in_frame_mobjects(vector_field_text) - show_vec_field=[ - FadeIn(v_field1), - Write(vector_field_text), - ] - - self.begin_ambient_camera_rotation(rate=.2) - self.move_camera( - # distance=20, - phi=60 * DEGREES, - added_anims=show_vec_field, - run_time=4.5 - ) - - self.wait(2) - self.stop_ambient_camera_rotation() - - fadeout= [FadeOut(s_field1)] - self.move_camera( - # distance=20, - phi=0 * DEGREES, - theta=-90 * DEGREES, - added_anims=fadeout, - run_time=2 - ) - self.wait(2) - - - - - - def get_scalar_field(self,func,**kwargs): - surface= self.get_surface( - lambda x , y: - func(x,y), - ) - - self.surface_points=self.get_points(func) - return surface - - def get_points(self,func): - axes=self.axes - dn=.5 - x_vals=np.arange(axes.a,axes.b,dn) - y_vals=np.arange(axes.c,axes.d,dn) - points=[] - for x_val in x_vals: - for y_val in y_vals: - points+=[axes.c2p(x_val,y_val,func(x_val,y_val)+.05)] - return points - - def get_vector_field(self,func,on_surface=True,**kwargs): - config = dict() - config.update(self.default_vector_field_config) - config.update(kwargs) - vector_field= VectorField(func,**config) - self.vector_field=vector_field - - if on_surface: - vector_field1=self.get_vectors_on_surface() - - return vector_field1 - - - - def get_vectors_on_surface(self): - config = dict() - config.update(self.default_vector_field_config["vector_config"]) - vectors_on_surface = VGroup(*[ - self.vector_field.get_vector(point,**config) - for point in self.surface_points - ]) - - return vectors_on_surface - - - def get_surface(self, func, **kwargs): - axes=self.axes - config = { - "u_min": axes.a, - "u_max": axes.b, - "v_min": axes.c, - "v_max": axes.d, - "resolution": ( - 2*(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 - ) - - - -#------------------------------------------------------- - #customize 3D axes - def get_three_d_axes(self, include_labels=True, include_numbers=False, **kwargs): - config = dict(self.axes_config) - config.update(kwargs) - axes = ThreeDAxes(**config) - axes.set_stroke(width=2) - self.axes=axes - - 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, LEFT, - about_point=axes.c2p(0, 0, 0), - ) - axes.y_axis.rotate( - 90 * DEGREES, UP, - about_point=axes.c2p(0, 0, 0), - ) - - return axes - - - def setup_axes(self): - axes = self.get_three_d_axes(include_labels=True) - 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 = [ - - ("1", axes.b), - ("-1", axes.a), - ] - tex_vals_y=[ - - ("1", 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) - # label.rotate(180 * DEGREES) - 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) - 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(), LEFT) - axes.z_axis.label = z_label - for axis in axes: - axis.add(axis.label) - return axes - - - - #uploaded by Somnath Pandit.FSF2020_Line_Integrals -- cgit From 976d88d42dbb1bb80c2ff68f683f011b84d86503 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Tue, 9 Jun 2020 17:12:12 +0530 Subject: new file and rename --- .../fundamental-theorem-of-line-integral/README.md | 8 +- .../file2_line_int_example.gif | Bin 1385308 -> 0 bytes .../file2_line_int_example.py | 159 ------------------- .../file2_line_int_independent_of_path.gif | Bin 0 -> 1403902 bytes .../file2_line_int_independent_of_path.py | 174 +++++++++++++++++++++ .../file3_line_int_example.gif | Bin 0 -> 1385308 bytes .../file3_line_int_example.py | 149 ++++++++++++++++++ 7 files changed, 329 insertions(+), 161 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_independent_of_path.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_independent_of_path.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file3_line_int_example.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file3_line_int_example.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md index edd176f..aa8c7f8 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/README.md @@ -1,5 +1,9 @@ **file1_grad_of_scalar_function** ![file1_grad_of_scalar_function](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file1_grad_of_scalar_function.gif) -**file2_line_int_example** -![file2_line_int_example](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif) +**file2_line_int_independent_of_path** +![file2_line_int_independent_of_path](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_independent_of_path.gif) + +**file3_line_int_example** +![file3_line_int_example](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file3_line_int_example.gif) + diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif deleted file mode 100644 index 20ed081..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.py deleted file mode 100644 index 6dabe49..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_example.py +++ /dev/null @@ -1,159 +0,0 @@ -from manimlib.imports import * - - -class LineIntegration(GraphScene): - CONFIG = { - "x_min" : -1, - "x_max" : 2, - "y_min" : -1, - "y_max" : 2, - "graph_origin": ORIGIN+3*LEFT+1.5*DOWN, - "x_axis_width": 10, - "y_axis_height": 10 , - "x_tick_frequency": 1, - "y_tick_frequency": 1, - "default_vector_field_config": { - "delta_x": .5, - "delta_y": .5, - "min_magnitude": 0, - "max_magnitude": .5, - "colors": [GREEN,BLUE,BLUE,TEAL], - "length_func": lambda norm : .4*sigmoid(norm), - "opacity": .75, - "vector_config": { - "stroke_width":2 - }, - }, - - "a": .45,"b": 2, - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - self.X=X ;self.Y=Y - - self.setup_axes(animate=False) - - - - - vector_field=self.get_vector_field( - lambda v: np.array([ - v[1]-self.graph_origin[1], - v[0]-self.graph_origin[0], - 0, - ]) - ) - vector_field_text=TexMobject( - "\\vec F=y\hat i+x\hat j", - stroke_width=2 - ).to_corner(UR,buff=.75).scale(1.2) - - vector_field_text[0][0:3].set_color(TEAL), - self.add(vector_field,) - self.play(Write(vector_field_text)) - self.wait() - self.get_endpoints_of_curve() - self.wait(.6) - self.play( - vector_field_text.shift,5*LEFT, - - ) - vector_field.set_fill(opacity=.2) - self.show_line_integral() - self.wait(2) - - - - - - def get_vector_field(self,func,**kwargs): - config = dict() - config.update(self.default_vector_field_config) - config.update(kwargs) - vector_field= VectorField(func,**config) - - self.vector_field= vector_field - - return vector_field - - - - def get_points(self): - dn=.1 - x_vals=np.arange(self.a,self.b,dn) - y_vals=np.arange(self.a,self.b,dn) - points=[] - for x_val in x_vals: - for y_val in y_vals: - points+=[self.coords_to_point(x_val,y_val)] - return points - - def get_endpoints_of_curve(self): - dots=[[1,1],[0,0]] - dot_labels= ["(1,1)","(0,0)"] - for dot,label in zip(dots,dot_labels): - dot=Dot(self.coords_to_point(*dot)).set_color(RED) - dot_label=TexMobject(label) - dot_label.next_to(dot,DR) - self.add(dot,dot_label) - self.end_points=dots - - def show_line_integral(self): - int_text=TexMobject( - "\\int_\\text{\\textbf{path}}\\vec F \\cdot d\\vec r= 1", - color=BLUE, - stroke_width=1.5 - ).scale(1.2) - int_text[0][0].set_color(RED_C) - int_text[0][5:7].set_color(TEAL) - int_text.to_edge(RIGHT+UP,buff=1) - - close_int=TexMobject("O").set_color(RED).scale(1.3) - close_int.move_to(int_text[0][0],OUT) - close_int_val=TexMobject("0",color=BLUE).scale(1.4) - close_int_val.move_to(int_text[0][-1],OUT) - - self.play(Write(int_text)) - - - self.show_method([[0,1]]) - self.play(Indicate(int_text)) - self.wait() - - self.show_method([[1,0]]) - self.play(Indicate(int_text)) - self.wait() - self.remove(int_text[0][-1]) - self.add(close_int) - - for i in range(2): - self.play(self.paths[i].rotate,PI) - self.play(Indicate(close_int)) - self.play(Write(close_int_val)) - self.wait() - - - def show_method(self,points): - points=points+self.end_points - paths=[] - for i in range(-1,len(points)-2): - path=Arrow( - self.coords_to_point(*points[i]), - self.coords_to_point(*points[i+1]), - buff=0 - ).set_color(BLUE) - paths+=VGroup(path) - self.play(GrowArrow(path),run_time=1.5) - - self.paths=paths - - - - - -#uploaded by Somnath Pandit. FSF2020_Fundamental_Theorem_of_Line_Integrals - - - diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_independent_of_path.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_independent_of_path.gif new file mode 100644 index 0000000..29c6d02 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_independent_of_path.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_independent_of_path.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_independent_of_path.py new file mode 100644 index 0000000..b9597b6 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file2_line_int_independent_of_path.py @@ -0,0 +1,174 @@ +from manimlib.imports import * + + +class LineIntegration(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "axes_color":BLACK, + "graph_origin": ORIGIN+1.2*DOWN, + "x_axis_width": 10, + "y_axis_height": 10 , + "x_axis_label": "", + "y_axis_label": "", + "x_tick_frequency": 1, + "y_tick_frequency": 1, + "default_vector_field_config": { + "delta_x": .6, + "delta_y": .6, + "min_magnitude": 0, + "max_magnitude": .5, + "colors": [GREEN,BLUE,BLUE,TEAL], + "length_func": lambda norm : .45*sigmoid(norm), + "opacity": .75, + "vector_config": { + "stroke_width":1.5 + }, + }, + + "a": .45,"b": 2, + "path_color": PURPLE + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + self.X=X ;self.Y=Y + + self.setup_axes(animate=False) + + + + + vector_field=self.get_vector_field( + lambda v: np.array([ + v[1]-self.graph_origin[1], + v[0]-self.graph_origin[0], + 0, + ]) + ) + vector_field_text=TexMobject( + "\\vec F(x,y)","=y\hat i+x\hat j", + stroke_width=1.5 + ).to_edge(TOP,buff=.2) + + vector_field_text[0][0:2].set_color(TEAL) + + grad_f=TexMobject( + "\\vec\\nabla f(x,y)", + stroke_width=1.5 + ) + grad_f[0][2].set_color(LIGHT_BROWN) + grad_f.move_to(vector_field_text[0]) + + self.add(vector_field,) + self.play(Write(vector_field_text)) + self.wait() + self.play( + ReplacementTransform( + vector_field_text[0],grad_f + ) + ) + self.get_endpoints_of_curve() + self.wait(.6) + vector_field.set_fill(opacity=.4) + self.show_line_integral() + self.wait(2) + + + + + + def get_vector_field(self,func,**kwargs): + config = dict() + config.update(self.default_vector_field_config) + config.update(kwargs) + vector_field= VectorField(func,**config) + + self.vector_field= vector_field + + return vector_field + + + + def get_endpoints_of_curve(self): + points=[[-3,0],[2,2]] + point_labels= ["P_i","P_f"] + for point,label in zip(points,point_labels): + dot=Dot(self.coords_to_point(*point)).set_color(RED) + dot_label=TexMobject(label) + dot_label.next_to(dot,DR,buff=.2) + self.play(FadeIn(VGroup(dot,dot_label))) + self.wait(.2) + + self.end_points=points + + def show_line_integral(self): + int_text=TexMobject( + r"\int_{P_i}^{P_f}\vec F \cdot d\vec r", + stroke_width=1.5, + ).scale(1.2) + int_text[0][0].set_color(self.path_color) + int_text[0][5:7].set_color(TEAL) + int_text.to_edge(RIGHT+UP,buff=1) + + int_value= TexMobject(r"=f(P_i)-f(P_f)", + stroke_width=1.5 + ).next_to(int_text,DOWN) + VGroup(int_value[0][1], + int_value[0][7] + ).set_color(LIGHT_BROWN) + + path_indepent_text=TextMobject( + r"Value of the Line Integral is\\ independent of Path",color=GOLD,stroke_width=2,).to_corner(DR,buff=1) + + path_indepent_text[0][-4:].set_color(self.path_color) + + + self.play(Write(VGroup( + int_text,int_value + )), + run_time=2 + ) + self.wait(1.5) + + + self.show_path([[0,1],[-1,2],[1,3]]) + self.play(Indicate(int_value)) + self.play(Uncreate(self.path)) + + self.show_path([[0,1]]) + self.play(Indicate(int_value)) + self.play(Uncreate(self.path)) + + self.show_path([[-1,1],[-1,-2],[-5,0],[-2,3.5],[1,1]]) + self.play(Indicate(int_value),run_time=2) + self.wait(.6) + + self.play(Write(path_indepent_text)) + + + + def show_path(self,points): + points=[self.end_points[0]]+points+[self.end_points[1]] + + path= VMobject() + path.set_points_smoothly([ + self.coords_to_point(*point) + for point in points + ]) + path.set_color(self.path_color) + self.play(ShowCreation(path),run_time=1.5) + + self.path=path + + + + + +#uploaded by Somnath Pandit. FSF2020_Fundamental_Theorem_of_Line_Integrals + + + diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file3_line_int_example.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file3_line_int_example.gif new file mode 100644 index 0000000..20ed081 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file3_line_int_example.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file3_line_int_example.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file3_line_int_example.py new file mode 100644 index 0000000..71506a3 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/fundamental-theorem-of-line-integral/file3_line_int_example.py @@ -0,0 +1,149 @@ +from manimlib.imports import * + + +class LineIntegration(GraphScene): + CONFIG = { + "x_min" : -1, + "x_max" : 2, + "y_min" : -1, + "y_max" : 2, + "graph_origin": ORIGIN+3*LEFT+1.5*DOWN, + "x_axis_width": 10, + "y_axis_height": 10 , + "x_tick_frequency": 1, + "y_tick_frequency": 1, + "default_vector_field_config": { + "delta_x": .5, + "delta_y": .5, + "min_magnitude": 0, + "max_magnitude": .5, + "colors": [GREEN,BLUE,BLUE,TEAL], + "length_func": lambda norm : .4*sigmoid(norm), + "opacity": .75, + "vector_config": { + "stroke_width":2 + }, + }, + + "a": .45,"b": 2, + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + self.X=X ;self.Y=Y + + self.setup_axes(animate=False) + + + + + vector_field=self.get_vector_field( + lambda v: np.array([ + v[1]-self.graph_origin[1], + v[0]-self.graph_origin[0], + 0, + ]) + ) + vector_field_text=TexMobject( + "\\vec F=y\hat i+x\hat j", + stroke_width=2 + ).to_corner(UR,buff=.75).scale(1.2) + + vector_field_text[0][0:3].set_color(TEAL), + self.add(vector_field,) + self.play(Write(vector_field_text)) + self.wait() + self.get_endpoints_of_curve() + self.wait(.6) + self.play( + vector_field_text.shift,5*LEFT, + + ) + vector_field.set_fill(opacity=.2) + self.show_line_integral() + self.wait(2) + + + + + + def get_vector_field(self,func,**kwargs): + config = dict() + config.update(self.default_vector_field_config) + config.update(kwargs) + vector_field= VectorField(func,**config) + + self.vector_field= vector_field + + return vector_field + + + + def get_endpoints_of_curve(self): + points=[[1,1],[0,0]] + point_labels= ["(1,1)","(0,0)"] + for point,label in zip(points,point_labels): + dot=Dot(self.coords_to_point(*point)).set_color(RED) + dot_label=TexMobject(label) + dot_label.next_to(dot,DR) + self.add(dot,dot_label) + self.end_points=points + + def show_line_integral(self): + int_text=TexMobject( + "\\int_\\text{\\textbf{path}}\\vec F \\cdot d\\vec r= 1", + color=BLUE, + stroke_width=1.5 + ).scale(1.2) + int_text[0][0].set_color(RED_C) + int_text[0][5:7].set_color(TEAL) + int_text.to_edge(RIGHT+UP,buff=1) + + close_int=TexMobject("O").set_color(RED).scale(1.3) + close_int.move_to(int_text[0][0],OUT) + close_int_val=TexMobject("0",color=BLUE).scale(1.4) + close_int_val.move_to(int_text[0][-1],OUT) + + self.play(Write(int_text)) + + + self.show_method([[0,1]]) + self.play(Indicate(int_text)) + self.wait() + + self.show_method([[1,0]]) + self.play(Indicate(int_text)) + self.wait() + self.remove(int_text[0][-1]) + self.add(close_int) + + for i in range(2): + self.play(self.paths[i].rotate,PI) + self.play(Indicate(close_int)) + self.play(Write(close_int_val)) + self.wait() + + + def show_method(self,points): + points=points+self.end_points + paths=[] + for i in range(-1,len(points)-2): + path=Arrow( + self.coords_to_point(*points[i]), + self.coords_to_point(*points[i+1]), + buff=0 + ).set_color(BLUE) + paths+=VGroup(path) + self.play(GrowArrow(path),run_time=1.5) + + self.paths=paths + + + + + +#uploaded by Somnath Pandit. FSF2020_Fundamental_Theorem_of_Line_Integrals + + + -- cgit From 5d7d773aadf04a88b3238853c60a2ea1217804b2 Mon Sep 17 00:00:00 2001 From: Archit Sangal Date: Wed, 10 Jun 2020 09:05:58 +0530 Subject: Rank Nullity Theorem --- .../The-Rank-Nullity-Theorem/file.txt | 2 + .../The-Rank-Nullity-Theorem/file1_RN_Theorem.py | 58 ++++++++++++++++++++++ .../The-Rank-Nullity-Theorem/file2_RN_Theorem1.py | 33 ++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file.txt create mode 100755 FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file1_RN_Theorem.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file2_RN_Theorem1.py (limited to 'FSF-2020') diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file.txt b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file.txt new file mode 100644 index 0000000..890fe45 --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file.txt @@ -0,0 +1,2 @@ +file 'RN_Theorem.mp4' +file 'RN_Theorem1.mp4' diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file1_RN_Theorem.py b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file1_RN_Theorem.py new file mode 100755 index 0000000..31330e2 --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file1_RN_Theorem.py @@ -0,0 +1,58 @@ +from manimlib.imports import * +class RN_Theorem(LinearTransformationScene): + def construct(self): + self.setup() + self.wait() + square = Square(fill_color=BLACK, fill_opacity=1,color = BLUE) + square.move_to(4*LEFT+4*DOWN) + square.scale(4) + self.play(ShowCreation(square)) + predim = TextMobject("Dimension of this vector space is 2") + predim.move_to(DOWN+4*LEFT) + predim.scale(0.75) + self.play(Write(predim)) + self.wait() + self.play(FadeOut(predim)) + afterlt = TextMobject("After Linear transformation") + afterlt.move_to(DOWN+4*LEFT) + afterlt.scale(0.75) + afterlt2 = TextMobject("Dimension of the vector space","remains to be 2") + afterlt2[0].move_to(2*DOWN+4*LEFT) + afterlt2[1].move_to(3*DOWN+4*LEFT) + afterlt2.scale(0.75) + matrix = [[1,1],[0,1]] + self.apply_matrix(matrix) + self.play(Write(afterlt)) + self.play(Write(afterlt2)) + self.wait() + nullity = TextMobject("Hence, nullity = 0") + nullity.move_to(DOWN+4*LEFT) + self.play(FadeOut(afterlt),FadeOut(afterlt2),Write(nullity)) + self.wait(1) + self.play(FadeOut(nullity)) + + predim = TextMobject("Let us look at another example") + predim.move_to(DOWN+4*LEFT) + predim.scale(0.75) + matrix = [[1,-1],[0,1]] + self.apply_matrix(matrix) + self.play(Write(predim)) + self.wait() + self.play(FadeOut(predim)) + afterlt = TextMobject("After Linear transformation") + afterlt.move_to(DOWN+4*LEFT) + afterlt.scale(0.75) + afterlt2 = TextMobject("Dimension of the vector space","changes to 1") + afterlt2[0].move_to(2*DOWN+4*LEFT) + afterlt2[1].move_to(3*DOWN+4*LEFT) + afterlt2.scale(0.75) + matrix = [[1,1],[1,1]] + self.apply_matrix(matrix) + self.play(Write(afterlt)) + self.play(Write(afterlt2)) + self.wait() + nullity = TextMobject("Hence, nullity = 1") + nullity.move_to(DOWN+4*LEFT) + self.play(FadeOut(afterlt),FadeOut(afterlt2),Write(nullity)) + self.wait(1) + self.play(FadeOut(nullity)) diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file2_RN_Theorem1.py b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file2_RN_Theorem1.py new file mode 100644 index 0000000..8f05ddd --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file2_RN_Theorem1.py @@ -0,0 +1,33 @@ +from manimlib.imports import * +class RN_Theorem1(LinearTransformationScene): + def construct(self): + self.setup() + self.wait() + square = Square(fill_color=BLACK, fill_opacity=1,color = BLUE) + square.move_to(4*LEFT+4*DOWN) + square.scale(4) + self.play(ShowCreation(square)) + predim = TextMobject("Another One") + predim.move_to(DOWN+4*LEFT) + predim.scale(0.75) + self.play(Write(predim)) + self.wait() + self.play(FadeOut(predim)) + afterlt = TextMobject("After Linear transformation") + afterlt.move_to(DOWN+4*LEFT) + afterlt.scale(0.75) + afterlt2 = TextMobject("Dimension of the vector space","changes to 0") + afterlt2[0].move_to(2*DOWN+4*LEFT) + afterlt2[1].move_to(3*DOWN+4*LEFT) + afterlt2.scale(0.75) + matrix = [[0,0],[0,0]] + self.apply_matrix(matrix) + self.play(Write(afterlt)) + self.play(Write(afterlt2)) + self.wait() + nullity = TextMobject("Hence, nullity = 2") + nullity.move_to(DOWN+4*LEFT) + #afterlt.scale(0.75) + self.play(FadeOut(afterlt),FadeOut(afterlt2),Write(nullity)) + self.wait(1) + self.play(FadeOut(nullity)) -- cgit From dd85fa70fa196fac02b88b84bdac4587a76139b8 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Wed, 10 Jun 2020 22:21:44 +0530 Subject: update with upgrade --- .../integrals-of-multivariable-functions/README.md | 4 + .../double-integrals/file6_doing_integration.gif | Bin 6661372 -> 3349455 bytes .../double-integrals/file6_doing_integration.py | 141 ++++++++++++--------- .../file7_int_process_of_example.gif | Bin 6100824 -> 3031924 bytes .../file7_int_process_of_example.py | 62 +++++++-- 5 files changed, 136 insertions(+), 71 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md index 221e78d..4de6c1d 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/README.md @@ -7,3 +7,7 @@ FSF2020--Somnath Pandit ## Fubini's Theorem ## Line Integrals + +## Fundamental Theorem of Line integrals + +## Vector Fields diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.gif index cafed44..7a9271b 100644 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.gif and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.py index 34d1769..5a8cec0 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.py +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file6_doing_integration.py @@ -5,13 +5,13 @@ class IntegrationProcess(SpecialThreeDScene): CONFIG = { "axes_config": { "x_min": 0, - "x_max": 8, + "x_max": 7, "y_min": 0, - "y_max": 8, + "y_max": 7, "z_min": 0, - "z_max": 6, + "z_max": 4, "a":1 ,"b": 6, "c":2 , "d":6, - "axes_shift":-3*OUT + 5*LEFT, + "axes_shift":-3*OUT, "x_axis_config": { "tick_frequency": 1, # "include_tip": False, @@ -37,7 +37,7 @@ class IntegrationProcess(SpecialThreeDScene): "stroke_color": WHITE, "stroke_opacity": 0.5, }, - "Func": lambda x,y: 2+y/4+np.cos(x) + "Func": lambda x,y: 2+y/4+np.cos(x/1.4) } @@ -45,31 +45,34 @@ class IntegrationProcess(SpecialThreeDScene): self.setup_axes() axes=self.axes + + self.camera.frame_center.shift(axes.c2p(3,4,1.7)) self.set_camera_orientation(distance=35, - phi=85 * DEGREES, - theta=-80 * DEGREES, + phi= 80 * DEGREES, + theta= -80 * DEGREES, + gamma = 0 * DEGREES ) fn_text=TextMobject("$z=f(x,y)$").set_color(PINK) self.add_fixed_in_frame_mobjects(fn_text) - fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) + R=TextMobject("R").set_color(BLACK).scale(3) R.move_to(axes.input_plane,IN) self.add(R) - #get the surface + # get the surface surface= self.get_surface( axes, lambda x , y: self.Func(x,y) ) surface.set_style( - fill_opacity=0.75, + fill_opacity=.65, fill_color=PINK, stroke_width=0.8, stroke_color=WHITE, ) - + fn_text.next_to(surface,UP,buff=MED_LARGE_BUFF) slice_curve=(self.get_y_slice_graph( axes,self.Func,5,color=YELLOW)) @@ -79,10 +82,10 @@ class IntegrationProcess(SpecialThreeDScene): self.add(surface) self.get_lines() - + self.show_process(axes) - self.wait(2) + self.wait(3) @@ -90,6 +93,7 @@ class IntegrationProcess(SpecialThreeDScene): y_tracker = ValueTracker(axes.c) self.y_tracker=y_tracker y=y_tracker.get_value + graph = always_redraw( lambda: self.get_y_slice_graph( axes, self.Func, y(), @@ -107,24 +111,67 @@ class IntegrationProcess(SpecialThreeDScene): ], *[ axes.c2p(x, y(), 0) - for x in [ axes.b, axes.a,] + for x in [ axes.b, axes.a,] ], - stroke_width=0, + stroke_width=2, + fill_color=BLUE_D, + fill_opacity=.4, + )) + + plane_side1 = always_redraw(lambda: Polygon( + *[ + axes.c2p(axes.a,y,self.Func(axes.a,y)) + for y in np.arange(axes.c,y(),0.01) + ], + *[ + axes.c2p(axes.a, y, 0) + for y in [ y(),axes.c, ] + ], + stroke_width=2.5, + fill_color=BLUE_C, + fill_opacity=.2, + )) + plane_side2 = always_redraw(lambda: Polygon( + *[ + axes.c2p(axes.b,y,self.Func(axes.b,y)) + for y in np.arange(axes.c,y(),0.01) + ], + *[ + axes.c2p(axes.b, y, 0) + for y in [y(),axes.c,] + ], + stroke_width=2.5, fill_color=BLUE_E, - fill_opacity=.5, + fill_opacity=.45, )) plane.suspend_updating() + plane_side1.suspend_updating() + plane_side2.suspend_updating() + + self.play(Write(VGroup(graph,plane)),run_time=2) + self.add(plane.copy(),plane_side1,plane_side2) + + + plane_side1.resume_updating() + plane_side2.resume_updating() - self.play(Write(VGroup(graph,plane)),run_time=4) - graph.resume_updating() - plane.resume_updating() + self.move_camera( + distance=30, + phi= 85 * DEGREES, + theta= -10 * DEGREES, + run_time=1.5 + ) self.play( ApplyMethod( y_tracker.set_value, axes.d, rate_func=linear, run_time=6, - ) + ) ) + plane.suspend_updating() + plane_side1.suspend_updating() + plane_side2.suspend_updating() + def get_y_slice_graph(self, axes, func, y, **kwargs): @@ -142,35 +189,7 @@ class IntegrationProcess(SpecialThreeDScene): **config, ) return slice_curve - - '''def get_y_slice_plane(self, axes): - self.y_tracker=y_tracker - y=y_tracker.get_value() - curve_points=[ - axes.c2p(x,y,self.Func(x,y)) - for x in np.arange(axes.a,axes.b,0.01) - ] - base_points=[ - axes.c2p(x, y, 0) - for x in [ axes.b, axes.a,] - ] - plane_points= curve_points+base_points - plane = always_redraw(lambda: Polygon( - *plane_points, - stroke_width=.4, - fill_color=BLUE, - fill_opacity=0.2 - )) - plane.add_updater(lambda m: m.shift( - axes.c2p( - axes.a, - y_tracker.get_value(), - 1, - ) - plane.points[0] - )) - plane.y_tracker = y_tracker - - return plane ''' + def get_surface(self,axes, func, **kwargs): config = { @@ -195,9 +214,6 @@ class IntegrationProcess(SpecialThreeDScene): 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: @@ -207,13 +223,17 @@ class IntegrationProcess(SpecialThreeDScene): for start , end in zip(surface_corners, self.region_corners): lines.add(self.draw_lines(start,end,"RED")) - + + labels=[ + (axes.a,0,0), + (axes.b,0,0), + (0,axes.d,0), + (0,axes.c,0) + ] + self.region_corners[-1]=self.region_corners[0] 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)) + lines.add(self.draw_lines(start,end,"WHITE")) self.add(lines) @@ -223,7 +243,10 @@ class IntegrationProcess(SpecialThreeDScene): line=DashedLine(start,end,color=color) return line - + + +#------------------------------------------------------------ + #customize 3d axes def get_three_d_axes(self, include_labels=True, include_numbers=True, **kwargs): config = dict(self.axes_config) config.update(kwargs) @@ -260,7 +283,7 @@ class IntegrationProcess(SpecialThreeDScene): axes.input_plane = input_plane self.region_corners=[ - input_plane.get_corner(pos) for pos in (DL,DR,UR,UL)] + input_plane.get_corner(pos) for pos in (DL,DR,UL,UR)] return axes diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.gif index d48656b..9fbdde8 100644 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.gif and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.py index ab9337d..f733761 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.py +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file7_int_process_of_example.py @@ -113,7 +113,35 @@ class IntegrationProcess(SpecialThreeDScene): fill_color=BLUE_E, fill_opacity=.65, )) + plane_side1 = always_redraw(lambda: Polygon( + *[ + axes.c2p(axes.a,y,self.Func(axes.a,y)) + for y in np.arange(axes.c,y(),0.01) + ], + *[ + axes.c2p(axes.a, y, 0) + for y in [ y(),axes.c, ] + ], + stroke_width=2.5, + fill_color=BLUE_C, + fill_opacity=.2, + )) + plane_side2 = always_redraw(lambda: Polygon( + *[ + axes.c2p(axes.b,y,self.Func(axes.b,y)) + for y in np.arange(axes.c,y(),0.01) + ], + *[ + axes.c2p(axes.b, y, 0) + for y in [y(),axes.c,] + ], + stroke_width=2.5, + fill_color=BLUE_E, + fill_opacity=.45, + )) plane.suspend_updating() + plane_side1.suspend_updating() + plane_side2.suspend_updating() first_x_text=TextMobject("First the $x$ integration..",color=YELLOW) first_x_text.to_corner(UR,buff=1.1) @@ -138,8 +166,11 @@ class IntegrationProcess(SpecialThreeDScene): self.remove(first_x_text) self.add_fixed_in_frame_mobjects(then_y_text) self.play(Write(then_y_text)) + self.add(plane.copy(),plane_side1,plane_side2) graph.resume_updating() plane.resume_updating() + plane_side1.resume_updating() + plane_side2.resume_updating() self.play( ApplyMethod( y_tracker.set_value, axes.d, @@ -148,6 +179,11 @@ class IntegrationProcess(SpecialThreeDScene): ) ) + graph.suspend_updating() + plane.suspend_updating() + plane_side1.suspend_updating() + plane_side2.suspend_updating() + def get_y_slice_graph(self, axes, func, y, **kwargs): config = dict() @@ -189,9 +225,6 @@ class IntegrationProcess(SpecialThreeDScene): 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: @@ -201,13 +234,17 @@ class IntegrationProcess(SpecialThreeDScene): for start , end in zip(surface_corners, self.region_corners): lines.add(self.draw_lines(start,end,"RED")) - + + labels=[ + (axes.a,0,0), + (axes.b,0,0), + (0,axes.d,0), + (0,axes.c,0) + ] + self.region_corners[-1]=self.region_corners[0] 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)) + lines.add(self.draw_lines(start,end,"WHITE")) self.add(lines) @@ -217,9 +254,10 @@ class IntegrationProcess(SpecialThreeDScene): line=DashedLine(start,end,color=color) return line - - - #customize 3D axes + + +#------------------------------------------------------------ + #customize 3d axes def get_three_d_axes(self, include_labels=True, include_numbers=True, **kwargs): config = dict(self.axes_config) config.update(kwargs) @@ -256,7 +294,7 @@ class IntegrationProcess(SpecialThreeDScene): axes.input_plane = input_plane self.region_corners=[ - input_plane.get_corner(pos) for pos in (DL,DR,UR,UL)] + input_plane.get_corner(pos) for pos in (DL,DR,UL,UR)] return axes -- cgit From bd056f51d28e6ca31c103cc53f43a728b81a1387 Mon Sep 17 00:00:00 2001 From: Archit Sangal Date: Thu, 11 Jun 2020 01:00:25 +0530 Subject: fig 5 changed to video 3 --- .../file5_linear_transformation.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_linear_transformation.py (limited to 'FSF-2020') diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_linear_transformation.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_linear_transformation.py new file mode 100755 index 0000000..01a0cef --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_linear_transformation.py @@ -0,0 +1,27 @@ +from manimlib.imports import * +class LinearTrans(LinearTransformationScene,MovingCameraScene): + CONFIG = { + "basis_vector_stroke_width": 1, + "leave_ghost_vectors": True, + } + + def setup(self): + LinearTransformationScene.setup(self) + MovingCameraScene.setup(self) + + def construct(self): + self.setup() + self.camera_frame.save_state() + self.play(self.camera_frame.set_width, 7) + matrix = [[0.866,-0.5],[0.5,0.866]] + self.apply_matrix(matrix) + arc1 = Arc(radius = 0.25,angle=TAU/12) + arc2 = Arc(radius = 0.25,angle=TAU/12,start_angle=TAU/4) + text1 = TextMobject(r"$\theta$") + text1.scale(0.5) + text1.move_to(0.5*UP+0.125*LEFT) + text2 = TextMobject(r"$\theta$") + text2.scale(0.5) + text2.move_to(0.5*RIGHT+0.125*UP) + self.play(ShowCreation(arc1),ShowCreation(arc2),Write(text1),Write(text2),run_time=1) + self.wait() -- cgit From a047a2081ef749f6acc6d9505828fbfbecbcf90a Mon Sep 17 00:00:00 2001 From: Archit Sangal Date: Thu, 11 Jun 2020 15:41:39 +0530 Subject: updated Linear Transformation(Maps) --- .../Linear-Transformations-(Linear-Maps)/file.txt | 3 + ...1_Understand_Linear_Transformations_visually.py | 193 --------------------- .../file1_transformations.py | 45 +++++ ...2_Understand_Linear_Transformations_visually.py | 193 +++++++++++++++++++++ .../file2_Uniform_Scaling.py | 91 ---------- .../file3_Horizontal_Shear.py | 53 ------ .../file3_Horizontal_Shear_gif.gif | Bin 1566999 -> 0 bytes .../file3_Uniform_Scaling.py | 91 ++++++++++ .../file4_Horizontal_Shear.py | 53 ++++++ .../file4_Horizontal_Shear_gif.gif | Bin 0 -> 1566999 bytes .../file4_Vertical_Shear.py | 52 ------ .../file4_Vertical_Shear_gif.gif | Bin 1347079 -> 0 bytes .../file5_Vertical_Shear.py | 52 ++++++ .../file5_Vertical_Shear_gif.gif | Bin 0 -> 1347079 bytes .../file5_linear_transformation.py | 27 --- .../file6_linear_transformation.py | 27 +++ 16 files changed, 464 insertions(+), 416 deletions(-) create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file.txt delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_Understand_Linear_Transformations_visually.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_transformations.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Understand_Linear_Transformations_visually.py delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Uniform_Scaling.py delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear.py delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear_gif.gif create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Uniform_Scaling.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Horizontal_Shear.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Horizontal_Shear_gif.gif delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear.py delete mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear_gif.gif create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_Vertical_Shear.py create mode 100644 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_Vertical_Shear_gif.gif delete mode 100755 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_linear_transformation.py create mode 100755 FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file6_linear_transformation.py (limited to 'FSF-2020') diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file.txt b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file.txt new file mode 100644 index 0000000..cae98ce --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file.txt @@ -0,0 +1,3 @@ +file 'text.mp4' +file 'LinearTransformation.mp4' +file 'NonLinearTransformation.mp4' diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_Understand_Linear_Transformations_visually.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_Understand_Linear_Transformations_visually.py deleted file mode 100644 index 577032d..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_Understand_Linear_Transformations_visually.py +++ /dev/null @@ -1,193 +0,0 @@ -from manimlib.imports import * - -class Rotation(GraphScene): - CONFIG = { - "x_min" : -5, - "x_max" : 5, - "y_min" : -5, - "y_max" : 5, - "graph_origin" : ORIGIN+3.5*LEFT, - "x_axis_width" : 7, - "y_axis_height" : 7 - #"x_labeled_nums" : list(range(-5,6)), - #"y_labeled_nums" : list(range(-5,6)), - } - - def construct(self): - XTD = self.x_axis_width/(self.x_max-self.x_min) - YTD = self.y_axis_height/(self.y_max-self.y_min) - - introText = TextMobject("Understanding Linear Transformations") - self.play(Write(introText)) - self.wait(1) - - introText1 = TextMobject("Visually ... ") - introText1.move_to(DOWN) - self.play(Write(introText1)) - self.wait(1) - self.play(FadeOut(introText), FadeOut(introText1)) - - Text1 = TextMobject("Let $\overrightarrow{v}$ be $2\hat{i}+3\hat{j}$") - Text2 = TextMobject("$\overrightarrow{v} = 2\hat{i}+3\hat{j}$") - - Text1.move_to(4*RIGHT+2*UP) - Text2.move_to(4*RIGHT+1*UP) - self.play(Write(Text1)) - self.wait() - self.play(Transform(Text1,Text2)) - - self.setup_axes(animate=True) - arrow_v = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*LEFT + 0.25*DOWN, end = self.graph_origin+2*XTD*RIGHT+3*YTD*UP+ 0.15*RIGHT + 0.25*UP) - self.play(ShowCreation(arrow_v)) - - Text_i = TextMobject("$\hat{i}$") - Text_i.move_to(self.graph_origin+0.5*XTD*RIGHT+0.5*YTD*DOWN) - Text_i.scale(0.75) - Text_j = TextMobject("$\hat{j}$") - Text_j.move_to(self.graph_origin+0.5*XTD*LEFT+0.5*YTD*UP) - Text_j.scale(0.75) - - arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*YTD*UP+0.25*UP) - self.play(ShowCreation(arrow_i), ShowCreation(arrow_j), Write(Text_i), Write(Text_j)) - - Text_2i = TextMobject("$2\hat{i}$") - Text_2i.move_to(self.graph_origin+1*XTD*RIGHT+1*YTD*DOWN) - Text_3j = TextMobject("$3\hat{j}$") - Text_3j.move_to(self.graph_origin+1*XTD*LEFT+1.5*YTD*UP) - - arrow_2i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+2*XTD*RIGHT+ 0.25*RIGHT) - arrow_2i.set_color(YELLOW) - arrow_3j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+3*YTD*UP+0.25*UP) - arrow_3j.set_color(RED) - self.wait(0.5) - self.play(Transform(arrow_i,arrow_2i), Transform(arrow_j,arrow_3j), Transform(Text_i,Text_2i), Transform(Text_j,Text_3j)) - self.play(ApplyMethod(arrow_j.move_to,self.graph_origin+2*XTD*RIGHT+1.5*YTD*UP) , ApplyMethod(Text_j.move_to,self.graph_origin+2.5*XTD*RIGHT+1.5*YTD*UP+ 0.15*RIGHT + 0.25*UP)) - - new_Text_v = TextMobject("$\overrightarrow{v}$") - new_Text_v.move_to(self.graph_origin+0.5*XTD*RIGHT+1.5*YTD*UP) - self.play(Write(new_Text_v)) - - new_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - new_arrow_i.set_color(YELLOW) - new_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*YTD*UP+0.25*UP) - new_arrow_j.set_color(RED) - - new_Text_i = TextMobject("$\hat{i}$") - new_Text_i.move_to(self.graph_origin+0.5*XTD*RIGHT+0.5*YTD*DOWN) - new_Text_i.scale(0.75) - new_Text_j = TextMobject("$\hat{j}$") - new_Text_j.move_to(self.graph_origin+0.5*XTD*LEFT+0.5*YTD*UP) - new_Text_j.scale(0.75) - - self.wait(1) - - self.play(FadeOut(Text_i), - FadeOut(Text_j), - FadeOut(arrow_i), - FadeOut(arrow_j), - ShowCreation(new_arrow_i), - ShowCreation(new_arrow_j), - Write(new_Text_i), - Write(new_Text_j)) - - self.play(ApplyMethod(Text1.move_to,4*RIGHT)) - Text3 = TextMobject("Let the be a linear transformation function") - Text3.scale(0.5) - Text4 = TextMobject("$T$ which rotates the vectors by angle of $90^{\circ}$") - Text4.scale(0.5) - Text3.move_to(4*RIGHT+3*UP) - Text4.move_to(4*RIGHT+2.5*UP) - self.play(Write(Text3), Write(Text4)) - self.wait(2) - - Text6 = TextMobject(r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") - Text6.scale(0.75) - Text6.set_color(YELLOW) - Text6.move_to(self.graph_origin+1*XTD*RIGHT+1*YTD*DOWN) - Text7 = TextMobject(r"$\begin{pmatrix} 0 \\ 1 \end{pmatrix}$") - Text7.scale(0.75) - Text7.set_color(RED) - Text7.move_to(self.graph_origin+1*XTD*LEFT+1*YTD*UP) - - self.play(Transform(new_Text_i,Text6)) - self.play(Transform(new_Text_j,Text7)) - - Text5 = TextMobject(r"$\overrightarrow{v} = 2 $", r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$", r"+3", r"$\begin{pmatrix} 0 \\ 1 \end{pmatrix}$") - Text5[1].set_color(YELLOW) - Text5[3].set_color(RED) - Text5.move_to(4*RIGHT) - - self.play(Transform(Text1, Text5)) - self.wait() - - arrow_modified_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*UP, end = self.graph_origin-(1*YTD*UP+0.25*UP)) - arrow_modified_i.set_color(YELLOW) - arrow_modified_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - arrow_modified_j.set_color(RED) - - yellow_i = TextMobject(r"$\begin{pmatrix} 0 \\ -1 \end{pmatrix}$") - yellow_i.set_color(YELLOW).scale(0.75) - yellow_i.move_to(self.graph_origin + 1*XTD*DOWN + 1*YTD*LEFT) - - red_j = TextMobject(r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") - red_j.set_color(RED).scale(0.75) - red_j.move_to(self.graph_origin + 1*XTD*UP + 1*YTD*RIGHT) - - Text8 = TextMobject(r"$\overrightarrow{v}_{transformed} = 2 $", r"$\begin{pmatrix} 0 \\ -1 \end{pmatrix}$", r"+3", r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") - Text8[1].set_color(YELLOW) - Text8[3].set_color(RED) - Text8.move_to(4*RIGHT+1.5*DOWN) - Text8.scale(0.75) - - new_Text__v = TextMobject("$\overrightarrow{v}_{transformed}$") - new_Text__v.scale(0.75) - arrow_modified_v = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT + 0.15*UP, end = self.graph_origin+2*XTD*DOWN+3*YTD*RIGHT+ 0.15*DOWN + 0.25*RIGHT) - self.play(Transform(arrow_v, arrow_modified_v), - Transform(new_arrow_i, arrow_modified_i), - Transform(new_arrow_j, arrow_modified_j), - Transform(new_Text_i,yellow_i), - Transform(new_Text_j,red_j), - FadeOut(new_Text_v), - ApplyMethod(new_Text__v.move_to,self.graph_origin+3*XTD*RIGHT+0.5*YTD*DOWN), - Write(Text8)) - - self.play(FadeOut(Text1), FadeOut(Text3), FadeOut(Text4), ApplyMethod(Text8.move_to,4*RIGHT+3*UP)) - - Text9 = TextMobject(r"$\overrightarrow{v}_{transformed} = 2 $", r"$\hat{i}_{transformed}$", r"+3", r"$\hat{j}_{transformed}$") - Text9[1].set_color(YELLOW) - Text9[3].set_color(RED) - Text9.move_to(4*RIGHT+2*UP) - Text9.scale(0.5) - - self.play(Write(Text9)) - - v_transformed = TextMobject(r"$\overrightarrow{v}_{transformed} \equiv T(\overrightarrow{v})$") - v_transformed.scale(0.75).move_to(4*RIGHT+UP) - i_transformed = TextMobject(r"$\hat{i}_{transformed} \equiv T(\hat{i})$") - i_transformed.set_color(YELLOW).scale(0.75).move_to(4*RIGHT) - j_transformed = TextMobject(r"$\hat{v}_{transformed} \equiv T(\hat{j})$") - j_transformed.set_color(RED).scale(0.75).move_to(4*RIGHT+DOWN) - - self.play(Write(v_transformed), Write(i_transformed), Write(j_transformed)) - self.wait(3) - - Text10 = TextMobject(r"$T(\overrightarrow{v}) = $", r"$\begin{pmatrix} 3 \\ -2 \end{pmatrix}$") - Text10[1].set_color(BLUE_E) - Text10.move_to(4*RIGHT+1*UP) - Text10.scale(0.75) - - self.play(Write(Text10), ApplyMethod(v_transformed.move_to,4*RIGHT+2*UP), FadeOut(i_transformed), FadeOut(j_transformed), FadeOut(Text9)) - self.wait(1) - - self.play(FadeOut(self.axes), - FadeOut(arrow_v), - FadeOut(new_arrow_i), - FadeOut(new_arrow_j), - FadeOut(new_Text_i), - FadeOut(new_Text_i), - FadeOut(new_Text_j), - FadeOut(new_Text__v), - FadeOut(Text10), - FadeOut(v_transformed), - FadeOut(Text8)) diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_transformations.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_transformations.py new file mode 100644 index 0000000..677f890 --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_transformations.py @@ -0,0 +1,45 @@ +from manimlib.imports import * + +class text(Scene): + def construct(self): + text1 = TextMobject("For a grid, undergoing a linear transformation, all it's straight lines") + text1.scale(0.9) + text2 = TextMobject("must either remain straight lines or sends to a point in the grid formed") + text2.scale(0.9) + text1.move_to(ORIGIN+UP) + text2.move_to(ORIGIN) + self.play(Write(text1)) + self.play(Write(text2)) + self.wait() + self.play(FadeOut(text1),FadeOut(text2)) + +class LinearTransformation(LinearTransformationScene): + CONFIG = { + "basis_vector_stroke_width": 3, + "leave_ghost_vectors": True, + } + + def construct(self): + self.setup() + matrix = [[0.866,-0.5],[0.5,0.866]] + self.apply_matrix(matrix) + text = TextMobject("This is a Linear","Trasformation") + text[0].move_to(DOWN+4*LEFT) + text[1].move_to(1.5*DOWN+4*LEFT) + text.add_background_rectangle() + self.play(Write(text)) + self.wait() + +class NonLinearTransformation(Scene): + def construct(self): + grid = NumberPlane() + self.play(ShowCreation(grid),run_time =2) + NonLinearTrans = lambda coordinates : coordinates + np.array([np.sin(coordinates[1]),np.sin(coordinates[0]),0,]) + grid.prepare_for_nonlinear_transform() + self.play(grid.apply_function,NonLinearTrans) + text = TextMobject("While, this is not a","Linear Trasformation") + text[0].move_to(DOWN+4*LEFT) + text[1].move_to(1.5*DOWN+4*LEFT) + text.add_background_rectangle() + self.play(Write(text)) + self.wait() \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Understand_Linear_Transformations_visually.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Understand_Linear_Transformations_visually.py new file mode 100644 index 0000000..577032d --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Understand_Linear_Transformations_visually.py @@ -0,0 +1,193 @@ +from manimlib.imports import * + +class Rotation(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "graph_origin" : ORIGIN+3.5*LEFT, + "x_axis_width" : 7, + "y_axis_height" : 7 + #"x_labeled_nums" : list(range(-5,6)), + #"y_labeled_nums" : list(range(-5,6)), + } + + def construct(self): + XTD = self.x_axis_width/(self.x_max-self.x_min) + YTD = self.y_axis_height/(self.y_max-self.y_min) + + introText = TextMobject("Understanding Linear Transformations") + self.play(Write(introText)) + self.wait(1) + + introText1 = TextMobject("Visually ... ") + introText1.move_to(DOWN) + self.play(Write(introText1)) + self.wait(1) + self.play(FadeOut(introText), FadeOut(introText1)) + + Text1 = TextMobject("Let $\overrightarrow{v}$ be $2\hat{i}+3\hat{j}$") + Text2 = TextMobject("$\overrightarrow{v} = 2\hat{i}+3\hat{j}$") + + Text1.move_to(4*RIGHT+2*UP) + Text2.move_to(4*RIGHT+1*UP) + self.play(Write(Text1)) + self.wait() + self.play(Transform(Text1,Text2)) + + self.setup_axes(animate=True) + arrow_v = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*LEFT + 0.25*DOWN, end = self.graph_origin+2*XTD*RIGHT+3*YTD*UP+ 0.15*RIGHT + 0.25*UP) + self.play(ShowCreation(arrow_v)) + + Text_i = TextMobject("$\hat{i}$") + Text_i.move_to(self.graph_origin+0.5*XTD*RIGHT+0.5*YTD*DOWN) + Text_i.scale(0.75) + Text_j = TextMobject("$\hat{j}$") + Text_j.move_to(self.graph_origin+0.5*XTD*LEFT+0.5*YTD*UP) + Text_j.scale(0.75) + + arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*YTD*UP+0.25*UP) + self.play(ShowCreation(arrow_i), ShowCreation(arrow_j), Write(Text_i), Write(Text_j)) + + Text_2i = TextMobject("$2\hat{i}$") + Text_2i.move_to(self.graph_origin+1*XTD*RIGHT+1*YTD*DOWN) + Text_3j = TextMobject("$3\hat{j}$") + Text_3j.move_to(self.graph_origin+1*XTD*LEFT+1.5*YTD*UP) + + arrow_2i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+2*XTD*RIGHT+ 0.25*RIGHT) + arrow_2i.set_color(YELLOW) + arrow_3j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+3*YTD*UP+0.25*UP) + arrow_3j.set_color(RED) + self.wait(0.5) + self.play(Transform(arrow_i,arrow_2i), Transform(arrow_j,arrow_3j), Transform(Text_i,Text_2i), Transform(Text_j,Text_3j)) + self.play(ApplyMethod(arrow_j.move_to,self.graph_origin+2*XTD*RIGHT+1.5*YTD*UP) , ApplyMethod(Text_j.move_to,self.graph_origin+2.5*XTD*RIGHT+1.5*YTD*UP+ 0.15*RIGHT + 0.25*UP)) + + new_Text_v = TextMobject("$\overrightarrow{v}$") + new_Text_v.move_to(self.graph_origin+0.5*XTD*RIGHT+1.5*YTD*UP) + self.play(Write(new_Text_v)) + + new_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + new_arrow_i.set_color(YELLOW) + new_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*YTD*UP+0.25*UP) + new_arrow_j.set_color(RED) + + new_Text_i = TextMobject("$\hat{i}$") + new_Text_i.move_to(self.graph_origin+0.5*XTD*RIGHT+0.5*YTD*DOWN) + new_Text_i.scale(0.75) + new_Text_j = TextMobject("$\hat{j}$") + new_Text_j.move_to(self.graph_origin+0.5*XTD*LEFT+0.5*YTD*UP) + new_Text_j.scale(0.75) + + self.wait(1) + + self.play(FadeOut(Text_i), + FadeOut(Text_j), + FadeOut(arrow_i), + FadeOut(arrow_j), + ShowCreation(new_arrow_i), + ShowCreation(new_arrow_j), + Write(new_Text_i), + Write(new_Text_j)) + + self.play(ApplyMethod(Text1.move_to,4*RIGHT)) + Text3 = TextMobject("Let the be a linear transformation function") + Text3.scale(0.5) + Text4 = TextMobject("$T$ which rotates the vectors by angle of $90^{\circ}$") + Text4.scale(0.5) + Text3.move_to(4*RIGHT+3*UP) + Text4.move_to(4*RIGHT+2.5*UP) + self.play(Write(Text3), Write(Text4)) + self.wait(2) + + Text6 = TextMobject(r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") + Text6.scale(0.75) + Text6.set_color(YELLOW) + Text6.move_to(self.graph_origin+1*XTD*RIGHT+1*YTD*DOWN) + Text7 = TextMobject(r"$\begin{pmatrix} 0 \\ 1 \end{pmatrix}$") + Text7.scale(0.75) + Text7.set_color(RED) + Text7.move_to(self.graph_origin+1*XTD*LEFT+1*YTD*UP) + + self.play(Transform(new_Text_i,Text6)) + self.play(Transform(new_Text_j,Text7)) + + Text5 = TextMobject(r"$\overrightarrow{v} = 2 $", r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$", r"+3", r"$\begin{pmatrix} 0 \\ 1 \end{pmatrix}$") + Text5[1].set_color(YELLOW) + Text5[3].set_color(RED) + Text5.move_to(4*RIGHT) + + self.play(Transform(Text1, Text5)) + self.wait() + + arrow_modified_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*UP, end = self.graph_origin-(1*YTD*UP+0.25*UP)) + arrow_modified_i.set_color(YELLOW) + arrow_modified_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + arrow_modified_j.set_color(RED) + + yellow_i = TextMobject(r"$\begin{pmatrix} 0 \\ -1 \end{pmatrix}$") + yellow_i.set_color(YELLOW).scale(0.75) + yellow_i.move_to(self.graph_origin + 1*XTD*DOWN + 1*YTD*LEFT) + + red_j = TextMobject(r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") + red_j.set_color(RED).scale(0.75) + red_j.move_to(self.graph_origin + 1*XTD*UP + 1*YTD*RIGHT) + + Text8 = TextMobject(r"$\overrightarrow{v}_{transformed} = 2 $", r"$\begin{pmatrix} 0 \\ -1 \end{pmatrix}$", r"+3", r"$\begin{pmatrix} 1 \\ 0 \end{pmatrix}$") + Text8[1].set_color(YELLOW) + Text8[3].set_color(RED) + Text8.move_to(4*RIGHT+1.5*DOWN) + Text8.scale(0.75) + + new_Text__v = TextMobject("$\overrightarrow{v}_{transformed}$") + new_Text__v.scale(0.75) + arrow_modified_v = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT + 0.15*UP, end = self.graph_origin+2*XTD*DOWN+3*YTD*RIGHT+ 0.15*DOWN + 0.25*RIGHT) + self.play(Transform(arrow_v, arrow_modified_v), + Transform(new_arrow_i, arrow_modified_i), + Transform(new_arrow_j, arrow_modified_j), + Transform(new_Text_i,yellow_i), + Transform(new_Text_j,red_j), + FadeOut(new_Text_v), + ApplyMethod(new_Text__v.move_to,self.graph_origin+3*XTD*RIGHT+0.5*YTD*DOWN), + Write(Text8)) + + self.play(FadeOut(Text1), FadeOut(Text3), FadeOut(Text4), ApplyMethod(Text8.move_to,4*RIGHT+3*UP)) + + Text9 = TextMobject(r"$\overrightarrow{v}_{transformed} = 2 $", r"$\hat{i}_{transformed}$", r"+3", r"$\hat{j}_{transformed}$") + Text9[1].set_color(YELLOW) + Text9[3].set_color(RED) + Text9.move_to(4*RIGHT+2*UP) + Text9.scale(0.5) + + self.play(Write(Text9)) + + v_transformed = TextMobject(r"$\overrightarrow{v}_{transformed} \equiv T(\overrightarrow{v})$") + v_transformed.scale(0.75).move_to(4*RIGHT+UP) + i_transformed = TextMobject(r"$\hat{i}_{transformed} \equiv T(\hat{i})$") + i_transformed.set_color(YELLOW).scale(0.75).move_to(4*RIGHT) + j_transformed = TextMobject(r"$\hat{v}_{transformed} \equiv T(\hat{j})$") + j_transformed.set_color(RED).scale(0.75).move_to(4*RIGHT+DOWN) + + self.play(Write(v_transformed), Write(i_transformed), Write(j_transformed)) + self.wait(3) + + Text10 = TextMobject(r"$T(\overrightarrow{v}) = $", r"$\begin{pmatrix} 3 \\ -2 \end{pmatrix}$") + Text10[1].set_color(BLUE_E) + Text10.move_to(4*RIGHT+1*UP) + Text10.scale(0.75) + + self.play(Write(Text10), ApplyMethod(v_transformed.move_to,4*RIGHT+2*UP), FadeOut(i_transformed), FadeOut(j_transformed), FadeOut(Text9)) + self.wait(1) + + self.play(FadeOut(self.axes), + FadeOut(arrow_v), + FadeOut(new_arrow_i), + FadeOut(new_arrow_j), + FadeOut(new_Text_i), + FadeOut(new_Text_i), + FadeOut(new_Text_j), + FadeOut(new_Text__v), + FadeOut(Text10), + FadeOut(v_transformed), + FadeOut(Text8)) diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Uniform_Scaling.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Uniform_Scaling.py deleted file mode 100644 index a7856a5..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_Uniform_Scaling.py +++ /dev/null @@ -1,91 +0,0 @@ -from manimlib.imports import * - -class Scaling(GraphScene): - CONFIG = { - "x_min" : -5, - "x_max" : 5, - "y_min" : -5, - "y_max" : 5, - "graph_origin" : ORIGIN+3.5*LEFT, - "x_axis_width" : 7, - "y_axis_height" : 7 - #"x_labeled_nums" : list(range(-5,6)), - #"y_labeled_nums" : list(range(-5,6)), - } - - def construct(self): - XTD = self.x_axis_width/(self.x_max-self.x_min) - YTD = self.y_axis_height/(self.y_max-self.y_min) - - introText = TextMobject("Scaling") - self.play(Write(introText)) - self.wait(1) - self.play(FadeOut(introText)) - - introText = TextMobject("Uniform Scaling") - self.play(Write(introText)) - self.wait(1) - self.play(FadeOut(introText)) - - Text1 = TextMobject("Let $\overrightarrow{v}$ be $3\hat{i}+3\hat{j}$") - Text2 = TextMobject("$\overrightarrow{v} = 3\hat{i}+3\hat{j}$") - - Text1.move_to(4*RIGHT+2*UP) - Text2.move_to(4*RIGHT+1*UP) - self.play(Write(Text1)) - self.wait() - self.play(Transform(Text1,Text2)) - - self.setup_axes(animate=True) - arrow_v = Arrow(stroke_width = 4, start = self.graph_origin + 0.15*LEFT + 0.15*DOWN, end = self.graph_origin+3*XTD*RIGHT+3*YTD*UP+ 0.15*RIGHT + 0.15*UP) - vector_v = TextMobject(r"$\vec{v}$") - vector_v.move_to(self.graph_origin + 1*XTD*RIGHT + 2*YTD*UP ) - self.play(ShowCreation(arrow_v),Write(vector_v)) - scaling_factor = TextMobject(r"Scaling Factor = $\frac{4}{3}$") - scaling_factor.scale(0.75) - scaled_vector = TextMobject(r"$T(\vec{v}) = \frac{4}{3} \left[ \begin{array} {c} 3 \\ 3 \end{array} \right] = \left[ \begin{array} {c} 4 \\ 4 \end{array} \right]$") - scaled_vector.set_color(DARK_BLUE) - scaled_vector.scale(0.75) - scaling_factor.move_to(4*RIGHT) - scaled_vector.move_to(4*RIGHT+DOWN) - self.play(Write(scaling_factor)) - self.wait() - self.play(Write(scaled_vector)) - - transformed_arrow_v = Arrow(stroke_width = 2, start = self.graph_origin + 0.15*LEFT + 0.15*DOWN, end = self.graph_origin+4*XTD*RIGHT+4*YTD*UP+ 0.15*RIGHT + 0.15*UP) - transformed_arrow_v.set_color(DARK_BLUE) - transformed_vector_v = TextMobject(r"$T(\vec{v})$") - transformed_vector_v.move_to(self.graph_origin + 4.5*XTD*RIGHT + 4.5*YTD*UP ) - transformed_vector_v.set_color(DARK_BLUE) - self.play(ShowCreation(transformed_arrow_v), Write(transformed_vector_v)) - - self.wait() - - represent_text1 = TextMobject("Representation of scaling") - represent_text2 = TextMobject("of vectors in point form") - represent_text1.move_to(4*RIGHT+3*UP) - represent_text2.move_to(4*RIGHT+2*UP) - self.play(Write(represent_text1), Write(represent_text2)) - - dot_init = Dot(self.graph_origin+3*XTD*RIGHT+3*YTD*UP) - dot_trans = Dot(self.graph_origin+4*XTD*RIGHT+4*YTD*UP) - - self.play(ApplyMethod(vector_v.move_to,self.graph_origin+2.5*XTD*RIGHT+2.5*YTD*UP), - ApplyMethod(transformed_vector_v.move_to,self.graph_origin+4.5*XTD*RIGHT+4.5*YTD*UP), - ShowCreation(dot_init), - Transform(arrow_v,dot_init), - Transform(transformed_arrow_v,dot_trans)) - - self.wait(2) - - self.play(FadeOut(dot_init), - FadeOut(arrow_v), - FadeOut(transformed_arrow_v), - FadeOut(represent_text1), - FadeOut(represent_text2), - FadeOut(self.axes), - FadeOut(scaling_factor), - FadeOut(scaled_vector), - FadeOut(transformed_vector_v), - FadeOut(vector_v), - FadeOut(Text1)) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear.py deleted file mode 100644 index 91f098e..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear.py +++ /dev/null @@ -1,53 +0,0 @@ -from manimlib.imports import * - -class Hori_Shear(GraphScene): - CONFIG = { - "x_min" : -5, - "x_max" : 5, - "y_min" : -5, - "y_max" : 5, - "graph_origin" : ORIGIN+3.5*LEFT, - "x_axis_width" : 7, - "y_axis_height" : 7 - #"x_labeled_nums" : list(range(-5,6)), - #"y_labeled_nums" : list(range(-5,6)), - } - - def construct(self): - XTD = self.x_axis_width/(self.x_max-self.x_min) - YTD = self.y_axis_height/(self.y_max-self.y_min) - - Text1 = TextMobject("Before"," Horizontal") - Text1[0].set_color(YELLOW) - Text2 = TextMobject("Shear Transformation") - - Text1.move_to(4*RIGHT+2*UP) - Text2.move_to(4*RIGHT+1*UP) - - self.setup_axes(animate=False) - arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+0.25*UP) - arrow_i.set_color(YELLOW) - arrow_j.set_color(YELLOW) - - square = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+2*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*YTD*UP) - square.set_color(DARK_BLUE) - self.play(ShowCreation(square), Write(Text1), Write(Text2), ShowCreation(arrow_i), ShowCreation(arrow_j)) - self.wait(1) - - Text3 = TextMobject("After"," Horizontal") - Text3[0].set_color(RED) - Text4 = TextMobject("Shear Transformation") - - Text3.move_to(4*RIGHT+2*UP) - Text4.move_to(4*RIGHT+1*UP) - - trans_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - trans_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*DOWN + 0.15*LEFT, end = self.graph_origin+1*XTD*UP+1*YTD*RIGHT+0.25*UP+0.25*RIGHT) - trans_arrow_i.set_color(RED) - trans_arrow_j.set_color(RED) - - rhombus = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+4*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*XTD*RIGHT+2*YTD*UP) - square.set_color(DARK_BLUE) - self.play(Transform(arrow_i,trans_arrow_i), Transform(arrow_j,trans_arrow_j), Transform(square,rhombus), Transform(Text1,Text3), Transform(Text2,Text4)) - self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear_gif.gif b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear_gif.gif deleted file mode 100644 index 9bef1b6..0000000 Binary files a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Horizontal_Shear_gif.gif and /dev/null differ diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Uniform_Scaling.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Uniform_Scaling.py new file mode 100644 index 0000000..a7856a5 --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file3_Uniform_Scaling.py @@ -0,0 +1,91 @@ +from manimlib.imports import * + +class Scaling(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "graph_origin" : ORIGIN+3.5*LEFT, + "x_axis_width" : 7, + "y_axis_height" : 7 + #"x_labeled_nums" : list(range(-5,6)), + #"y_labeled_nums" : list(range(-5,6)), + } + + def construct(self): + XTD = self.x_axis_width/(self.x_max-self.x_min) + YTD = self.y_axis_height/(self.y_max-self.y_min) + + introText = TextMobject("Scaling") + self.play(Write(introText)) + self.wait(1) + self.play(FadeOut(introText)) + + introText = TextMobject("Uniform Scaling") + self.play(Write(introText)) + self.wait(1) + self.play(FadeOut(introText)) + + Text1 = TextMobject("Let $\overrightarrow{v}$ be $3\hat{i}+3\hat{j}$") + Text2 = TextMobject("$\overrightarrow{v} = 3\hat{i}+3\hat{j}$") + + Text1.move_to(4*RIGHT+2*UP) + Text2.move_to(4*RIGHT+1*UP) + self.play(Write(Text1)) + self.wait() + self.play(Transform(Text1,Text2)) + + self.setup_axes(animate=True) + arrow_v = Arrow(stroke_width = 4, start = self.graph_origin + 0.15*LEFT + 0.15*DOWN, end = self.graph_origin+3*XTD*RIGHT+3*YTD*UP+ 0.15*RIGHT + 0.15*UP) + vector_v = TextMobject(r"$\vec{v}$") + vector_v.move_to(self.graph_origin + 1*XTD*RIGHT + 2*YTD*UP ) + self.play(ShowCreation(arrow_v),Write(vector_v)) + scaling_factor = TextMobject(r"Scaling Factor = $\frac{4}{3}$") + scaling_factor.scale(0.75) + scaled_vector = TextMobject(r"$T(\vec{v}) = \frac{4}{3} \left[ \begin{array} {c} 3 \\ 3 \end{array} \right] = \left[ \begin{array} {c} 4 \\ 4 \end{array} \right]$") + scaled_vector.set_color(DARK_BLUE) + scaled_vector.scale(0.75) + scaling_factor.move_to(4*RIGHT) + scaled_vector.move_to(4*RIGHT+DOWN) + self.play(Write(scaling_factor)) + self.wait() + self.play(Write(scaled_vector)) + + transformed_arrow_v = Arrow(stroke_width = 2, start = self.graph_origin + 0.15*LEFT + 0.15*DOWN, end = self.graph_origin+4*XTD*RIGHT+4*YTD*UP+ 0.15*RIGHT + 0.15*UP) + transformed_arrow_v.set_color(DARK_BLUE) + transformed_vector_v = TextMobject(r"$T(\vec{v})$") + transformed_vector_v.move_to(self.graph_origin + 4.5*XTD*RIGHT + 4.5*YTD*UP ) + transformed_vector_v.set_color(DARK_BLUE) + self.play(ShowCreation(transformed_arrow_v), Write(transformed_vector_v)) + + self.wait() + + represent_text1 = TextMobject("Representation of scaling") + represent_text2 = TextMobject("of vectors in point form") + represent_text1.move_to(4*RIGHT+3*UP) + represent_text2.move_to(4*RIGHT+2*UP) + self.play(Write(represent_text1), Write(represent_text2)) + + dot_init = Dot(self.graph_origin+3*XTD*RIGHT+3*YTD*UP) + dot_trans = Dot(self.graph_origin+4*XTD*RIGHT+4*YTD*UP) + + self.play(ApplyMethod(vector_v.move_to,self.graph_origin+2.5*XTD*RIGHT+2.5*YTD*UP), + ApplyMethod(transformed_vector_v.move_to,self.graph_origin+4.5*XTD*RIGHT+4.5*YTD*UP), + ShowCreation(dot_init), + Transform(arrow_v,dot_init), + Transform(transformed_arrow_v,dot_trans)) + + self.wait(2) + + self.play(FadeOut(dot_init), + FadeOut(arrow_v), + FadeOut(transformed_arrow_v), + FadeOut(represent_text1), + FadeOut(represent_text2), + FadeOut(self.axes), + FadeOut(scaling_factor), + FadeOut(scaled_vector), + FadeOut(transformed_vector_v), + FadeOut(vector_v), + FadeOut(Text1)) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Horizontal_Shear.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Horizontal_Shear.py new file mode 100644 index 0000000..91f098e --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Horizontal_Shear.py @@ -0,0 +1,53 @@ +from manimlib.imports import * + +class Hori_Shear(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "graph_origin" : ORIGIN+3.5*LEFT, + "x_axis_width" : 7, + "y_axis_height" : 7 + #"x_labeled_nums" : list(range(-5,6)), + #"y_labeled_nums" : list(range(-5,6)), + } + + def construct(self): + XTD = self.x_axis_width/(self.x_max-self.x_min) + YTD = self.y_axis_height/(self.y_max-self.y_min) + + Text1 = TextMobject("Before"," Horizontal") + Text1[0].set_color(YELLOW) + Text2 = TextMobject("Shear Transformation") + + Text1.move_to(4*RIGHT+2*UP) + Text2.move_to(4*RIGHT+1*UP) + + self.setup_axes(animate=False) + arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+0.25*UP) + arrow_i.set_color(YELLOW) + arrow_j.set_color(YELLOW) + + square = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+2*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*YTD*UP) + square.set_color(DARK_BLUE) + self.play(ShowCreation(square), Write(Text1), Write(Text2), ShowCreation(arrow_i), ShowCreation(arrow_j)) + self.wait(1) + + Text3 = TextMobject("After"," Horizontal") + Text3[0].set_color(RED) + Text4 = TextMobject("Shear Transformation") + + Text3.move_to(4*RIGHT+2*UP) + Text4.move_to(4*RIGHT+1*UP) + + trans_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + trans_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*DOWN + 0.15*LEFT, end = self.graph_origin+1*XTD*UP+1*YTD*RIGHT+0.25*UP+0.25*RIGHT) + trans_arrow_i.set_color(RED) + trans_arrow_j.set_color(RED) + + rhombus = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+4*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*XTD*RIGHT+2*YTD*UP) + square.set_color(DARK_BLUE) + self.play(Transform(arrow_i,trans_arrow_i), Transform(arrow_j,trans_arrow_j), Transform(square,rhombus), Transform(Text1,Text3), Transform(Text2,Text4)) + self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Horizontal_Shear_gif.gif b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Horizontal_Shear_gif.gif new file mode 100644 index 0000000..9bef1b6 Binary files /dev/null and b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Horizontal_Shear_gif.gif differ diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear.py deleted file mode 100644 index 718e4e0..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear.py +++ /dev/null @@ -1,52 +0,0 @@ -from manimlib.imports import * - -class Ver_Shear(GraphScene): - CONFIG = { - "x_min" : -5, - "x_max" : 5, - "y_min" : -5, - "y_max" : 5, - "graph_origin" : ORIGIN+3.5*LEFT, - "x_axis_width" : 7, - "y_axis_height" : 7 - #"x_labeled_nums" : list(range(-5,6)), - #"y_labeled_nums" : list(range(-5,6)), - } - - def construct(self): - XTD = self.x_axis_width/(self.x_max-self.x_min) - YTD = self.y_axis_height/(self.y_max-self.y_min) - - Text1 = TextMobject("Before"," Vertical") - Text1[0].set_color(YELLOW) - Text2 = TextMobject("Shear Transformation") - - Text1.move_to(4*RIGHT+2*UP) - Text2.move_to(4*RIGHT+1*UP) - - self.setup_axes(animate=False) - arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) - arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+0.25*UP) - arrow_i.set_color(YELLOW) - arrow_j.set_color(YELLOW) - - square = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+2*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*YTD*UP) - square.set_color(DARK_BLUE) - self.play(ShowCreation(square), Write(Text1), Write(Text2), ShowCreation(arrow_i), ShowCreation(arrow_j)) - self.wait(1) - - Text3 = TextMobject("After"," Vertical") - Text3[0].set_color(RED) - Text4 = TextMobject("Shear Transformation") - - Text3.move_to(4*RIGHT+2*UP) - Text4.move_to(4*RIGHT+1*UP) - - trans_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*DOWN + 0.15*LEFT, end = self.graph_origin+1*XTD*UP+1*YTD*RIGHT+0.25*UP+0.25*RIGHT) - trans_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+ 0.25*UP) - trans_arrow_i.set_color(RED) - trans_arrow_j.set_color(RED) - - rhombus = Polygon(self.graph_origin,self.graph_origin+2*XTD*UP, self.graph_origin+2*XTD*RIGHT+4*YTD*UP, self.graph_origin+2*XTD*RIGHT+2*YTD*UP) - self.play(Transform(arrow_i,trans_arrow_i), Transform(arrow_j,trans_arrow_j), FadeOut(square), ShowCreation(rhombus), Transform(Text1,Text3), Transform(Text2,Text4)) - self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear_gif.gif b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear_gif.gif deleted file mode 100644 index 7ca323f..0000000 Binary files a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file4_Vertical_Shear_gif.gif and /dev/null differ diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_Vertical_Shear.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_Vertical_Shear.py new file mode 100644 index 0000000..718e4e0 --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_Vertical_Shear.py @@ -0,0 +1,52 @@ +from manimlib.imports import * + +class Ver_Shear(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "graph_origin" : ORIGIN+3.5*LEFT, + "x_axis_width" : 7, + "y_axis_height" : 7 + #"x_labeled_nums" : list(range(-5,6)), + #"y_labeled_nums" : list(range(-5,6)), + } + + def construct(self): + XTD = self.x_axis_width/(self.x_max-self.x_min) + YTD = self.y_axis_height/(self.y_max-self.y_min) + + Text1 = TextMobject("Before"," Vertical") + Text1[0].set_color(YELLOW) + Text2 = TextMobject("Shear Transformation") + + Text1.move_to(4*RIGHT+2*UP) + Text2.move_to(4*RIGHT+1*UP) + + self.setup_axes(animate=False) + arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*LEFT, end = self.graph_origin+1*XTD*RIGHT+ 0.25*RIGHT) + arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+0.25*UP) + arrow_i.set_color(YELLOW) + arrow_j.set_color(YELLOW) + + square = Polygon(self.graph_origin,self.graph_origin+2*XTD*RIGHT, self.graph_origin+2*XTD*RIGHT+2*YTD*UP, self.graph_origin+2*YTD*UP) + square.set_color(DARK_BLUE) + self.play(ShowCreation(square), Write(Text1), Write(Text2), ShowCreation(arrow_i), ShowCreation(arrow_j)) + self.wait(1) + + Text3 = TextMobject("After"," Vertical") + Text3[0].set_color(RED) + Text4 = TextMobject("Shear Transformation") + + Text3.move_to(4*RIGHT+2*UP) + Text4.move_to(4*RIGHT+1*UP) + + trans_arrow_i = Arrow(stroke_width = 3, start = self.graph_origin + 0.15*DOWN + 0.15*LEFT, end = self.graph_origin+1*XTD*UP+1*YTD*RIGHT+0.25*UP+0.25*RIGHT) + trans_arrow_j = Arrow(stroke_width = 3, start = self.graph_origin + 0.25*DOWN, end = self.graph_origin+1*XTD*UP+ 0.25*UP) + trans_arrow_i.set_color(RED) + trans_arrow_j.set_color(RED) + + rhombus = Polygon(self.graph_origin,self.graph_origin+2*XTD*UP, self.graph_origin+2*XTD*RIGHT+4*YTD*UP, self.graph_origin+2*XTD*RIGHT+2*YTD*UP) + self.play(Transform(arrow_i,trans_arrow_i), Transform(arrow_j,trans_arrow_j), FadeOut(square), ShowCreation(rhombus), Transform(Text1,Text3), Transform(Text2,Text4)) + self.wait(1) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_Vertical_Shear_gif.gif b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_Vertical_Shear_gif.gif new file mode 100644 index 0000000..7ca323f Binary files /dev/null and b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_Vertical_Shear_gif.gif differ diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_linear_transformation.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_linear_transformation.py deleted file mode 100755 index 01a0cef..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file5_linear_transformation.py +++ /dev/null @@ -1,27 +0,0 @@ -from manimlib.imports import * -class LinearTrans(LinearTransformationScene,MovingCameraScene): - CONFIG = { - "basis_vector_stroke_width": 1, - "leave_ghost_vectors": True, - } - - def setup(self): - LinearTransformationScene.setup(self) - MovingCameraScene.setup(self) - - def construct(self): - self.setup() - self.camera_frame.save_state() - self.play(self.camera_frame.set_width, 7) - matrix = [[0.866,-0.5],[0.5,0.866]] - self.apply_matrix(matrix) - arc1 = Arc(radius = 0.25,angle=TAU/12) - arc2 = Arc(radius = 0.25,angle=TAU/12,start_angle=TAU/4) - text1 = TextMobject(r"$\theta$") - text1.scale(0.5) - text1.move_to(0.5*UP+0.125*LEFT) - text2 = TextMobject(r"$\theta$") - text2.scale(0.5) - text2.move_to(0.5*RIGHT+0.125*UP) - self.play(ShowCreation(arc1),ShowCreation(arc2),Write(text1),Write(text2),run_time=1) - self.wait() diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file6_linear_transformation.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file6_linear_transformation.py new file mode 100755 index 0000000..01a0cef --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file6_linear_transformation.py @@ -0,0 +1,27 @@ +from manimlib.imports import * +class LinearTrans(LinearTransformationScene,MovingCameraScene): + CONFIG = { + "basis_vector_stroke_width": 1, + "leave_ghost_vectors": True, + } + + def setup(self): + LinearTransformationScene.setup(self) + MovingCameraScene.setup(self) + + def construct(self): + self.setup() + self.camera_frame.save_state() + self.play(self.camera_frame.set_width, 7) + matrix = [[0.866,-0.5],[0.5,0.866]] + self.apply_matrix(matrix) + arc1 = Arc(radius = 0.25,angle=TAU/12) + arc2 = Arc(radius = 0.25,angle=TAU/12,start_angle=TAU/4) + text1 = TextMobject(r"$\theta$") + text1.scale(0.5) + text1.move_to(0.5*UP+0.125*LEFT) + text2 = TextMobject(r"$\theta$") + text2.scale(0.5) + text2.move_to(0.5*RIGHT+0.125*UP) + self.play(ShowCreation(arc1),ShowCreation(arc2),Write(text1),Write(text2),run_time=1) + self.wait() -- cgit From d66b55d33c7a26f7e73ada356294bee9b9b6fef9 Mon Sep 17 00:00:00 2001 From: Archit Sangal Date: Thu, 11 Jun 2020 17:08:27 +0530 Subject: Updated codes for video in RN theorem --- .../The-Rank-Nullity-Theorem/file.txt | 5 +- .../The-Rank-Nullity-Theorem/file1_RN_Theorem.py | 75 ++++++++++++++++------ .../The-Rank-Nullity-Theorem/file2_RN_Theorem1.py | 33 ---------- 3 files changed, 60 insertions(+), 53 deletions(-) delete mode 100644 FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file2_RN_Theorem1.py (limited to 'FSF-2020') diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file.txt b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file.txt index 890fe45..5c48a13 100644 --- a/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file.txt +++ b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file.txt @@ -1,2 +1,3 @@ -file 'RN_Theorem.mp4' -file 'RN_Theorem1.mp4' +file 'RN_Line.mp4' +file 'RN_Point.mp4' +file 'RN_SameDim.mp4' diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file1_RN_Theorem.py b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file1_RN_Theorem.py index 31330e2..e54276c 100755 --- a/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file1_RN_Theorem.py +++ b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file1_RN_Theorem.py @@ -1,58 +1,97 @@ from manimlib.imports import * -class RN_Theorem(LinearTransformationScene): +class RN_Line(LinearTransformationScene): def construct(self): + self.setup() self.wait() - square = Square(fill_color=BLACK, fill_opacity=1,color = BLUE) - square.move_to(4*LEFT+4*DOWN) - square.scale(4) - self.play(ShowCreation(square)) + predim = TextMobject("Dimension of this vector space is 2") predim.move_to(DOWN+4*LEFT) predim.scale(0.75) + predim.add_background_rectangle() self.play(Write(predim)) self.wait() self.play(FadeOut(predim)) + afterlt = TextMobject("After Linear transformation") afterlt.move_to(DOWN+4*LEFT) afterlt.scale(0.75) - afterlt2 = TextMobject("Dimension of the vector space","remains to be 2") - afterlt2[0].move_to(2*DOWN+4*LEFT) - afterlt2[1].move_to(3*DOWN+4*LEFT) + afterlt.add_background_rectangle() + + afterlt2 = TextMobject("Dimension of the vector space","changes to 1") + afterlt2[0].move_to(1.5*DOWN+4*LEFT) + afterlt2[1].move_to(2*DOWN+4*LEFT) afterlt2.scale(0.75) - matrix = [[1,1],[0,1]] + afterlt2.add_background_rectangle() + matrix = [[1,1],[1,1]] self.apply_matrix(matrix) self.play(Write(afterlt)) self.play(Write(afterlt2)) self.wait() - nullity = TextMobject("Hence, nullity = 0") + nullity = TextMobject("Hence, nullity = 1") nullity.move_to(DOWN+4*LEFT) self.play(FadeOut(afterlt),FadeOut(afterlt2),Write(nullity)) self.wait(1) self.play(FadeOut(nullity)) - predim = TextMobject("Let us look at another example") +class RN_Point(LinearTransformationScene): + def construct(self): + self.setup() + self.wait() + predim = TextMobject("Another One") predim.move_to(DOWN+4*LEFT) predim.scale(0.75) - matrix = [[1,-1],[0,1]] - self.apply_matrix(matrix) + predim.add_background_rectangle() self.play(Write(predim)) self.wait() self.play(FadeOut(predim)) afterlt = TextMobject("After Linear transformation") afterlt.move_to(DOWN+4*LEFT) afterlt.scale(0.75) - afterlt2 = TextMobject("Dimension of the vector space","changes to 1") - afterlt2[0].move_to(2*DOWN+4*LEFT) - afterlt2[1].move_to(3*DOWN+4*LEFT) + afterlt.add_background_rectangle() + afterlt2 = TextMobject("Dimension of the vector space","changes to 0") + afterlt2[0].move_to(1.5*DOWN+4*LEFT) + afterlt2[1].move_to(2*DOWN+4*LEFT) afterlt2.scale(0.75) - matrix = [[1,1],[1,1]] + afterlt2.add_background_rectangle() + matrix = [[0,0],[0,0]] self.apply_matrix(matrix) self.play(Write(afterlt)) self.play(Write(afterlt2)) self.wait() - nullity = TextMobject("Hence, nullity = 1") + nullity = TextMobject("Hence, nullity = 2") nullity.move_to(DOWN+4*LEFT) self.play(FadeOut(afterlt),FadeOut(afterlt2),Write(nullity)) self.wait(1) self.play(FadeOut(nullity)) + +class RN_SameDim(LinearTransformationScene): + def construct(self): + self.setup() + self.wait() + predim = TextMobject("Let us look at another example") + predim.add_background_rectangle() + predim.move_to(DOWN+4*LEFT) + predim.scale(0.75) + self.play(Write(predim)) + self.wait() + self.play(FadeOut(predim)) + afterlt = TextMobject("After Linear transformation") + afterlt.move_to(DOWN+4*LEFT) + afterlt.scale(0.75) + afterlt.add_background_rectangle() + afterlt2 = TextMobject("Dimension of the vector space","remains to be 2") + afterlt2[0].move_to(1.5*DOWN+4*LEFT) + afterlt2[1].move_to(2*DOWN+4*LEFT) + afterlt2.scale(0.75) + afterlt2.add_background_rectangle() + matrix = [[1,1],[0,1]] + self.apply_matrix(matrix) + self.play(Write(afterlt)) + self.play(Write(afterlt2)) + self.wait() + nullity = TextMobject("Hence, nullity = 0") + nullity.move_to(DOWN+4*LEFT) + self.play(FadeOut(afterlt),FadeOut(afterlt2),Write(nullity)) + self.wait(1) + self.play(FadeOut(nullity)) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file2_RN_Theorem1.py b/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file2_RN_Theorem1.py deleted file mode 100644 index 8f05ddd..0000000 --- a/FSF-2020/linear-algebra/linear-transformations/The-Rank-Nullity-Theorem/file2_RN_Theorem1.py +++ /dev/null @@ -1,33 +0,0 @@ -from manimlib.imports import * -class RN_Theorem1(LinearTransformationScene): - def construct(self): - self.setup() - self.wait() - square = Square(fill_color=BLACK, fill_opacity=1,color = BLUE) - square.move_to(4*LEFT+4*DOWN) - square.scale(4) - self.play(ShowCreation(square)) - predim = TextMobject("Another One") - predim.move_to(DOWN+4*LEFT) - predim.scale(0.75) - self.play(Write(predim)) - self.wait() - self.play(FadeOut(predim)) - afterlt = TextMobject("After Linear transformation") - afterlt.move_to(DOWN+4*LEFT) - afterlt.scale(0.75) - afterlt2 = TextMobject("Dimension of the vector space","changes to 0") - afterlt2[0].move_to(2*DOWN+4*LEFT) - afterlt2[1].move_to(3*DOWN+4*LEFT) - afterlt2.scale(0.75) - matrix = [[0,0],[0,0]] - self.apply_matrix(matrix) - self.play(Write(afterlt)) - self.play(Write(afterlt2)) - self.wait() - nullity = TextMobject("Hence, nullity = 2") - nullity.move_to(DOWN+4*LEFT) - #afterlt.scale(0.75) - self.play(FadeOut(afterlt),FadeOut(afterlt2),Write(nullity)) - self.wait(1) - self.play(FadeOut(nullity)) -- cgit From 1c8492c83d0b953c2e9f62f0ddb761c33b52b943 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Thu, 11 Jun 2020 17:43:42 +0530 Subject: updated after review --- .../double-integrals/README.md | 8 +- .../double-integrals/file1_area_under_func.gif | Bin 0 -> 1277788 bytes .../double-integrals/file1_area_under_func.py | 73 +++++ .../double-integrals/file1_surface.gif | Bin 3365528 -> 0 bytes .../double-integrals/file1_surface.py | 236 ---------------- .../double-integrals/file2_area_under_func.gif | Bin 1277788 -> 0 bytes .../double-integrals/file2_area_under_func.py | 73 ----- .../file2_volume_under_surface.gif | Bin 0 -> 5460831 bytes .../double-integrals/file2_volume_under_surface.py | 314 +++++++++++++++++++++ 9 files changed, 391 insertions(+), 313 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_area_under_func.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_area_under_func.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.py delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif delete mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.py create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.gif create mode 100644 FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/README.md b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/README.md index fe4d73a..5fa2146 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/README.md +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/README.md @@ -1,8 +1,8 @@ -**file1_surface** -![file1_surface](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif) +**file1_area_under_func** +![file1_area_under_func](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_area_under_func.gif) -**file2_area_under_func** -![file2_area_under_func](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif) +**file2_volume_under_surface** +![file2_volume_under_surface](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.gif) **file3_y_limit_dependent_on_x** ![file3_y_limit_dependent_on_x](https://github.com/panditsomnath10016git/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file3_y_limit_dependent_on_x.gif) diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_area_under_func.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_area_under_func.gif new file mode 100644 index 0000000..223218b Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_area_under_func.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_area_under_func.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_area_under_func.py new file mode 100644 index 0000000..773840c --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_area_under_func.py @@ -0,0 +1,73 @@ +from manimlib.imports import * + + +class AreaUnderIntegral(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 5, + "y_min" : 0, + "y_max" : 6, + "Func":lambda x : 1+x**2*np.exp(-.15*x**2) + } + + def construct(self): + X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) + Y = UP*self.y_axis_height/(self.y_max- self.y_min) + + int_area_sym=TextMobject("$$\int_{a}^b f(x)dx$$").shift(2*UP) + area_mean_text = TextMobject(r"means area under the curve of $f(x)$ \\ in the region $a\leq x\leq b$").next_to(int_area_sym,DOWN) + + opening_text=VGroup(*[int_area_sym,area_mean_text]) + self.play(Write(opening_text),run_time=4) + self.wait(2) + self.play(FadeOut(opening_text)) + + self.setup_axes(animate=True) + func= self.get_graph(self.Func, x_min=0,x_max=5) + self.curve=func + + func_text = TextMobject(r"$y = f(x)$").next_to(func,UP) + min_lim = self.get_vertical_line_to_graph(1,func,DashedLine,color=YELLOW) + tick_a=TextMobject(r"$a$").next_to(min_lim,DOWN) + max_lim = self.get_vertical_line_to_graph(4,func,DashedLine,color=YELLOW) + tick_b=TextMobject(r"$b$").next_to(max_lim,DOWN) + + # area = self.get_area(func,1,4) + + self.play(ShowCreation(func), ShowCreation(func_text)) + + self.wait(2) + self.play(ShowCreation(min_lim),Write(tick_a), ShowCreation(max_lim),Write(tick_b),run_time=0.5) + + + approx_text=TextMobject(r"The area can be approximated as \\ sum of small rectangles").next_to(func,4*Y) + self.play(Write(approx_text)) + + rect_list = self.get_riemann_rectangles_list( + self.curve, 5, + max_dx = 0.25, + x_min = 1, + x_max = 4, + ) + flat_graph = self.get_graph(lambda t : 0) + rects = self.get_riemann_rectangles( flat_graph, x_min = 1, x_max = 4, dx = 0.5) + for new_rects in rect_list: + new_rects.set_fill(opacity = 0.8) + rects.align_submobjects(new_rects) + for alt_rect in rects[::2]: + alt_rect.set_fill(opacity = 0) + self.play(Transform( + rects, new_rects, + run_time = 1.5, + lag_ratio = 0.5 + )) + conclude_text=TextMobject(r"Making the rectangles infinitesimally thin \\ we get the real area under the curve.").next_to(func,4*Y) + self.play(Transform(approx_text,conclude_text)) + self.wait(3) + int_area_sym.next_to(self.curve,IN) + self.play(Transform(conclude_text,int_area_sym)) + + # self.play(ShowCreation(area)) + self.wait(3) + +#uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif deleted file mode 100644 index ae23a7b..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.py deleted file mode 100644 index a794f46..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file1_surface.py +++ /dev/null @@ -1,236 +0,0 @@ -from manimlib.imports import * - -class SurfacesAnimation(ThreeDScene): - - CONFIG = { - "axes_config": { - "x_min": 0, - "x_max": 8, - "y_min": 0, - "y_max": 8, - "z_min": 0, - "z_max": 6, - "a":1 ,"b": 6, "c":2 , "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("$z=f(x,y)$").set_color(PINK) - self.add_fixed_in_frame_mobjects(fn_text) - fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) - - R=TextMobject("R").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=PINK, - stroke_width=0.8, - stroke_color=WHITE, - ) - - - self.begin_ambient_camera_rotation(rate=0.07) - self.play(Write(surface)) - # self.play(LaggedStart(ShowCreation(surface))) - - self.get_lines() - # self.play(FadeIn(self.axes.input_plane)) - self.wait(3) - - def get_surface(self,axes, func, **kwargs): - config = { - "u_min": axes.a, - "u_max": axes.b, - "v_min": axes.c, - "v_max": axes.d, - "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,"RED")) - - 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: 0 - ) - 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 - - - -#uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif deleted file mode 100644 index 223218b..0000000 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.py deleted file mode 100644 index 773840c..0000000 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_area_under_func.py +++ /dev/null @@ -1,73 +0,0 @@ -from manimlib.imports import * - - -class AreaUnderIntegral(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 5, - "y_min" : 0, - "y_max" : 6, - "Func":lambda x : 1+x**2*np.exp(-.15*x**2) - } - - def construct(self): - X = RIGHT*self.x_axis_width/(self.x_max- self.x_min) - Y = UP*self.y_axis_height/(self.y_max- self.y_min) - - int_area_sym=TextMobject("$$\int_{a}^b f(x)dx$$").shift(2*UP) - area_mean_text = TextMobject(r"means area under the curve of $f(x)$ \\ in the region $a\leq x\leq b$").next_to(int_area_sym,DOWN) - - opening_text=VGroup(*[int_area_sym,area_mean_text]) - self.play(Write(opening_text),run_time=4) - self.wait(2) - self.play(FadeOut(opening_text)) - - self.setup_axes(animate=True) - func= self.get_graph(self.Func, x_min=0,x_max=5) - self.curve=func - - func_text = TextMobject(r"$y = f(x)$").next_to(func,UP) - min_lim = self.get_vertical_line_to_graph(1,func,DashedLine,color=YELLOW) - tick_a=TextMobject(r"$a$").next_to(min_lim,DOWN) - max_lim = self.get_vertical_line_to_graph(4,func,DashedLine,color=YELLOW) - tick_b=TextMobject(r"$b$").next_to(max_lim,DOWN) - - # area = self.get_area(func,1,4) - - self.play(ShowCreation(func), ShowCreation(func_text)) - - self.wait(2) - self.play(ShowCreation(min_lim),Write(tick_a), ShowCreation(max_lim),Write(tick_b),run_time=0.5) - - - approx_text=TextMobject(r"The area can be approximated as \\ sum of small rectangles").next_to(func,4*Y) - self.play(Write(approx_text)) - - rect_list = self.get_riemann_rectangles_list( - self.curve, 5, - max_dx = 0.25, - x_min = 1, - x_max = 4, - ) - flat_graph = self.get_graph(lambda t : 0) - rects = self.get_riemann_rectangles( flat_graph, x_min = 1, x_max = 4, dx = 0.5) - for new_rects in rect_list: - new_rects.set_fill(opacity = 0.8) - rects.align_submobjects(new_rects) - for alt_rect in rects[::2]: - alt_rect.set_fill(opacity = 0) - self.play(Transform( - rects, new_rects, - run_time = 1.5, - lag_ratio = 0.5 - )) - conclude_text=TextMobject(r"Making the rectangles infinitesimally thin \\ we get the real area under the curve.").next_to(func,4*Y) - self.play(Transform(approx_text,conclude_text)) - self.wait(3) - int_area_sym.next_to(self.curve,IN) - self.play(Transform(conclude_text,int_area_sym)) - - # self.play(ShowCreation(area)) - self.wait(3) - -#uploaded by Somnath Pandit.FSF2020_Double_Integral diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.gif new file mode 100644 index 0000000..74c306d Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.py new file mode 100644 index 0000000..cd4060b --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.py @@ -0,0 +1,314 @@ +from manimlib.imports import * + +class SurfacesAnimation(ThreeDScene): + + CONFIG = { + "axes_config": { + "x_min": 0, + "x_max": 7, + "y_min": 0, + "y_max": 7, + "z_min": 0, + "z_max": 5, + "a":1 ,"b": 6, "c":2 , "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=-100 * DEGREES, + ) + + fn_text=TextMobject("$z=f(x,y)$").set_color(PINK) + self.add_fixed_in_frame_mobjects(fn_text) + fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) + + riemann_sum_text=TextMobject(r"The volume approximated as\\ sum of cuboids",color=BLUE) + riemann_sum_text.to_corner(UR,buff=.2) + + R=TextMobject("R").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=PINK, + stroke_width=0.8, + stroke_color=WHITE, + ) + + + self.begin_ambient_camera_rotation(rate=0.08) + self.play(Write(surface)) + # self.add(surface) + + self.get_lines() + self.wait(1) + self.add_fixed_in_frame_mobjects(riemann_sum_text) + self.play(Write(riemann_sum_text)) + self.show_the_riemmann_sum( + lambda x,y : np.array([x,y,self.Func(x,y)]), + fill_opacity=1, + dl=.5, + start_color=BLUE, + end_color=BLUE_E, + ) + self.play(FadeOut(surface)) + self.wait(3) + + + + + def get_surface(self,axes, func, **kwargs): + config = { + "u_min": axes.a, + "u_max": axes.b, + "v_min": axes.c, + "v_max": axes.d, + "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 + + 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,"#9CDCEB")) + + labels=[ + (axes.a,0,0), + (axes.b,0,0), + (0,axes.d,0), + (0,axes.c,0) + ] + self.region_corners[-1]=self.region_corners[0] + for start , end in zip(labels,self.region_corners): + lines.add(self.draw_lines(start,end,"WHITE")) + + # self.add(lines) + 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 show_the_riemmann_sum( + self, + surface, + x_min=None, + x_max=None, + y_min=None, + y_max=None, + dl=.5, + stroke_width=.5, + stroke_color=BLACK, + fill_opacity=1, + start_color=None, + end_color=None, + ): + x_min = x_min if x_min is not None else self.axes.a + x_max = x_max if x_max is not None else self.axes.b + y_min = y_min if y_min is not None else self.axes.c + y_max = y_max if y_max is not None else self.axes.d + + if start_color is None: + start_color = BLUE + if end_color is None: + end_color = BLUE + + cuboids = VGroup() + x_range = np.arange(x_min, x_max, dl) + y_range = np.arange(y_min, y_max, dl) + colors = color_gradient([start_color, end_color], len(x_range)) + for x, color in zip(x_range, colors): + for y in y_range: + sample_base = np.array([x ,y ,0]) + sample_base_dl = np.array([x + dl, y + dl,0]) + sample_input = np.array([x +0.5*dl, y +0.5*dl,0]) + + base_point = self.axes.c2p(*sample_base) + base_dx_point = self.axes.c2p(*sample_base_dl) + + surface_val= surface(*sample_input[:2]) + surface_point = self.axes.c2p(*surface_val) + + points = VGroup(*list(map(VectorizedPoint, [ + base_point, + surface_point, + base_dx_point + ]))) + + # self.add(points) + cuboid = Prism(dimensions=[dl,dl,surface_val[-1]]) + cuboid.replace(points, stretch=True) + + cuboid.set_fill(color, opacity=fill_opacity) + cuboid.set_stroke(stroke_color, width=stroke_width) + cuboids.add(cuboid) + + self.play(ShowCreation(cuboids),run_time=6) + # self.add(cuboids) + + +#------------------------------------------------------- + #customize 3d axes + 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: 0 + ) + 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,UL,UR)] + + 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 + + -- cgit From 70f35b9f0b2f01ca60416fb24e8f4618cdd93735 Mon Sep 17 00:00:00 2001 From: Somnath Pandit Date: Fri, 12 Jun 2020 18:41:59 +0530 Subject: more upgrade --- .../file2_volume_under_surface.gif | Bin 5460831 -> 6614909 bytes .../double-integrals/file2_volume_under_surface.py | 47 ++++++++++++++++++--- 2 files changed, 41 insertions(+), 6 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.gif b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.gif index 74c306d..1455573 100644 Binary files a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.gif and b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.gif differ diff --git a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.py b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.py index cd4060b..38d41c6 100644 --- a/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.py +++ b/FSF-2020/calculus-of-several-variables/integrals-of-multivariable-functions/double-integrals/file2_volume_under_surface.py @@ -49,11 +49,19 @@ class SurfacesAnimation(ThreeDScene): theta=-100 * DEGREES, ) - fn_text=TextMobject("$z=f(x,y)$").set_color(PINK) + fn_text=TextMobject( + "$z=f(x,y)$", + color=PINK, + stroke_width=1.5 + ) self.add_fixed_in_frame_mobjects(fn_text) fn_text.to_edge(TOP,buff=MED_SMALL_BUFF) - riemann_sum_text=TextMobject(r"The volume approximated as\\ sum of cuboids",color=BLUE) + riemann_sum_text=TextMobject( + r"The volume approximated as\\ sum of cuboids", + color=BLUE, + stroke_width=1.5 + ) riemann_sum_text.to_corner(UR,buff=.2) R=TextMobject("R").set_color(BLACK).scale(3) @@ -73,7 +81,7 @@ class SurfacesAnimation(ThreeDScene): ) - self.begin_ambient_camera_rotation(rate=0.08) + self.begin_ambient_camera_rotation(rate=0.06) self.play(Write(surface)) # self.add(surface) @@ -81,14 +89,42 @@ class SurfacesAnimation(ThreeDScene): self.wait(1) self.add_fixed_in_frame_mobjects(riemann_sum_text) self.play(Write(riemann_sum_text)) - self.show_the_riemmann_sum( + + cuboids1=self.show_the_riemmann_sum( lambda x,y : np.array([x,y,self.Func(x,y)]), fill_opacity=1, dl=.5, start_color=BLUE, end_color=BLUE_E, ) + self.play(ShowCreation(cuboids1),run_time=5) self.play(FadeOut(surface)) + + cuboids2=self.show_the_riemmann_sum( + lambda x,y : np.array([x,y,self.Func(x,y)]), + fill_opacity=1, + dl=.25, + start_color=BLUE, + end_color=BLUE_E, + ) + self.play(ReplacementTransform( + cuboids1, + cuboids2 + )) + + cuboids3=self.show_the_riemmann_sum( + lambda x,y : np.array([x,y,self.Func(x,y)]), + fill_opacity=1, + dl=.1, + start_color=BLUE, + end_color=BLUE_E, + stroke_width=.1, + ) + self.play( + FadeOut(cuboids2), + ShowCreation(cuboids3), + ) + self.wait(3) @@ -203,8 +239,7 @@ class SurfacesAnimation(ThreeDScene): cuboid.set_stroke(stroke_color, width=stroke_width) cuboids.add(cuboid) - self.play(ShowCreation(cuboids),run_time=6) - # self.add(cuboids) + return cuboids #------------------------------------------------------- -- cgit From 29223f0559e2f94166591fdacee0afa651f9bdc0 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 13 Jun 2020 22:58:17 +0530 Subject: Update and rename file1_Total_area_of_cross_section.py to file1_Critical_Point_of_a_function.py modified the code for gif1--- .../file1_Critical_Point_of_a_function.py | 32 ++++++++++++++++++++++ .../file1_Total_area_of_cross_section.py | 31 --------------------- 2 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py new file mode 100644 index 0000000..0b15ebf --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py @@ -0,0 +1,32 @@ +from manimlib.imports import* +import math as m + + +class CriticalPoint(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + m.exp(-10*u**2-10*v**2) #---- function equation + ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[TEAL_E,TEAL_D,TEAL_C]).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') + f_text = TextMobject("Critical Point of a function",color = YELLOW).shift([3,0,3.7]).scale(0.7) + + self.add(axes) + self.set_camera_orientation(phi=75*DEGREES,theta=90*DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + self.play(Write(surface)) + self.wait(1) + self.play(Write(l1)) + self.play(Write(d)) + self.wait(2) + self.move_camera(phi=0 * DEGREES,theta = 90*DEGREES) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py deleted file mode 100644 index b1ce29c..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py +++ /dev/null @@ -1,31 +0,0 @@ -from manimlib.imports import* - -class MotivationAnimation(Scene): - def construct(self): - - r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip - b = Brace(r,UP) - r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) - m_text = TextMobject("Metal Strip").shift(3*DOWN) - a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) - a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) - START = [1,0,0] - END = [0,3,0] - l = Line(START,END,color = RED).shift(0.9*DOWN) - a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) - - group1 = VGroup(r_text,b,a,l,a2,a2_text) - f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) - - ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip - - self.play(Write(r)) - self.wait(1) - self.play(ShowCreation(m_text)) - self.wait(1) - self.play(Write(group1)) - self.wait(2) - self.play(FadeOut(group1)) - self.wait(1) - self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) - -- cgit From c5e6905c1c739417cb973f29106fb6754a1f6c82 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 13 Jun 2020 22:59:01 +0530 Subject: Delete file1_Total_area_of_cross_section.mp4 --- .../file1_Total_area_of_cross_section.mp4 | Bin 283509 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 deleted file mode 100644 index 436dedf..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 and /dev/null differ -- cgit From 62488c13816018706eb82e1c46e1138eabcc00e4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:09:37 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.mp4 | Bin 0 -> 7572030 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 new file mode 100644 index 0000000..7cb8aa1 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 differ -- cgit From fea71e32256ffb051e73a0e61cf7286711982b57 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:17:13 +0530 Subject: Update and rename file2_Tangent_plane_at_extrema.py to file2_Traces_and_Tangent.py modified the code for gif 2--- .../file2_Tangent_plane_at_extrema.py | 55 ------------- .../Critical-Points/file2_Traces_and_Tangent.py | 93 ++++++++++++++++++++++ 2 files changed, 93 insertions(+), 55 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py deleted file mode 100644 index 6889a52..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import* - -class TheoremAnimation(ThreeDScene): - def construct(self): - - axes = ThreeDAxes() - - #----parabola: x**2+y**2 - parabola1 = 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_E], - resolution=(20, 20)).scale(1) - - #----parabola: -x**2-y**2 - parabola2 = 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_E,PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi=75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.4) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane - - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) - - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) - - self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) - self.wait(1) - self.play(Write(parabola1)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) - - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py new file mode 100644 index 0000000..65b4414 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py @@ -0,0 +1,93 @@ +from manimlib.imports import* +import math as m + + +class firstScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes().scale(1.15) + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + m.exp(-10*u**2-10*v**2) #---- f(x,y) + ]),u_min=-2,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) + + trace = ParametricSurface( + lambda u, v: np.array([ + m.exp(np.cos(v)+np.sin(v)), + v, + u/4 + ]), v_min = -1, v_max= 2).rotate(1.571,DOWN).shift(2.15*LEFT+[0.6,-0.4,1.54]).scale(1).set_color('#800000') + + + + d = Dot(color =YELLOW).shift([1.9,0.7,4.1]) #---- critical point + tangent_line = Line(color = '#228B22').scale(1).shift([1.9,0.7,4.1]).rotate(4.5) #---- tangent along y axis + + label_x = TextMobject("$x$").shift([5.8,-0.5,0]) + label_y = TextMobject("$y$").shift([-0.5,5.6,0]).rotate(-4.5) + + + f_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=60*DEGREES,theta=15*DEGREES) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.wait(1) + self.add_fixed_in_frame_mobjects(s_text) + self.add(trace) + self.wait(1) + self.play(Write(tangent_line),Write(d)) + self.wait(2) + + +class secondScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes().scale(1.15) + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + m.exp(-10*u**2-10*v**2) #---- f(x,y) + ]),u_min=-2,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) + + trace = ParametricSurface( + lambda u, v: np.array([ + m.exp(np.cos(v)+np.sin(v)), + v, + u/4 + ]), v_min = -1, v_max= 2).rotate(1.571,DOWN).shift(2.15*LEFT+[0.6,-0.4,1.54]).scale(1).set_color('#800000') + + + + d = Dot(color =YELLOW).shift([1.9,0.7,4.1]) #---- critical point + + label_x = TextMobject("$x$").shift([5.8,-0.5,0]) + label_y = TextMobject("$y$").shift([-0.5,5.6,0]).rotate(-4.5) + + f_text = TextMobject("Tangent to the trace with $y$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) + + tangent_line = Line(color = '#228B22').scale(1).shift([1.9,0.7,4.1]) #---- tangent along x axis + + + self.add(axes) + self.set_camera_orientation(phi=60*DEGREES,theta=15*DEGREES) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f_text) + trace.rotate(-5).shift(0.2*RIGHT+0.8*UP+[0.6,-0.4,0.6]) + self.add(trace) + self.play(Write(tangent_line),Write(d)) + self.wait(1) + + + + + + -- cgit From 0c64724b50c0ba18f9bf222d9ab9182cb2019237 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:18:05 +0530 Subject: Update file2_Traces_and_Tangent.py --- .../Critical-Points/file2_Traces_and_Tangent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py index 65b4414..6be4c6a 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py @@ -53,7 +53,7 @@ class secondScene(ThreeDScene): u, v, m.exp(-10*u**2-10*v**2) #---- f(x,y) - ]),u_min=-2,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) + ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) trace = ParametricSurface( lambda u, v: np.array([ -- cgit From 79ffe792983f60f0fc8ace4324a10f53f539df00 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:18:37 +0530 Subject: Delete file2_Tangent_plane_at_extrema.mp4 --- .../file2_Tangent_plane_at_extrema.mp4 | Bin 3483550 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 deleted file mode 100644 index 75657be..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 and /dev/null differ -- cgit From 51ee2ee8400ae4591f0559e3c5e90c7059219f42 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:20:24 +0530 Subject: Add files via upload --- .../Critical-Points/file2_Traces_and_Tangent.mp4 | Bin 0 -> 12740681 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 new file mode 100644 index 0000000..7a2d0ee Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 differ -- cgit From b956f1dcb43cf2b93febad29890dbbd1e264dd2f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:25:05 +0530 Subject: Update and rename file3_Visualization_of_types_of_critical_points.py to file3_Tangent_plane_at_extrema_of_a_function.py modified code for gif 3--- ...file3_Tangent_plane_at_extrema_of_a_function.py | 53 ++++++++++++++++ ...e3_Visualization_of_types_of_critical_points.py | 70 ---------------------- 2 files changed, 53 insertions(+), 70 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py new file mode 100644 index 0000000..a9b29f3 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py @@ -0,0 +1,53 @@ +from manimlib.imports import* + +class TheoremAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + + #----parabola: x**2+y**2 + parabola1 = 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) + + #----parabola: -x**2-y**2 + parabola2 = 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) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.2) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + r = Rectangle(fill_color= '#C0C0C0',fill_opacity = 0.3).move_to(ORIGIN).fade(0.7) #----tangent plane + + parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.add(axes) + self.add_fixed_in_frame_mobjects(parabola2_text) + self.wait(1) + self.play(Write(parabola1)) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) + self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + + self.wait(1) + self.add_fixed_in_frame_mobjects(parabola1_text) + self.wait(1) + self.play(Write(parabola2)) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(1) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py deleted file mode 100644 index f9055e6..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py +++ /dev/null @@ -1,70 +0,0 @@ -from manimlib.imports import * - -class TypescpAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - - #----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) - - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) - - #----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) - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----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) - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r3_text) - self.wait(1) - self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) -- cgit From 087ef1aa73a9a9c0099238113a5c4f028fdcef26 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:37:58 +0530 Subject: Delete file3_Visualization of_types_of _critical_points.mp4 --- ...le3_Visualization of_types_of _critical_points.mp4 | Bin 1035267 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 deleted file mode 100644 index ea6b781..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 and /dev/null differ -- cgit From c104de4d17e814ec63e5a4984e2558cb70fb9116 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:39:47 +0530 Subject: Add files via upload --- .../file3_Tangent_plane_at_extrema_of_a_function.mp4 | Bin 0 -> 2286609 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 new file mode 100644 index 0000000..ea5149f Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 differ -- cgit From 50cd0ef4bf0348aa2bb2e7d26a05419e67623a76 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:42:55 +0530 Subject: Update and rename file4_f(x,y)=(y-x)(1-2x-3y).py to file4_Types_of_critical_points.py --- .../file4_Types_of_critical_points.py | 70 ++++++++++++++++++++++ .../Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py | 32 ---------- 2 files changed, 70 insertions(+), 32 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py new file mode 100644 index 0000000..f9c1ef0 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py @@ -0,0 +1,70 @@ +from manimlib.imports import * + +class TypescpAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + #----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_B,YELLOW_C,YELLOW_D, YELLOW_E], + resolution = (20, 20)).scale(1.5).shift([0,0,-0.51]).fade(0.3) + + r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + #----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_B,RED_C,RED_D, RED_E], + resolution = (20, 20)).scale(1.5).shift([0,0.2,0]).fade(0.3) + + r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + #----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 =[TEAL_B,TEAL_C,TEAL_D,TEAL_E], + resolution = (20, 20)).scale(1.5).shift([0,0,0.55]).fade(0.1) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.play(FadeOut(r2_text)) + self.add(axes) + self.play(Write(f2),Write(d)) + self.add_fixed_in_frame_mobjects(f2_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r3_text) + self.wait(1) + self.play(FadeOut(r3_text)) + self.add(axes) + self.play(Write(f3),Write(d)) + self.add_fixed_in_frame_mobjects(f3_text) + self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py deleted file mode 100644 index 72c93b1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = 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_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) -- cgit From 54808110e4ed0a31184d16591df83d17230528af Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:44:08 +0530 Subject: Update file3_Tangent_plane_at_extrema_of_a_function.py --- .../Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py index a9b29f3..b066d04 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py @@ -1,6 +1,6 @@ from manimlib.imports import* -class TheoremAnimation(ThreeDScene): +class TangentPlane(ThreeDScene): def construct(self): axes = ThreeDAxes() -- cgit From 7f9dbe19b3fb5691b20b267da0389ee76c8d47ae Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:44:40 +0530 Subject: Delete file4_f(x,y)=(y-x)(1-2x-3y).mp4 --- .../Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 | Bin 2542434 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 deleted file mode 100644 index b01d279..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 and /dev/null differ -- cgit From 9c829be87de73eb7bbd0ea2fe5a74e2894fb9720 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:45:53 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.mp4 | Bin 0 -> 1405162 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 new file mode 100644 index 0000000..13e49e6 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 differ -- cgit From 246c53a8a6e621b7d6a6730e4ea7a3a0c3275740 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:47:11 +0530 Subject: Create file5_f(x,y)=(y-x)(1-2x-3y).py --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py new file mode 100644 index 0000000..8a90990 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py @@ -0,0 +1,25 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + + #----f(x,y) = (y-x)(1-2x-3y) + f = 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], + resolution=(20, 20)).scale(1).fade(0.2).shift([0.2,0.2,0]) + + self.set_camera_orientation(phi = 75 * DEGREES,theta= 60*DEGREES) + self.begin_ambient_camera_rotation(rate=0.1) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f)) + self.wait(3) -- cgit From 8d29a384e4892c4c8aa4a4fc0555d6e4c86b6555 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:48:37 +0530 Subject: Add files via upload --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 | Bin 0 -> 1138064 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 new file mode 100644 index 0000000..44a2fea Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 differ -- cgit From 11a9de691934af10c9bc93456f9f9d05c3c17902 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:06:33 +0530 Subject: Create README.md Created readme file for the subtopic critical points--- .../Critical-Points/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md new file mode 100644 index 0000000..60abeff --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -0,0 +1,11 @@ +1. Critical Points + +![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4?raw=true) + +![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4?raw=true) + +![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4?raw=true) + +![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4?raw=true) + +![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).mp4?raw=true) -- cgit From 06f18ec2a72517b01d5d6fd2c1190362fcee9fa3 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:08:52 +0530 Subject: Delete README.md --- .../Critical-Points/README.md | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md deleted file mode 100644 index 60abeff..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ /dev/null @@ -1,11 +0,0 @@ -1. Critical Points - -![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4?raw=true) - -![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4?raw=true) - -![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4?raw=true) - -![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4?raw=true) - -![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).mp4?raw=true) -- cgit From 90f5b141f7b0e041f308bab5298ce5358bb79576 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:16:27 +0530 Subject: Delete file1_Critical_Point_of_a_function.mp4 --- .../file1_Critical_Point_of_a_function.mp4 | Bin 7572030 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 deleted file mode 100644 index 7cb8aa1..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 and /dev/null differ -- cgit From b8bb27b0ce0d0a4d0b5fc04d254dc9e00207e09d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:17:32 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 4518694 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..b29772b Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From 536356d68b0b67380bd5ba992c9330ae5cd20233 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:20:36 +0530 Subject: Create README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md new file mode 100644 index 0000000..4fe0bee --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -0,0 +1,4 @@ +1. Critical Points +-------- Animations -------- + +![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) -- cgit From 1e3ff2ddc3438ac5feca3221f55421a35a8b32d4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:21:34 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 4fe0bee..4fa4317 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,4 +1,5 @@ 1. Critical Points +

-------- Animations -------- ![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) -- cgit From 701e4d2209cf7b462b527decb3ecb5e0256ce9bb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:23:11 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 4fa4317..0917073 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -2,4 +2,6 @@

-------- Animations -------- -![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +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/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) -- cgit From 4934006b4a7040a6ef9282fd8374d9935ec386db Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:23:39 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 0917073..a79d69c 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -2,6 +2,6 @@

-------- Animations -------- -file1_Critical_Point_of_a_function + 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/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) -- cgit From 55edb84f67a44f6bfa658335c8b233e738a056bd Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:24:17 +0530 Subject: Delete file2_Traces_and_Tangent.mp4 --- .../Critical-Points/file2_Traces_and_Tangent.mp4 | Bin 12740681 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 deleted file mode 100644 index 7a2d0ee..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 and /dev/null differ -- cgit From 459a3ebe680bb30572e1fe5fc6272f6606b39fe2 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:26:56 +0530 Subject: Add files via upload --- .../Critical-Points/file2_Traces_and_Tangent.gif | Bin 0 -> 1105801 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif new file mode 100644 index 0000000..e7a2a46 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif differ -- cgit From c8d08f5e9925d5d88e5285f411228284bb231ad6 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:28:08 +0530 Subject: Delete file3_Tangent_plane_at_extrema_of_a_function.mp4 --- .../file3_Tangent_plane_at_extrema_of_a_function.mp4 | Bin 2286609 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 deleted file mode 100644 index ea5149f..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 and /dev/null differ -- cgit From 86602d63512998b5dd7b9d769a7acd317fa22e4a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:30:39 +0530 Subject: Add files via upload --- .../file3_Tangent_plane_at_extrema_of_a_function.gif | Bin 0 -> 2195510 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif new file mode 100644 index 0000000..41c72cc Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif differ -- cgit From b8a5421a708d911256c42336ebfc535ac43d91a9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:31:53 +0530 Subject: Delete file4_Types_of_critical_points.mp4 --- .../file4_Types_of_critical_points.mp4 | Bin 1405162 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 deleted file mode 100644 index 13e49e6..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 and /dev/null differ -- cgit From b1b9cb813181768cb0703eb8054d65fbf676d186 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:32:21 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 1216647 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..63f2b3a Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From d6f4bff69fd272e633f5bd5769db2c3c42eece14 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:33:52 +0530 Subject: Delete file5_f(x,y)=(y-x)(1-2x-3y).mp4 --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 | Bin 1138064 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 deleted file mode 100644 index 44a2fea..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 and /dev/null differ -- cgit From 4e7cfaf86a6481cbdd68d5d31b75a8ec6dfc7389 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:34:22 +0530 Subject: Add files via upload --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif | Bin 0 -> 1231893 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif new file mode 100644 index 0000000..0a2785e Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif differ -- cgit From 1608e3ae85eff8374d62f3d7780abecd46913a69 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:35:07 +0530 Subject: Update README.md --- .../Critical-Points/README.md | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index a79d69c..364c968 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -2,6 +2,36 @@

-------- Animations -------- +

+

+ 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/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +

+

+ +file2_Traces_and_Tangent + + ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) +

+

+ +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/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) +

+

+ +file4_Types_of_critical_points + ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) +

+

+ +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/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) +

+

+ + + + -- cgit From 5c9fa6fe7f9215d671dc6a0c0540648964600983 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:35:41 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 364c968..8780553 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -23,11 +23,13 @@

file4_Types_of_critical_points + ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true)



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/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)



-- cgit From b8e2998bed20b074ccf0c4a35c9e4c97b1665361 Mon Sep 17 00:00:00 2001 From: Purusharth S Date: Mon, 15 Jun 2020 18:57:05 +0530 Subject: add subfolder for surface/triple integrals --- .../triple-and-surface-integrals/divergence-gauss-theorem/README.md | 0 .../triple-and-surface-integrals/flux/README.md | 0 .../triple-and-surface-integrals/strokes-theorem/README.md | 0 .../triple-and-surface-integrals/surface-integrals/README.md | 0 .../triple-and-surface-integrals/triple-integrals/README.md | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/divergence-gauss-theorem/README.md create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/strokes-theorem/README.md create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/README.md create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/divergence-gauss-theorem/README.md b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/divergence-gauss-theorem/README.md new file mode 100644 index 0000000..e69de29 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 new file mode 100644 index 0000000..e69de29 diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/strokes-theorem/README.md b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/strokes-theorem/README.md new file mode 100644 index 0000000..e69de29 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 new file mode 100644 index 0000000..e69de29 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 new file mode 100644 index 0000000..e69de29 -- cgit From 86deb2accb9645005fcf1ce078221bd265803ecb Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Mon, 15 Jun 2020 20:47:08 +0530 Subject: Create file1_projection.py --- .../surface-integrals/file1_projection.py | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py new file mode 100644 index 0000000..ec6e9a6 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py @@ -0,0 +1,95 @@ +from manimlib.imports import * + +class Surface(ThreeDScene): + + def construct(self): + axes=ThreeDAxes() + x=TextMobject("X") + y=TextMobject("Y") + z=TextMobject("Z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + + + + + para_hyp = ParametricSurface( + lambda u, v: np.array([ + u, + v, + 2+u/4+np.sin(v) + ]),v_min=-3,v_max=-0.4,u_min=-1,u_max=1, + resolution=(15, 32)).scale(1) + para_hyp.scale(0.3) + para_hyp.shift(1.2*RIGHT + 0.2*OUT + 0.4*DOWN) + para_hyp.rotate(PI,axis=RIGHT) + para_hyp.scale(2.5) + # para_hyp.rotate(PI/3.2,axis=OUT) + para_hyp2= ParametricSurface( + lambda u, v: np.array([ + u, + v, + 2+u/4+np.sin(v) + ]),v_min=-3,v_max=-0.4,u_min=-1,u_max=1, + resolution=(15, 32)).scale(1) + para_hyp2.scale(0.3) + para_hyp2.shift(1.2*RIGHT + 0.2*OUT + 0.4*DOWN) + para_hyp2.rotate(PI,axis=RIGHT) + para_hyp2.scale(2.5) + + rec=Rectangle(height=2.11, width=1.58, color=RED, fill_opacity=0.66) + rec.shift(1.3*RIGHT + 2.295*DOWN) + # rec.scale(2.5) + + + l1=DashedLine(start=0.5*RIGHT+1.1*DOWN+1.55*OUT,end=0.5*RIGHT+1.1*DOWN) + l2=DashedLine(start=2.1*RIGHT+1.1*DOWN+1.25*OUT,end=2.1*RIGHT+1.1*DOWN) + l3=DashedLine(start=2.1*RIGHT+3.4*DOWN+1.6*OUT,end=2.1*RIGHT+3.4*DOWN) + l4=DashedLine(start=0.5*RIGHT+3.4*DOWN+2*OUT,end=0.5*RIGHT+3.4*DOWN) + l=VGroup(l1,l2,l3,l4) + + + + s=TextMobject("S",tex_to_color_map={"S": YELLOW}) + s.rotate(PI/4,axis=RIGHT) + s.rotate(PI/15,axis=OUT) + s.shift(RIGHT + 2*OUT + 1.5*DOWN) + d=TextMobject("D",tex_to_color_map={"D": YELLOW}) + d.scale(0.85) + d.shift(1.26*RIGHT + 2.45*DOWN) + + + + + self.set_camera_orientation(phi=75 * DEGREES,theta=-60*DEGREES) + # self.set_camera_orientation(phi=90 * DEGREES,theta=-82.7*DEGREES) + self.begin_ambient_camera_rotation(rate=-0.02) + self.play(ShowCreation(axes),ShowCreation(axis_label)) + self.wait(1.3) + self.play(ShowCreation(para_hyp)) + self.play(ShowCreation(s)) + self.add(para_hyp2) + # self.play(ShowCreation(l)) + self.play(Transform(para_hyp,rec),run_time=2) + # self.play(ShowCreation(rec)) + # self.wait(0.7) + + # # self.stop_ambient_camera_rotation() + # self.wait(1.2) + self.play(ShowCreation(d)) + + self.wait(3) + + -- cgit From 98dc4c2c1afd70cd2ebba867b5d238ebd2a3c5a2 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 09:58:34 +0530 Subject: Delete file1_projection.py --- .../surface-integrals/file1_projection.py | 95 ---------------------- 1 file changed, 95 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py deleted file mode 100644 index ec6e9a6..0000000 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py +++ /dev/null @@ -1,95 +0,0 @@ -from manimlib.imports import * - -class Surface(ThreeDScene): - - def construct(self): - axes=ThreeDAxes() - x=TextMobject("X") - y=TextMobject("Y") - z=TextMobject("Z") - - x.rotate(PI/2, axis=RIGHT) - x.rotate(PI/4,axis=OUT) - x.shift(5.8*DOWN) - - y.rotate(PI/2, axis=RIGHT) - y.rotate(PI/8,axis=OUT) - y.shift(5.8*RIGHT) - - z.rotate(PI/2, axis=RIGHT) - z.rotate(PI/5,axis=OUT) - z.shift(3.2*OUT+0.4*LEFT) - axis_label=VGroup(x,y,z) - - - - - - para_hyp = ParametricSurface( - lambda u, v: np.array([ - u, - v, - 2+u/4+np.sin(v) - ]),v_min=-3,v_max=-0.4,u_min=-1,u_max=1, - resolution=(15, 32)).scale(1) - para_hyp.scale(0.3) - para_hyp.shift(1.2*RIGHT + 0.2*OUT + 0.4*DOWN) - para_hyp.rotate(PI,axis=RIGHT) - para_hyp.scale(2.5) - # para_hyp.rotate(PI/3.2,axis=OUT) - para_hyp2= ParametricSurface( - lambda u, v: np.array([ - u, - v, - 2+u/4+np.sin(v) - ]),v_min=-3,v_max=-0.4,u_min=-1,u_max=1, - resolution=(15, 32)).scale(1) - para_hyp2.scale(0.3) - para_hyp2.shift(1.2*RIGHT + 0.2*OUT + 0.4*DOWN) - para_hyp2.rotate(PI,axis=RIGHT) - para_hyp2.scale(2.5) - - rec=Rectangle(height=2.11, width=1.58, color=RED, fill_opacity=0.66) - rec.shift(1.3*RIGHT + 2.295*DOWN) - # rec.scale(2.5) - - - l1=DashedLine(start=0.5*RIGHT+1.1*DOWN+1.55*OUT,end=0.5*RIGHT+1.1*DOWN) - l2=DashedLine(start=2.1*RIGHT+1.1*DOWN+1.25*OUT,end=2.1*RIGHT+1.1*DOWN) - l3=DashedLine(start=2.1*RIGHT+3.4*DOWN+1.6*OUT,end=2.1*RIGHT+3.4*DOWN) - l4=DashedLine(start=0.5*RIGHT+3.4*DOWN+2*OUT,end=0.5*RIGHT+3.4*DOWN) - l=VGroup(l1,l2,l3,l4) - - - - s=TextMobject("S",tex_to_color_map={"S": YELLOW}) - s.rotate(PI/4,axis=RIGHT) - s.rotate(PI/15,axis=OUT) - s.shift(RIGHT + 2*OUT + 1.5*DOWN) - d=TextMobject("D",tex_to_color_map={"D": YELLOW}) - d.scale(0.85) - d.shift(1.26*RIGHT + 2.45*DOWN) - - - - - self.set_camera_orientation(phi=75 * DEGREES,theta=-60*DEGREES) - # self.set_camera_orientation(phi=90 * DEGREES,theta=-82.7*DEGREES) - self.begin_ambient_camera_rotation(rate=-0.02) - self.play(ShowCreation(axes),ShowCreation(axis_label)) - self.wait(1.3) - self.play(ShowCreation(para_hyp)) - self.play(ShowCreation(s)) - self.add(para_hyp2) - # self.play(ShowCreation(l)) - self.play(Transform(para_hyp,rec),run_time=2) - # self.play(ShowCreation(rec)) - # self.wait(0.7) - - # # self.stop_ambient_camera_rotation() - # self.wait(1.2) - self.play(ShowCreation(d)) - - self.wait(3) - - -- cgit From 2c839dd7c15ee71ede8dd2cff5d65ff4cf047940 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 10:00:41 +0530 Subject: Create file1_projection.py --- .../surface-integrals/file1_projection.py | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py new file mode 100644 index 0000000..2d6f067 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file1_projection.py @@ -0,0 +1,89 @@ +from manimlib.imports import * + +class Surface(ThreeDScene): + + def construct(self): + axes=ThreeDAxes() + x=TextMobject("X") + y=TextMobject("Y") + z=TextMobject("Z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + + + + + para_hyp = ParametricSurface( + lambda u, v: np.array([ + u, + v, + 2+u/4+np.sin(v) + ]),v_min=-3,v_max=-0.4,u_min=-1,u_max=1, + resolution=(15, 32)).scale(1) + para_hyp.scale(0.3) + para_hyp.shift(1.2*RIGHT + 0.2*OUT + 0.4*DOWN) + para_hyp.rotate(PI,axis=RIGHT) + para_hyp.scale(2.5) + # para_hyp.rotate(PI/3.2,axis=OUT) + para_hyp2= ParametricSurface( + lambda u, v: np.array([ + u, + v, + 2+u/4+np.sin(v) + ]),v_min=-3,v_max=-0.4,u_min=-1,u_max=1, + resolution=(15, 32)).scale(1) + para_hyp2.scale(0.3) + para_hyp2.shift(1.2*RIGHT + 0.2*OUT + 0.4*DOWN) + para_hyp2.rotate(PI,axis=RIGHT) + para_hyp2.scale(2.5) + + rec=Rectangle(height=2.11, width=1.58, color=RED, fill_opacity=0.66) + rec.shift(1.3*RIGHT + 2.295*DOWN) + # rec.scale(2.5) + + + l1=DashedLine(start=0.5*RIGHT+1.1*DOWN+1.55*OUT,end=0.5*RIGHT+1.1*DOWN) + l2=DashedLine(start=2.1*RIGHT+1.1*DOWN+1.25*OUT,end=2.1*RIGHT+1.1*DOWN) + l3=DashedLine(start=2.1*RIGHT+3.4*DOWN+1.6*OUT,end=2.1*RIGHT+3.4*DOWN) + l4=DashedLine(start=0.5*RIGHT+3.4*DOWN+2*OUT,end=0.5*RIGHT+3.4*DOWN) + l=VGroup(l1,l2,l3,l4) + + + + s=TextMobject("S",tex_to_color_map={"S": YELLOW}) + s.rotate(PI/4,axis=RIGHT) + s.rotate(PI/15,axis=OUT) + s.shift(RIGHT + 2*OUT + 1.5*DOWN) + d=TextMobject("D",tex_to_color_map={"D": YELLOW}) + d.scale(0.85) + d.shift(1.26*RIGHT + 2.45*DOWN) + + + + + + self.set_camera_orientation(phi=75 * DEGREES,theta=-60*DEGREES) + self.begin_ambient_camera_rotation(rate=-0.02) + self.play(ShowCreation(axes),ShowCreation(axis_label)) + self.wait(1.3) + self.play(ShowCreation(para_hyp)) + self.play(ShowCreation(s)) + self.add(para_hyp2) + self.play(Transform(para_hyp,rec),run_time=2) + self.play(ShowCreation(d)) + + self.wait(3) + + -- cgit From b7948a8f28bd0d0f3e1c9672bc4203667be6a7e8 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 10:14:23 +0530 Subject: projection --- .../surface-integrals/Surface.gif | Bin 0 -> 14952521 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/Surface.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/Surface.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/Surface.gif new file mode 100644 index 0000000..3516e33 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/Surface.gif differ -- cgit From 424365f9f93d086e869f55a3bd2598fe853db8aa Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 10:15:29 +0530 Subject: Delete Surface.gif --- .../surface-integrals/Surface.gif | Bin 14952521 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/Surface.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/Surface.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/Surface.gif deleted file mode 100644 index 3516e33..0000000 Binary files a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/Surface.gif and /dev/null differ -- cgit From 7a80a45a4989bd67133ac80c3c4748fceee66b40 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 10:24:27 +0530 Subject: file1_projection.gif --- .../surface-integrals/projection.gif | Bin 0 -> 4142689 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/projection.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/projection.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/projection.gif new file mode 100644 index 0000000..c0ca611 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/projection.gif differ -- cgit From 0bd7ea716ac382cacb0be32ac1446303bf2de51d Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 12:57:36 +0530 Subject: Create file2_cube.py --- .../surface-integrals/file2_cube.py | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file2_cube.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file2_cube.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file2_cube.py new file mode 100644 index 0000000..2a094c8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file2_cube.py @@ -0,0 +1,75 @@ +from manimlib.imports import* +class cuber(ThreeDScene): + + def construct(self): + + axes=ThreeDAxes() + cube=Cube(color=RED) + # cube.scale(1) + cube.shift(RIGHT+DOWN+OUT) + + sq1=Square(side_length=2,color=RED, fill_opacity=0.5) + sq1.shift(RIGHT+DOWN) + # sq1.scale(1.2) + sq2=Square(color=YELLOW, fill_opacity=0.5) + sq2.rotate(PI/2,axis=RIGHT) + sq2.shift(RIGHT+OUT) + + sq3=Square(color=GREEN , fill_opacity=0.5) + sq3.rotate(PI/2, axis=UP) + sq3.shift(DOWN+OUT) + + a=TextMobject("side A",tex_to_color_map={"side A": BLACK}) + b=TextMobject("side B",tex_to_color_map={"side B": BLACK}) + c=TextMobject("side C",tex_to_color_map={"side C": BLACK}) + a.rotate(PI/2, axis=RIGHT) + a.shift(RIGHT+OUT+2*DOWN) + b.rotate(PI/2, axis=OUT) + b.rotate(PI/2, axis=UP) + b.shift(2*RIGHT+DOWN+OUT) + c.shift(RIGHT+DOWN+2*OUT) + c.rotate(PI/4, axis=OUT) + + + axes=ThreeDAxes() + x=TextMobject("X") + y=TextMobject("Y") + z=TextMobject("Z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + + + + + + self.set_camera_orientation(phi=75 * DEGREES,theta=-67*DEGREES) + self.play(ShowCreation(axes),ShowCreation(axis_label)) + self.play(ShowCreation(cube)) + self.begin_ambient_camera_rotation(rate=0.04) + self.wait(0.7) + self.play(ShowCreation(sq1)) + self.play(ShowCreation(sq2)) + + self.play(ShowCreation(sq3)) + self.wait(0.6) + self.play(ShowCreation(a)) + + self.play(ShowCreation(b)) + self.move_camera(phi=60*DEGREES,run_time=1) + self.play(ShowCreation(c)) + self.wait(1) + self.wait(2) + + -- cgit From aa007ee624cdfc8c59d9ef04f8aeabff5b8fa540 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:00:11 +0530 Subject: Add files via upload --- .../surface-integrals/cube.gif | Bin 0 -> 4624266 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/cube.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/cube.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/cube.gif new file mode 100644 index 0000000..2035d7a Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/cube.gif differ -- cgit From c625cf88c4a32810bf6b87594f302ed8ec45edcc Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:03:26 +0530 Subject: Create file3_cube_sideC.py --- .../surface-integrals/file3_cube_sideC.py | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file3_cube_sideC.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file3_cube_sideC.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file3_cube_sideC.py new file mode 100644 index 0000000..0e6fdaa --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file3_cube_sideC.py @@ -0,0 +1,96 @@ +from manimlib.imports import* + + + +class cuber(ThreeDScene): + + def construct(self): + + axes=ThreeDAxes() + cube=Cube(color=RED) + # cube.scale(1) + cube.shift(RIGHT+DOWN+OUT) + + sq1=Square(side_length=1.95,color=BLUE, fill_opacity=1) + sq1.shift(RIGHT+DOWN+2*OUT) + # sq1.scale(1.2) + + sq12=Square(side_length=1.95,color=BLUE, fill_opacity=1) + sq12.shift(RIGHT+DOWN+2*OUT) + + sq2=Square(side_length=1.95,color=RED, fill_opacity=0.6) + sq2.shift(RIGHT+DOWN) + + sq2w=Square(side_length=1.95,color=WHITE, fill_opacity=0.9) + sq2w.shift(RIGHT+DOWN) + + + c=TextMobject("side C",tex_to_color_map={"side C": BLACK}) + + dxdy=TextMobject(r"$dxdy$",tex_to_color_map={r"$dxdy$": WHITE}) + dxdy.scale(0.7) + dxdy.rotate(PI/2, axis=RIGHT) + dxdy.rotate(PI/7, axis=OUT) + dxdy.shift(0.85*RIGHT+0.65*DOWN) + + + + c.shift(RIGHT+DOWN+2*OUT) + c.rotate(PI/4, axis=OUT) + + + + x=TextMobject("X") + y=TextMobject("Y") + z=TextMobject("Z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + v=Vector(color=YELLOW) + # v.scale(2) + v.rotate(PI/2,axis=DOWN) + v.shift(0.4*RIGHT+0.9*DOWN+2.5*OUT) + + + + + + + self.set_camera_orientation(phi=60 * DEGREES,theta=-67*DEGREES) + self.begin_ambient_camera_rotation(rate=0.008) + self.add(axes) + self.add(axis_label) + + self.add(cube) + # self.move_camera(phi=150*DEGREES,theta=-45*DEGREES, run_time=3) + self.wait(1.2) + self.add(sq1) + self.add(sq12) + self.play(ShowCreation(c)) + self.wait(0.7) + self.play(FadeOut(cube)) + self.wait(0.7) + # self.move_camera(phi=75*DEGREES,run_time=2) + self.play(ShowCreation(v)) + self.wait(1) + self.play(Transform(sq1,sq2)) + self.wait(0.7) + self.play(ApplyMethod(sq2w.scale, 0.08)) + self.play(ShowCreation(dxdy)) + self.wait(2) + + + + + -- cgit From e9ef5b0d74c46ac33b48b435dc750ae11758334d Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:04:53 +0530 Subject: Add files via upload --- .../surface-integrals/sideC.gif | Bin 0 -> 3483849 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/sideC.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/sideC.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/sideC.gif new file mode 100644 index 0000000..17b72ff Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/sideC.gif differ -- cgit From 2cf9ea3801b9b0233a428a679f4274006b2ea472 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:07:41 +0530 Subject: Create file4_pauseandponder.py --- .../surface-integrals/file4_pauseandponder.py | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_pauseandponder.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_pauseandponder.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_pauseandponder.py new file mode 100644 index 0000000..a8b5070 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_pauseandponder.py @@ -0,0 +1,77 @@ +from manimlib.imports import * + +class Surface(ThreeDScene): + def construct(self): + axes=ThreeDAxes() + cylinder = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + v, + u + ]), + resolution=(6, 32)).fade(0.5) #Resolution of the surfaces + + + x=TextMobject("X") + y=TextMobject("Y") + z=TextMobject("Z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + + + cylinder.rotate(PI/2, axis=RIGHT) + cylinder.shift(2*RIGHT+OUT+DOWN) + cylinder.scale(1.5) + + self.set_camera_orientation(phi=75 * DEGREES,theta=-85*DEGREES) + self.begin_ambient_camera_rotation(rate=0.1) + self.play(ShowCreation(axes),ShowCreation(axis_label)) + self.play(ShowCreation(cylinder)) + # self.wait(0.7) + + + + self.wait(2) + self.stop_ambient_camera_rotation() + self.wait(0.7) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit From 92ea2d74d0d0d37e81a918857741c1daacede823 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:09:47 +0530 Subject: Add files via upload --- .../surface-integrals/pauseandponder.gif | Bin 0 -> 1477023 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/pauseandponder.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/pauseandponder.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/pauseandponder.gif new file mode 100644 index 0000000..4308c60 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/pauseandponder.gif differ -- cgit From 93971fcabe8b15fbb124947c8322df4c3151a4a7 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:15:39 +0530 Subject: Create file1_flux_through_sphere.py --- .../flux/file1_flux_through_sphere.py | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.py new file mode 100644 index 0000000..e07715e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.py @@ -0,0 +1,50 @@ +from manimlib.imports import * +class fluxsphere(ThreeDScene): + + + def construct(self): + s = Sphere(checkerboard_colors=[BLUE_D,BLUE_D]) + s.scale(2.3) + + n = VGroup( + *[self.n(*self.func(u, v)) + for u in np.arange(0, PI, 0.4) + for v in np.arange(0, TAU, 0.8)] + ) + + + + self.move_camera(0.8 * PI / 2, -0.45 * PI) + self.play(Write(s)) + # self.play(Write(f)) + self.play(ShowCreation(n), run_time=4) + # self.add(n) + self.begin_ambient_camera_rotation(rate=0.1) + self.wait(5) + + + def func(self, u, v): + return [ + np.cos(v) * np.sin(u), + np.sin(v) * np.sin(u), + np.cos(u) + ] + + def vect(self, x, y, z): + return np.array([ + x, y, z + ]) + + def n(self, x, y, z): + vect = np.array([ + x, + y, + z + ]) + + mag = math.sqrt(vect[0] ** 2 + vect[1] ** 2 + vect[2] ** 2) + v = Vector( + (1.5/mag) * vect, + color=RED_B, + stroke_width=4).shift(2*x * RIGHT + 2*y * UP + 2*z * OUT) + return v -- cgit From 510a0387a035d5b9d8908c6db2dbf531568f1b6e Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:17:16 +0530 Subject: Add files via upload --- .../flux/file1_flux_through_sphere.gif | Bin 0 -> 7695314 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.gif new file mode 100644 index 0000000..43327bf Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file1_flux_through_sphere.gif differ -- cgit From 52e633214992ecf0145815d8518e1acf5028c2de Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:19:53 +0530 Subject: Create file2_mobius_strip.py --- .../flux/file2_mobius_strip.py | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py new file mode 100644 index 0000000..31b1990 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.py @@ -0,0 +1,81 @@ +from manimlib.imports import * + +class Mobius(ThreeDScene): + def construct(self): + axes=ThreeDAxes() + + + + R=2.5 + + + mobius = ParametricSurface( + lambda u, v: np.array([ + (R+u*np.cos(v/2))*np.cos(v), + (R+u*np.cos(v/2))*np.sin( v), + u*np.sin(v/2) + ]), + u_min = -0.5, u_max = 0.5, v_min = 0, v_max = 2*PI, + + resolution=(6, 32)).fade(0.5) #Resolution of the surfaces + circle=Circle(radius=2.5, color=BLUE) + + + + mobius.rotate(PI/2, axis=RIGHT) + mobius.rotate(PI/2, axis=OUT) + # # mobius.shift(RIGHT+OUT+DOWN) + + + + + + along = ParametricSurface( + lambda u, v: np.array([ + (R+u*np.cos(v/2))*np.cos(v), + (R+u*np.cos(v/2))*np.sin(v), + 0 + ]), + u_min = -0.5, u_max = 0.5, v_min = 0, v_max = 2*PI, + + resolution=(6, 32)).fade(0.5) #Resolution of the surfaces + circle=Circle(radius=2.5, color=BLUE) + + + + + + + + + + + + + + + + + + + + + + + + self.set_camera_orientation(phi=75 * DEGREES,theta=-75*DEGREES) + + self.play(Write(mobius)) + + self.wait(1) + self.begin_ambient_camera_rotation(rate=0.65) + + self.wait(10) + self.stop_ambient_camera_rotation() + self.wait(1) + + + + + + -- cgit From 0d0ad18b69f002d27e34e90da4be1e80577d4293 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:23:08 +0530 Subject: Add files via upload --- .../flux/file2_mobius_strip.gif | Bin 0 -> 20725583 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.gif new file mode 100644 index 0000000..9623046 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file2_mobius_strip.gif differ -- cgit From 8fbe4b485ce66790ba0e9e470617825e312cfea3 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:25:09 +0530 Subject: Create file3_normal_vector.py --- .../flux/file3_normal_vector.py | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.py new file mode 100644 index 0000000..a959210 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.py @@ -0,0 +1,47 @@ +from manimlib.imports import * +class S(ThreeDScene): + def construct(self): + axes=ThreeDAxes() + + sphere=Sphere(radius=2,checkerboard_colors=[BLUE_C,BLUE_B],fill_opacity=0.75) + + + v1=Vector(color=YELLOW,buff=5) + v1.rotate(PI/4,axis=DOWN) + v1.shift(1.5*RIGHT+1.5*OUT) + + v2=Vector(color=RED,buff=5) + v2.rotate(PI/4,axis=DOWN) + v2.rotate(PI,axis=DOWN) + v2.shift(0.77*RIGHT+0.77*OUT) + + + + + n1=TextMobject(r"$\vec{n}$",color=YELLOW) + n2=TextMobject(r"$-\vec{n}$",color= RED) + n1.rotate(PI/2,axis=RIGHT) + n1.shift(2*RIGHT+2*OUT) + n2.rotate(PI/2,axis=RIGHT) + n2.shift(0.42*RIGHT+0.42*OUT) + + + + self.set_camera_orientation(phi=75 * DEGREES,theta=-45*DEGREES) + # self.add(mobius) + # self.play(ShowCreation(axes)) + self.play(ShowCreation(axes)) + # self.play(ShowCreation(vg)) + self.play(ShowCreation(sphere)) + self.wait(0.7) + self.play(ShowCreation(v1, run_time=2)) + self.play(ShowCreation(n1)) + self.wait(1) + self.begin_ambient_camera_rotation(rate=0.65) + self.wait(2) + self.play(ShowCreation(v2, run_time=3)) + self.wait(3) + self.play(ShowCreation(n2)) + + self.stop_ambient_camera_rotation() + self.wait(1.2) -- cgit From 89ea1c747bacfc073a052c36081bd1d2f2f0c199 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:28:59 +0530 Subject: Add files via upload --- .../flux/file3_normal_vector.gif | Bin 0 -> 24776215 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.gif new file mode 100644 index 0000000..a8f2990 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file3_normal_vector.gif differ -- cgit From 24a759834626921654aba1fbae74c70e3a3d7b1c Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:30:10 +0530 Subject: Add files via upload --- .../flux/file4_cube_surface.gif | Bin 0 -> 3620201 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif new file mode 100644 index 0000000..c6101cf Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.gif differ -- cgit From 7f39c6fcf7990fafe53fe2aeb2c2f7bfd429b970 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 13:30:58 +0530 Subject: Create file4_cube_surface.py --- .../flux/file4_cube_surface.py | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..5963996 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/file4_cube_surface.py @@ -0,0 +1,71 @@ +from manimlib.imports import* + + + +class cuber(ThreeDScene): + def construct(self): + + axes=ThreeDAxes() + cube=Cube() + # cube.scale(1) + cube.shift(RIGHT+DOWN+OUT) + + + + sq3=Square(color=RED, fill_opacity=0.85) + sq3.rotate(PI/2, axis=UP) + sq3.shift(DOWN+OUT+2*RIGHT) + + x=TextMobject("x") + y=TextMobject("y") + z=TextMobject("z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + v1=Vector(color=YELLOW,buff=15) + v1.rotate(PI/4,axis=RIGHT) + v1.shift(2*RIGHT+1*DOWN+1*OUT) + + + n1=TextMobject(r"$\vec{n}$",color=YELLOW) + n1.scale(0.8) + n1.rotate(PI/2,axis=RIGHT) + n1.shift(3*RIGHT+1.3*OUT+DOWN) + + + + self.set_camera_orientation(phi=75 * DEGREES,theta=-15*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.wait(1) + self.play(ShowCreation(sq3)) + + self.wait(1) + self.play(ShowCreation(v1),ShowCreation(n1)) + 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) -- cgit From e864f0df8c444adc6b8bca088270c7d3dbe9fe4f Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 16:05:53 +0530 Subject: Create file1_3D_crossproduct.py --- .../triple-integrals/file1_3D_crossproduct.py | 120 +++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file1_3D_crossproduct.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file1_3D_crossproduct.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file1_3D_crossproduct.py new file mode 100644 index 0000000..6720e7e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file1_3D_crossproduct.py @@ -0,0 +1,120 @@ +from manimlib.imports import* + + + +class TripleBox(ThreeDScene): + + def construct(self): + + axes=ThreeDAxes() + cube=Cube(fill_color=RED,fill_opacity=0.5) + cube.scale(0.5) + cube.shift(0.5*RIGHT+0.5*DOWN+0.5*OUT) + cube.shift(2*RIGHT+2*DOWN+1*OUT) + + + + x=TextMobject("x") + y=TextMobject("y") + z=TextMobject("z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + + + + a=TextMobject("a") + b=TextMobject("b") + c=TextMobject("c") + d=TextMobject("d") + e=TextMobject("e") + f=TextMobject("f") + + + + a.rotate(PI/2, axis=RIGHT) + a.rotate(PI/2, axis=OUT) + a.shift(2*DOWN+0.3*OUT+0.3*LEFT) + + b.rotate(PI/2, axis=RIGHT) + b.rotate(PI/2, axis=OUT) + b.shift(3*DOWN+0.3*OUT+0.3*LEFT) + + + c.rotate(PI/2, axis=RIGHT) + c.shift(2*RIGHT+0.3*OUT) + + d.rotate(PI/2, axis=RIGHT) + d.shift(3*RIGHT+0.3*OUT) + + + e.rotate(PI/2, axis=RIGHT) + e.rotate(PI/4, axis=OUT) + e.shift(1*OUT+0.3*DOWN+0.2*LEFT) + + + f.rotate(PI/2, axis=RIGHT) + f.rotate(PI/4, axis=OUT) + f.shift(2*OUT+0.3*DOWN+0.2*LEFT) + + + + rec1=Rectangle(height=1, width=8,color=RED, fill_color=RED_C, fill_opacity=0.40) + rec1.shift(2.5*DOWN+4*RIGHT) + + rec2=Rectangle(height=1, width=14,color=RED, fill_color=RED_C, fill_opacity=0.40) + rec2.rotate(PI/2, axis=OUT) + rec2.shift(7*DOWN+2.5*RIGHT) + + + sq=Square(color=RED,fill_opacity=60,side_length=1) + sq.shift(2.5*RIGHT+2.5*DOWN) + + + + self.set_camera_orientation(phi=70 * DEGREES,theta=-70*DEGREES) + self.play(ShowCreation(axes),ShowCreation(axis_label)) + self.begin_ambient_camera_rotation(rate=0.04) + self.play(ShowCreation(a),ShowCreation(b)) + self.wait(0.5) + self.play(ShowCreation(rec1)) + self.play(ShowCreation(c),ShowCreation(d)) + self.play(ShowCreation(rec2)) + self.add(sq) + self.wait(0.5) + + self.play(FadeOut(rec1),FadeOut(rec2)) + self.wait(1) + + self.play(ShowCreation(e),ShowCreation(f)) + self.wait(0.5) + self.play(ApplyMethod(sq.shift, 1*OUT)) + self.wait(0.5) + self.play(Transform(sq,cube)) + + + self.wait(0.5) + + + + self.wait(0.5) + + + + + self.wait(3) + self.stop_ambient_camera_rotation() + self.wait(1.5) + + -- cgit From 77b42f3b1d14f810ffc7f3b836aa430707c41585 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 16:07:30 +0530 Subject: Add files via upload --- .../triple-integrals/file1_3D_crossproduct.gif | Bin 0 -> 9073424 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file1_3D_crossproduct.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file1_3D_crossproduct.gif b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file1_3D_crossproduct.gif new file mode 100644 index 0000000..9bde5a1 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file1_3D_crossproduct.gif differ -- cgit From 0121373ea6a4f866838d94b864b2f9da27d0b8b5 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 16:09:59 +0530 Subject: Create file2_cylindrical_coordinates.py --- .../file2_cylindrical_coordinates.py | 164 +++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.py new file mode 100644 index 0000000..d441dc0 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.py @@ -0,0 +1,164 @@ +from manimlib.imports import* +class Cy(ThreeDScene): + + def construct(self): + + axes=ThreeDAxes() + x=TextMobject("X") + y=TextMobject("Y") + z=TextMobject("Z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + + + + + + + x1=TextMobject("$x_{1}$") + y1=TextMobject("$y_{1}$") + z1=TextMobject("$z_{1}$") + + + + + x1.rotate(PI/2, axis=RIGHT) + x1.rotate(PI/2, axis=OUT) + x1.shift(2*DOWN+0.3*OUT+0.3*LEFT) + + y1.rotate(PI/2, axis=RIGHT) + y1.shift(2*RIGHT+0.3*OUT) + + z1.rotate(PI/2, axis=RIGHT) + z1.rotate(PI/4, axis=OUT) + z1.shift(2*OUT+0.3*DOWN+0.2*LEFT) + + + d1=Dot(color=RED,radius=0.05) + d2=Dot(color=RED,radius=0.05) + d3=Dot(color=RED,radius=0.05) + + + d1.shift(2*DOWN) + d1.rotate(PI/2,axis=UP) + + d2.rotate(PI/2, axis=RIGHT) + d2.shift(2*RIGHT) + + d3.rotate(PI/2, axis=RIGHT) + d3.rotate(PI/4, axis=OUT) + d3.shift(2*OUT) + + + + l1=DashedLine(color=RED) + l1.scale(5) + l1.shift(2*DOWN+5*RIGHT) + + l2=DashedLine(color=RED) + l2.scale(5) + l2.rotate(PI/2, axis=IN) + l2.shift(2*RIGHT+5*DOWN) + + l3=DashedLine(color=RED) + l3.scale(5) + l3.rotate(PI/4,axis=IN) + l3.shift(2*OUT+4*RIGHT+4*DOWN) + + point=Sphere(radius=0.02, checkerboard_colors=[BLUE,BLUE]) + point.shift(2*RIGHT+2*DOWN) + + proj=Line() + proj.scale(1.414) + proj.rotate(PI/4,axis=IN) + proj.shift(1*RIGHT+1*DOWN) + + + projl=DashedLine() + projl.rotate(PI/2, axis=DOWN) + projl.shift(1*OUT+2*RIGHT+2*DOWN) + + p=TextMobject("$P(x,y,z)$") + p.scale(0.6) + p.rotate(PI/2, axis=RIGHT) + p.rotate(PI/9, axis=OUT) + p.shift(2.9*RIGHT+2.5*DOWN+2.3*OUT) + + rho=TextMobject(r"$\rho$",tex_to_color_map={r"$\rho$": YELLOW}) + rho.rotate(PI/2, axis=RIGHT) + rho.shift(1.5*RIGHT+1.36*DOWN+0.2*OUT) + + + + + carrow=CurvedArrow(start_point=1*DOWN, end_point=0.5*RIGHT+0.5*DOWN) + + + phi=TextMobject(r"$\phi$",tex_to_color_map={"$\phi$": YELLOW}) + phi.scale(0.93) + phi.rotate(PI/2, axis=RIGHT) + phi.shift(0.3*RIGHT+1.3*DOWN) + + + + + + + + + + + self.set_camera_orientation(phi=70 * DEGREES,theta=-15*DEGREES) + self.play(ShowCreation(axes),ShowCreation(axis_label)) + self.begin_ambient_camera_rotation(rate=-0.1) + + self.play(ShowCreation(x1),ShowCreation(d1)) + self.wait(0.5) + self.play(ShowCreation(l1)) + self.wait(1) + self.play(ShowCreation(y1),ShowCreation(d2)) + self.wait(0.5) + self.play(ShowCreation(l2)) + self.wait(1) + self.add(point) + self.wait(0.5) + self.play(FadeOut(l1),FadeOut(l2)) + self.wait(0.5) + self.play(ShowCreation(proj)) + self.wait(0.64) + self.stop_ambient_camera_rotation() + self.play(ShowCreation(rho)) + self.wait(1) + + self.play(ShowCreation(z1),ShowCreation(d3)) + self.wait(0.5) + self.play(ShowCreation(l3)) + self.wait(1) + self.play(ApplyMethod(point.shift, 2*OUT), ShowCreation(projl)) + self.play(FadeOut(l3)) + self.play(ShowCreation(p),FadeOut(projl)) + self.wait(0.5) + # self.play(ShowCreation(vec)) + + + + + + self.wait(1) + self.play(ShowCreation(carrow),ShowCreation(phi)) + + self.wait(5) + + -- cgit From 733599437e0f743b4d40c2d48fe797c6d0fe0ab1 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 16:11:18 +0530 Subject: Add files via upload --- .../file2_cylindrical_coordinates.gif | Bin 0 -> 6912988 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..e913750 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif differ -- cgit From 7dc1cb63c5cb7eb67d121784ae261d2b1160ca53 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 16:12:38 +0530 Subject: Create file2_spherical_coordinates.py --- .../file2_spherical_coordinates.py | 159 +++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_spherical_coordinates.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_spherical_coordinates.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_spherical_coordinates.py new file mode 100644 index 0000000..7dcc81a --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_spherical_coordinates.py @@ -0,0 +1,159 @@ +from manimlib.imports import* +class Sp(ThreeDScene): + + def construct(self): + + axes=ThreeDAxes() + x=TextMobject("X") + y=TextMobject("Y") + z=TextMobject("Z") + + x.rotate(PI/2, axis=RIGHT) + x.rotate(PI/4,axis=OUT) + x.shift(5.8*DOWN) + + y.rotate(PI/2, axis=RIGHT) + y.rotate(PI/8,axis=OUT) + y.shift(5.8*RIGHT) + + z.rotate(PI/2, axis=RIGHT) + z.rotate(PI/5,axis=OUT) + z.shift(3.2*OUT+0.4*LEFT) + axis_label=VGroup(x,y,z) + + + + + + + + x1=TextMobject("$x_{1}$") + y1=TextMobject("$y_{1}$") + z1=TextMobject("$z_{1}$") + + + + + x1.rotate(PI/2, axis=RIGHT) + x1.rotate(PI/2, axis=OUT) + x1.shift(2*DOWN+0.3*OUT+0.3*LEFT) + + y1.rotate(PI/2, axis=RIGHT) + y1.shift(2*RIGHT+0.3*OUT) + + z1.rotate(PI/2, axis=RIGHT) + z1.rotate(PI/4, axis=OUT) + z1.shift(2*OUT+0.3*DOWN+0.2*LEFT) + + + d1=Dot(color=RED,radius=0.05) + d2=Dot(color=RED,radius=0.05) + d3=Dot(color=RED,radius=0.05) + + + d1.shift(2*DOWN) + d1.rotate(PI/2,axis=UP) + + d2.rotate(PI/2, axis=RIGHT) + d2.shift(2*RIGHT) + + d3.rotate(PI/2, axis=RIGHT) + d3.rotate(PI/4, axis=OUT) + d3.shift(2*OUT) + + + + l1=DashedLine(color=RED) + l1.scale(5) + l1.shift(2*DOWN+5*RIGHT) + + l2=DashedLine(color=RED) + l2.scale(5) + l2.rotate(PI/2, axis=IN) + l2.shift(2*RIGHT+5*DOWN) + + l3=DashedLine(color=RED) + l3.scale(5) + l3.rotate(PI/4,axis=IN) + l3.shift(2*OUT+4*RIGHT+4*DOWN) + + point=Sphere(radius=0.02, checkerboard_colors=[RED,RED]) + + + proj=DashedLine(color=RED_C) + proj.scale(1.414) + proj.rotate(PI/4,axis=IN) + proj.shift(1*RIGHT+1*DOWN) + + + projl=DashedLine() + projl.rotate(PI/2, axis=UP) + projl.shift(1*OUT+2*RIGHT+2*DOWN) + + p=TextMobject("$P(x,y,z)$") + p.scale(0.6) + p.rotate(PI/2, axis=RIGHT) + p.rotate(PI/9, axis=OUT) + p.shift(2.65*RIGHT+2.5*DOWN+2.3*OUT) + + rho=TextMobject(r"$\rho$",tex_to_color_map={r"$\rho$": YELLOW}) + rho.rotate(PI/2, axis=RIGHT) + rho.shift(1.45*RIGHT+1.9*DOWN+1.94*OUT) + + + + + + carrow=ArcBetweenPoints(start=1*DOWN, end=0.5*RIGHT+0.5*DOWN) + carrow2=ArcBetweenPoints(start=0.5*RIGHT+0.5*DOWN+0.5*OUT, end=0.4*OUT) + # carrow2.rotate(PI/2, axis=LEFT) + # carrow2.rotate(PI/2, axis=UP) + + theta=TextMobject(r"$\theta$",tex_to_color_map={r"$\theta$": YELLOW}) + theta.shift((0.75*OUT+0.2*RIGHT)) + theta.rotate(PI/2,axis=RIGHT) + theta.scale(0.9) + + + + + phi=TextMobject(r"$\phi$",tex_to_color_map={"$\phi$": YELLOW}) + phi.scale(0.93) + phi.rotate(PI/2, axis=RIGHT) + phi.shift(0.42*RIGHT+1.3*DOWN) + + + + + + + + + + + self.set_camera_orientation(phi=70 * DEGREES,theta=-85*DEGREES) + self.play(ShowCreation(axes),ShowCreation(axis_label)) + self.begin_ambient_camera_rotation(rate=0.009) + self.wait(1) + self.add(point) + self.play(ApplyMethod(point.shift, 2*RIGHT+2*DOWN+2*OUT)) + self.wait(0.5) + self.play(ShowCreation(p)) + self.wait(0.5) + self.play(ShowCreation(vec),ShowCreation(rho)) + self.wait(1.5) + self.play(ApplyMethod(point.shift,2*IN), ShowCreation(projl)) + self.wait(1) + self.play(ShowCreation(proj)) + self.wait(1.2) + self.play(ShowCreation(carrow)) + self.wait(0.64) + self.play(ShowCreation(phi)) + self.wait(1.3) + self.play(ShowCreation(carrow2)) + self.wait(0.5) + self.play(ShowCreation(theta)) + self.wait(3) + + + -- cgit From 9b47c1d47127fcec2796fb2ba1ece09cc967f327 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Tue, 16 Jun 2020 16:14:26 +0530 Subject: Add files via upload --- .../file2_cylindrical_coordinates.gif | Bin 6912988 -> 7158240 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'FSF-2020') 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 index e913750..6dc8b17 100644 Binary files a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif differ -- cgit From 37df72d2560c94ca34bb480d65d86ca78f90bbb8 Mon Sep 17 00:00:00 2001 From: Archit Sangal Date: Wed, 17 Jun 2020 16:17:50 +0530 Subject: Orthonormal basis --- .../Orthonormal Basis/file1_orthogonal.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 FSF-2020/linear-algebra/linear-transformations/Orthonormal Basis/file1_orthogonal.py (limited to 'FSF-2020') diff --git a/FSF-2020/linear-algebra/linear-transformations/Orthonormal Basis/file1_orthogonal.py b/FSF-2020/linear-algebra/linear-transformations/Orthonormal Basis/file1_orthogonal.py new file mode 100755 index 0000000..b400f93 --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Orthonormal Basis/file1_orthogonal.py @@ -0,0 +1,34 @@ +from manimlib.imports import * + +class Orthogonal(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + self.play(ShowCreation(axes)) + self.move_camera(phi=30*DEGREES,theta=-45*DEGREES,run_time=3) + line1 = Line(start = ORIGIN,end = -3*LEFT) + line1.set_color(DARK_BLUE) + tip1 = Polygon(-LEFT,-0.8*LEFT-0.2*DOWN,-0.8*LEFT-0.2*UP) + tip1.move_to(-3*LEFT) + tip1.set_opacity(1) + tip1.set_fill(DARK_BLUE) + tip1.set_color(DARK_BLUE) + + arrow2 = Line(start = ORIGIN,end = -3*UP) + arrow2.set_color(DARK_BLUE) + tip2 = Polygon(DOWN,0.8*DOWN-0.2*RIGHT,0.8*DOWN-0.2*LEFT) + tip2.move_to(3*DOWN) + tip2.set_opacity(1) + tip2.set_fill(DARK_BLUE) + tip2.set_color(DARK_BLUE) + arrow2.set_color(DARK_BLUE) + + arrow3 = Line(start = ORIGIN,end = [0,0,3]) + arrow3.set_color(DARK_BLUE) + tip3 = Polygon([0,0,3],[0,0,2.8]-0.2*RIGHT,[0,0,2.8]-0.2*LEFT) + tip3.set_opacity(1) + tip3.set_fill(DARK_BLUE) + tip3.set_color(DARK_BLUE) + + self.play(ShowCreation(line1), ShowCreation(tip1), ShowCreation(arrow2), ShowCreation(tip2), ShowCreation(arrow3), ShowCreation(tip3)) + + self.wait() \ No newline at end of file -- cgit From 86d4b8658d61c2823187b1353bb06c0daebec7ae Mon Sep 17 00:00:00 2001 From: Archit Sangal Date: Thu, 18 Jun 2020 00:26:37 +0530 Subject: Second File added --- .../Orthonormal Basis/file2_OrthonormalBasis.py | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 FSF-2020/linear-algebra/linear-transformations/Orthonormal Basis/file2_OrthonormalBasis.py (limited to 'FSF-2020') diff --git a/FSF-2020/linear-algebra/linear-transformations/Orthonormal Basis/file2_OrthonormalBasis.py b/FSF-2020/linear-algebra/linear-transformations/Orthonormal Basis/file2_OrthonormalBasis.py new file mode 100644 index 0000000..0a28f22 --- /dev/null +++ b/FSF-2020/linear-algebra/linear-transformations/Orthonormal Basis/file2_OrthonormalBasis.py @@ -0,0 +1,82 @@ +from manimlib.imports import * +class OrthonormalBasis(GraphScene): + CONFIG = { + "x_min" : -6, + "x_max" : 6, + "y_min" : -4, + "y_max" : 4, + "graph_origin" : ORIGIN , +} + + def construct(self): + self.setup_axes(animate=True) + + XTD = self.x_axis_width/(self.x_max-self.x_min) + YTD = self.y_axis_height/(self.y_max-self.y_min) + + arrow1 = Arrow(start = ORIGIN,end = 0.707*YTD*UP+0.707*XTD*RIGHT) + arrow1.scale(2.25) + arrow1.set_color(DARK_BLUE) + + arrow2 = Arrow(start = ORIGIN,end = 0.707*YTD*UP+0.707*XTD*LEFT) + arrow2.scale(2.25) + arrow2.set_color(DARK_BLUE) + + square = Polygon(UP*0.4*YTD,0.2*(YTD*UP+XTD*RIGHT),ORIGIN,0.2*(YTD*UP+XTD*LEFT)) + square.set_color(DARK_BLUE) + self.play(ShowCreation(arrow2), ShowCreation(arrow1), ShowCreation(square)) + + ortho = TextMobject("Orthonormal Vectors") + ortho.scale(0.75) + ortho.move_to(DOWN+3*RIGHT) + self.play(Write(ortho)) + self.wait() + self.play(FadeOut(ortho)) + + arrow3 = Arrow(start = ORIGIN,end = YTD*3*UP+XTD*LEFT) + arrow3.scale(1.25) + arrow3.set_color(GOLD_E) + self.play(ShowCreation(arrow3)) + + arrow4 = Arrow(start = ORIGIN,end = YTD*UP+XTD*RIGHT) + arrow4.scale(1.8) + arrow4.set_color(GOLD_A) + + arrow5 = Arrow(start = ORIGIN,end = 2*YTD*UP-2*XTD*RIGHT) + arrow5.scale(1.3) + arrow5.set_color(GOLD_A) + + self.play(ShowCreation(arrow5), ShowCreation(arrow4)) + + self.wait() + + self.play(FadeOut(arrow1), FadeOut(arrow2), FadeOut(square)) + + self.wait() + + text1 = TextMobject(r"$ v_1$") + text1.move_to(UP+2*RIGHT) + text1.scale(0.75) + text2 = TextMobject(r"$ v_2$") + text2.move_to(UP+3*LEFT) + text2.scale(0.75) + + text3 = TextMobject("v") + text3.move_to(YTD*3.5*UP+XTD*1.5*LEFT) + + self.play(Write(text1), Write(text2), Write(text3)) + self.wait() + + line1 = DashedLine(start = YTD*UP+XTD*RIGHT, end = YTD*3*UP+XTD*1*LEFT) + line2 = DashedLine(start = YTD*2*UP+XTD*2*LEFT, end = YTD*3*UP+XTD*1*LEFT) + self.play(ShowCreation(line1),ShowCreation(line2)) + + self.wait() + + text = TextMobject(r"$v$ is the sum of projections","on the orthonormal vectors") + text[0].move_to(DOWN+3.2*RIGHT) + text[1].move_to(1.5*DOWN+3.2*RIGHT) + self.play(Write(text)) + self.wait(2) + self.play(FadeOut(arrow3), FadeOut(arrow4), FadeOut(arrow5), FadeOut(text1), FadeOut(text2), FadeOut(text3), FadeOut(self.axes), FadeOut(line1), FadeOut(line2)) + self.play(FadeOut(text)) -- cgit From 65e0afa5075d41d64728250b7d3ee7c18abc9125 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:03:34 +0530 Subject: Update file1_Critical_Point_of_a_function.py --- .../file1_Critical_Point_of_a_function.py | 43 ++++++++++++++++++---- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py index 0b15ebf..f3c16d4 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py @@ -6,27 +6,56 @@ class CriticalPoint(ThreeDScene): def construct(self): axes = ThreeDAxes() - surface = ParametricSurface( + + surface = ParametricSurface( #---- partial derivatives of the funtion exists + 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]).fade(0.6).scale(3.5).shift([0,0,1.5]) + + surface2 = ParametricSurface( #---- partial derivatives of the funtion does not exists lambda u, v: np.array([ u, v, - m.exp(-10*u**2-10*v**2) #---- function equation - ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[TEAL_E,TEAL_D,TEAL_C]).fade(0.6).scale(3.5).shift([0,0,1.5]) + 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]) l1 = Line([0,0,3.75],[0,0,0],color = '#800000') - d = Dot([0,0,3.75],color = '#800000') + d = Dot([0,0,3.75],color = '#800000') #---- critical point of surface + + d2 = Dot([0,0,0],color = '#800000') #---- critical point of surface2 + + d_text = TextMobject("$\\frac{\\partial f}{\\partial x}=\\frac{\\partial f}{\\partial y} = 0$").scale(1).to_corner(UL) + + d2_text = TextMobject("$\\frac{\\partial f}{\\partial x}$ and/or $\\frac{\\partial f}{\\partial y}$ does not exist").scale(0.8).to_corner(UL) + f_text = TextMobject("Critical Point of a function",color = YELLOW).shift([3,0,3.7]).scale(0.7) - self.add(axes) + g_text = TextMobject("Critical Point of a function",color = YELLOW).shift(1*DOWN).scale(0.5) + self.set_camera_orientation(phi=75*DEGREES,theta=90*DEGREES) - self.begin_ambient_camera_rotation(rate=0.4) + self.add(axes) + self.begin_ambient_camera_rotation(rate=0.2) self.play(Write(surface)) + self.add_fixed_in_frame_mobjects(d_text) self.wait(1) self.play(Write(l1)) self.play(Write(d)) - self.wait(2) + self.wait(1) self.move_camera(phi=0 * DEGREES,theta = 90*DEGREES) + self.wait(2) self.add_fixed_in_frame_mobjects(f_text) + self.play(FadeOut(f_text),FadeOut(surface),FadeOut(axes),FadeOut(d_text),FadeOut(d),FadeOut(l1)) self.wait(1) + self.set_camera_orientation(phi=75*DEGREES,theta=60*DEGREES) + self.add(axes) + self.begin_ambient_camera_rotation(rate=0.3) + self.add_fixed_in_frame_mobjects(d2_text) + self.wait(1) + self.play(Write(surface2)) + l1.fade(0.4) + self.play(Write(l1)) + self.play(Write(d2)) + self.add_fixed_in_frame_mobjects(g_text) + self.wait(2) -- cgit From f198339d1a32de887d0695a8dcfc55128efef151 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:05:45 +0530 Subject: Delete file1_Critical_Point_of_a_function.gif --- .../file1_Critical_Point_of_a_function.gif | Bin 4518694 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif deleted file mode 100644 index b29772b..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif and /dev/null differ -- cgit From 3cd62fca3e937b454b8fb297a56fd2fa9273b993 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:12:28 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 7079252 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..c376e2d Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From 49b1ae26b41cad68d761c399057a46881fb7e546 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:22:04 +0530 Subject: Update file4_Types_of_critical_points.py --- .../file4_Types_of_critical_points.py | 88 ++++++++++++++++------ 1 file changed, 63 insertions(+), 25 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py index f9c1ef0..42703ba 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py @@ -1,6 +1,7 @@ from manimlib.imports import * -class TypescpAnimation(ThreeDScene): + +class MaximaScene(ThreeDScene): def construct(self): axes = ThreeDAxes() @@ -16,19 +17,74 @@ class TypescpAnimation(ThreeDScene): ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E], resolution = (20, 20)).scale(1.5).shift([0,0,-0.51]).fade(0.3) - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- 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.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + +class SaddlePoint(ThreeDScene): + def construct(self): - #----graph of second function f(x,y) = -x**2+y**2 + r2_text = TextMobject("Saddle Point",color ='#87CEFA') + axes = ThreeDAxes() + + #----graph of third 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_B,RED_C,RED_D, RED_E], - resolution = (20, 20)).scale(1.5).shift([0,0.2,0]).fade(0.3) + ]),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]) + + #---- trace along y axis + a = ParametricSurface( + lambda u, v: np.array([ + u, + v, + v**2 + ]),v_min = -1, v_max = 1, u_min = -0.2, u_max = 0.2).shift([0,0,0.36]).scale(1.5).set_color(GREEN) + + #---- trace along x axis + b = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -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(GREEN) + + d = Dot(color = '#800000').shift([0,0,0.1]) #---- critical point + + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.set_camera_orientation(phi=75*DEGREES,theta=10*DEGREES) + self.play(FadeOut(r2_text)) + self.add(axes) + self.begin_ambient_camera_rotation(rate=0.4) + self.add_fixed_in_frame_mobjects(f2_text) + self.play(Write(f2)) + self.add(b) + self.wait(1) + self.add(a) + self.wait(3) + self.add(d) + self.wait(2) + + +class MinimaScene(ThreeDScene): + def construct(self): r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + axes = ThreeDAxes() + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) #----graph of third function f(x,y) = x**2+y**2 @@ -42,25 +98,7 @@ class TypescpAnimation(ThreeDScene): self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - + self.add_fixed_in_frame_mobjects(r3_text) self.wait(1) self.play(FadeOut(r3_text)) -- cgit From 98a66de0884c14db8f4afc9d65cc484e632a46df Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:23:00 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 1216647 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif deleted file mode 100644 index 63f2b3a..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From 437f4c0deda7dd627110ee5b14c933f0ebacb819 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:23:23 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 2676014 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..6070720 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From 9845dd6804cc62e6c89914e08c1344a6f0783f43 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:25:05 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 2676014 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif deleted file mode 100644 index 6070720..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From 4baab618c5a301d0dde0e31777e104e0b172917e Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:26:26 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 2676014 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..6070720 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From e880078de20f4ed64d4884a1293cb45ce278878b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:27:47 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 2676014 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif deleted file mode 100644 index 6070720..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From 83972a0fd42f688221c271c4d19b73ead4b9ac62 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:28:29 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 2676014 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..6070720 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From c6da725924409e6a92cff4f51d6ce17ce256b078 Mon Sep 17 00:00:00 2001 From: Purusharth Saxena Date: Thu, 18 Jun 2020 19:58:03 +0530 Subject: Update README.md --- .../triple-and-surface-integrals/surface-integrals/README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'FSF-2020') 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 e69de29..df307cd 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 @@ -0,0 +1,2 @@ +**Test** +![Cube](cube.gif) -- cgit From dc011b107053e153125cbbec7b552b11fb8f6eac Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 11:39:52 +0530 Subject: Create README.md --- .../triple-and-surface-integrals/surface-integrals/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/README.md (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..21a651d --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/README.md @@ -0,0 +1,2 @@ +**Test** +![Cube](cube.gif) -- cgit From 67c15fdb095642f7c15350ea44dc21be41ec23e1 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 11:41:32 +0530 Subject: Update README.md --- .../triple-and-surface-integrals/surface-integrals/README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'FSF-2020') 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 21a651d..cd0229d 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,4 @@ **Test** ![Cube](cube.gif) +**file1_projection** +![file1_projection](projection.gif) -- cgit From b1bdec60ab1d23d2d122c2fe048885e6da91bc60 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 11:41:57 +0530 Subject: Update README.md --- .../triple-and-surface-integrals/surface-integrals/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') 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 cd0229d..0b0c49a 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,4 +1,4 @@ **Test** ![Cube](cube.gif) -**file1_projection** +**file1_projection.py** ![file1_projection](projection.gif) -- cgit From 78876d4144dbdab44c0465e7e7bdb9f45ea6b03c Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 11:44:19 +0530 Subject: Update README.md --- .../triple-and-surface-integrals/surface-integrals/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'FSF-2020') 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 0b0c49a..a4a1c84 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,4 +1,8 @@ -**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) -- cgit From cfda5496fd6cfdb9362e7fae7f1f6e33a5722ebe Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 11:53:19 +0530 Subject: Create README.md --- .../triple-and-surface-integrals/triple-integrals/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/README.md (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..0cebf40 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/README.md @@ -0,0 +1,4 @@ +**file1_3D_crossproduct.py** +![file1_3D_crossproduct](file1_3D_crossproduct.gif) +**file2_cylindrical_coordinates.py** +![file2_cylindrical_coordinates](file2_cylindrical_coordinates.gif) -- cgit From 54fe05a46a6bb3804bcffbcc33736495f0bf6777 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 11:57:51 +0530 Subject: Add files via upload --- .../triple-integrals/file2_spherical_coordinates.gif | Bin 0 -> 7158240 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_spherical_coordinates.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..6dc8b17 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_spherical_coordinates.gif differ -- cgit From d428459e270e679332c959d145887633c4995933 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 11:59:05 +0530 Subject: Add files via upload --- .../file2_cylindrical_coordinates.gif | Bin 7158240 -> 6912988 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'FSF-2020') 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 index 6dc8b17..e913750 100644 Binary files a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.gif differ -- cgit From de57f920feba53b088da52ed61999ea25fd74206 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 12:01:50 +0530 Subject: Update README.md --- .../triple-and-surface-integrals/triple-integrals/README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'FSF-2020') 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 0cebf40..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 @@ -2,3 +2,5 @@ ![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) -- cgit From a896e8b74b1b4864f24d860ea82e4de46d2ff2c7 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Fri, 19 Jun 2020 12:05:35 +0530 Subject: Create README.md --- .../triple-and-surface-integrals/flux/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/flux/README.md (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..0af7aa1 --- /dev/null +++ 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) -- cgit From c8177571dd518e95dfbaab70ab06f2584a42b9ce Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Fri, 19 Jun 2020 15:33:32 +0530 Subject: post-review updates --- .../geometry-of-planes-and-curves/README.md | 9 ++ .../file1_simple_visualization.py | 51 ++++++++++++ .../file2_circle_curvature.py | 27 ++++++ .../file3_curvature_intuition.gif | Bin 0 -> 271189 bytes .../__pycache__/file1_line_eqn.cpython-38.pyc | Bin 0 -> 1541 bytes .../file4_point_normal_form_plane.cpython-38.pyc | Bin 0 -> 2225 bytes .../file1_line_eqn.py | 26 ++++++ .../file2_point_normal_form_plane.py | 39 +++++++++ .../file3_intercept_form_plane.gif | Bin 0 -> 2884416 bytes .../file3_intercept_form_plane.py | 29 +++++++ .../file4_3d_plane.gif | Bin 0 -> 2037923 bytes .../file4_3d_plane.py | 49 +++++++++++ .../file5_vector_form_line.py | 47 +++++++++++ .../file1_parametric_circle.cpython-38.pyc | Bin 0 -> 3089 bytes .../file4_helix_visualization.cpython-38.pyc | Bin 0 -> 1506 bytes .../file1_parametric_circle.py | 78 ++++++++++++++++++ .../general-parametric-curves/file2_cycloid.gif | Bin 0 -> 13674 bytes .../file2_cycloid_manim.gif | Bin 0 -> 1313411 bytes .../file2_cycloid_manim.py | 46 +++++++++++ .../file3_brachistochrone.gif | Bin 0 -> 122838 bytes .../file3_brachistochrone.py | 13 +++ .../file4_helix_visualization.py | 31 +++++++ .../file1_parametric_ellipse.cpython-38.pyc | Bin 0 -> 3102 bytes .../file2_parametric_helix.cpython-38.pyc | Bin 0 -> 3575 bytes .../file3_circletosphere.cpython-38.pyc | Bin 0 -> 1843 bytes .../__pycache__/file3_cone.cpython-38.pyc | Bin 0 -> 1499 bytes .../space-curves/file1_parametric_ellipse.py | 78 ++++++++++++++++++ .../space-curves/file2_parametric_helix.py | 91 +++++++++++++++++++++ .../space-curves/file3_circletosphere.py | 45 ++++++++++ .../space-curves/file4_cone.py | 33 ++++++++ .../file1_prescribed_plane.gif | Bin 0 -> 163202 bytes .../file2_TNB_frame.gif | Bin 0 -> 150050 bytes .../file2_tangent_spaceCurve.cpython-38.pyc | Bin 0 -> 1429 bytes .../file1_smooth_curves.gif | Bin 0 -> 1541515 bytes .../file2_tangent_space_curve.py | 22 +++++ 35 files changed, 714 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file3_curvature_intuition.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file1_line_eqn.cpython-38.pyc create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file4_point_normal_form_plane.cpython-38.pyc create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file1_parametric_circle.cpython-38.pyc create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file4_helix_visualization.cpython-38.pyc create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file1_parametric_ellipse.cpython-38.pyc create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file2_parametric_helix.cpython-38.pyc create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_circletosphere.cpython-38.pyc create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_cone.cpython-38.pyc create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file1_prescribed_plane.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/__pycache__/file2_tangent_spaceCurve.cpython-38.pyc create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file1_smooth_curves.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/README.md index e69de29..c3db80a 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/README.md @@ -0,0 +1,9 @@ +This repository contains the codes written by [Saarth Deshpande](https://github.com/saarthdeshpande) during the course of FOSSEE Summer Fellowship 2020 under the Floss: Mathematics using Python. + +__Sub-topics covered__: +* Equations of Planes and Lines +* General Parametric Curves +* Space Curves (an Intro to Coordinates in 3D) +* Velocity and Differentiability +* Finding Arc Length and Curvature +* TNB Frame and Serret-Frenet Formulae diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.py new file mode 100644 index 0000000..0ae283a --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.py @@ -0,0 +1,51 @@ +from manimlib.imports import * + +class randomcurve(GraphScene): + CONFIG = { + "x_min": -4, + "x_max": 6, + "y_min": -6, + "y_max": 10, + "graph_origin": ORIGIN + } + def construct(self): + intro = TextMobject('Consider the following curve.') + mid = TextMobject(r'Notice how the direction of the unit tangent vectors\\changes with respect to the arc length.') + outro = TextMobject(r'This is called curvature.\\Mathematically, curvature $ = k = \left|{\frac{dT}{ds}}\right|$') + + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + self.setup_axes(hideaxes=True) + graphobj = self.get_graph(self.curve) + self.play(FadeIn(intro)) + self.wait(2) + self.play(FadeOut(intro)) + self.setup_axes(hideaxes=False) + self.play(ShowCreation(graphobj)) + self.wait(1) + self.play(FadeOut(self.axes), FadeOut(graphobj),FadeIn(mid)) + self.wait(2) + self.play(FadeOut(mid)) + self.play(FadeIn(self.axes), FadeIn(graphobj)) + + tgt1 = Arrow((-2.2*XTD,-0.5*YTD,0),(-1*XTD,1,0)) + tgt2 = Arrow((-1.2*XTD, 1.93*YTD,0),(0*XTD,1.6,0)).scale(1.2) + tgt3 = Arrow((-0.3*XTD,3*YTD, 0), (1.5*XTD, 3*YTD,0)) + tgt4 = Arrow((1.4*XTD, 2*YTD,0),(2.4*XTD, 1*YTD,0)).scale(2.8) + + tangents = [tgt1, tgt2, tgt3, tgt4] + for tangent in tangents: + self.play(ShowCreation(tangent)) + self.wait(1) + tangents = VGroup(*tangents) + self.play(FadeOut(self.axes), FadeOut(graphobj), FadeOut(tangents)) + self.wait(1) + self.play(FadeIn(outro)) + self.wait(2) + self.play(FadeOut(outro)) + self.wait(1) + + + def curve(self, x): + return 3 - (3653*x**2)/5292 + (2477*x**3)/31752 + (13*x**4)/784 - (17*x**5)/5292 + (17*x**6)/63504 \ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.py new file mode 100644 index 0000000..232ac41 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.py @@ -0,0 +1,27 @@ +from manimlib.imports import * + +class circleC(GraphScene): + CONFIG = { + "x_min": -6, + "x_max": 6, + "y_min": -6, + "y_max": 6, + "graph_origin": ORIGIN, + "x_axis_width": 12, + "y_axis_height": 12 + } + def construct(self): + epiphany = TextMobject(r'Driving a vehicle on which of \\ the two paths would be easier?').scale(0.6).shift(3.5*LEFT + 3*UP) + outro = TextMobject(r'The larger path, due to its \\ smaller curvature, since $k = \frac{1}{R}$.').scale(0.6).shift(3.7*LEFT + 3*UP) + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + + circle = Circle(radius = 2, color = BLUE) + circle2 = Circle(radius = 3, color = GREEN_E) + + self.setup_axes(hideaxes=True) + self.play(FadeIn(self.axes), Write(circle, run_time = 2), FadeIn(epiphany)) + self.play(Write(circle2, run_time = 3)) + self.play(ReplacementTransform(epiphany, outro)) + self.wait(2) + self.play(FadeOut(VGroup(*[self.axes, circle, circle2, epiphany, outro]))) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file3_curvature_intuition.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file3_curvature_intuition.gif new file mode 100644 index 0000000..0d6fdcf Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file3_curvature_intuition.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file1_line_eqn.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file1_line_eqn.cpython-38.pyc new file mode 100644 index 0000000..e129d1d Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file1_line_eqn.cpython-38.pyc differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file4_point_normal_form_plane.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file4_point_normal_form_plane.cpython-38.pyc new file mode 100644 index 0000000..88377bb Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file4_point_normal_form_plane.cpython-38.pyc differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.py new file mode 100644 index 0000000..402775b --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.py @@ -0,0 +1,26 @@ +from manimlib.imports import * + +class three(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + self.set_camera_orientation(phi=14.25* DEGREES,theta=0*DEGREES,distance=8) + self.play(FadeIn(axes)) + + plane = ParametricSurface( + lambda u,v: np.array([ + 6, + 8*v, + 3*u + ]), u_min = -0.8, u_max = 0.8, fill_opacity = 0.4).rotate(45*DEGREES).move_to(ORIGIN).shift(RIGHT+UP) + d2text = TextMobject(r'$\mathbb{R}^{2}: y = mx + c$').shift(3*LEFT + 2*UP).rotate(np.pi/2) + d3text = TextMobject(r'$\mathbb{R}^{3}: y = mx + c$').shift(4*RIGHT+3*UP) + self.play(FadeIn(plane), FadeIn(d2text)) + self.wait(3) + self.play(FadeOut(d2text)) + self.move_camera(phi = 60*DEGREES, theta=45*DEGREES,run_time=3) + self.begin_ambient_camera_rotation(rate=0.02) + self.add_fixed_in_frame_mobjects(d3text) + self.play(FadeIn(d3text)) + self.wait(3) + self.play(FadeOut(d3text), FadeOut(plane), FadeOut(axes)) + self.wait() diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.py new file mode 100644 index 0000000..122a9ff --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.py @@ -0,0 +1,39 @@ +from manimlib.imports import * + +class pointnormal(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + self.set_camera_orientation(phi = 75*DEGREES, theta=45*DEGREES) + normal = Arrow((0,-0.15,-0.25), (-3,0,3), color = YELLOW) + plane1 = Polygon(np.array([1,0,2]),np.array([-1,2.5,1]),np.array([-3,2,1]),np.array([-1,-1,2]), color = GREEN_E, fill_color = WHITE, fill_opacity=0.5) + plane2 = Polygon(np.array([1,0,2]),np.array([-1,2.5,1]),np.array([-3,2,1]),np.array([-1,-1,2]), color = BLUE, fill_color = WHITE, fill_opacity=0.3) + normalLabel = TextMobject(r'$\overrightarrow{n}$').shift((2,2.5,0)) + pointLabel = TextMobject(r'$P$').shift((2,1.2,0)) + xlabel = TextMobject(r'$x$').shift(4.5*LEFT + 1.7*DOWN) + ylabel = TextMobject(r'$y$').shift(4.5*RIGHT + 1.8*DOWN) + zlabel = TextMobject(r'$z$').shift(3.3*UP+0.5*RIGHT) + + normaltext = TextMobject(r'Consider an arbitrary \\ normal vector $\overrightarrow{n}$').scale(0.6).shift(2*UP + 2.5*LEFT) + planetext = TextMobject(r'A single vector is normal \\ to infinitely many planes.').scale(0.6).shift(2*UP + 2.5*LEFT) + pointtext = TextMobject(r'Given a fixed point $P$, \\ a plane is obtained as:').scale(0.6).shift(2*UP + 2.5*LEFT) + + point = Dot(color = RED).shift((1.6,1.3,0)) + self.play(FadeIn(axes)) + self.add_fixed_in_frame_mobjects(xlabel, ylabel, zlabel) + self.wait(1) + self.play(FadeIn(normal)) + self.add_fixed_in_frame_mobjects(normalLabel, normaltext) + self.play(FadeIn(normaltext)) + self.wait(2) + self.add_fixed_in_frame_mobjects(planetext) + self.play(ReplacementTransform(normaltext, planetext), run_time=0.01) + self.play(MoveAlongPath(plane1, normal), run_time = 6) + self.add_fixed_in_frame_mobjects(pointtext) + self.play(ReplacementTransform(planetext, pointtext)) + self.add_fixed_in_frame_mobjects(point, pointLabel) + self.wait(1) + self.play(Transform(plane1, plane2)) + self.wait(2) + self.play(FadeOut(axes), FadeOut(plane2), FadeOut(plane1), FadeOut(point), FadeOut(pointLabel), FadeOut(normal), FadeOut(normalLabel), FadeOut(planetext), FadeOut(pointtext), FadeOut(normaltext), FadeOut(VGroup(*[xlabel, ylabel, zlabel]))) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.gif new file mode 100644 index 0000000..a8b7d75 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.py new file mode 100644 index 0000000..258ac3c --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.py @@ -0,0 +1,29 @@ +from manimlib.imports import * + +class pointnormal(ThreeDScene): + def construct(self): + axes = ThreeDAxes(x_min = 0, y_min = 0, z_min = 0) + self.set_camera_orientation(phi = 75*DEGREES, theta=45*DEGREES) + + plane1 = Polygon(np.array([2,-3,2.5]),np.array([-1.45,2,2.5]),np.array([-0.5,4.5,-0.1]),np.array([3.5,-1,-0.2]), fill_color = WHITE, fill_opacity=0.3) + + xlabel = TextMobject(r'$x$').shift(5*LEFT + 1.5*DOWN) + ylabel = TextMobject(r'$y$').shift(5*RIGHT + 1.5*DOWN) + zlabel = TextMobject(r'$z$').shift(3.3*UP + 0.5*LEFT) + + zintercept = Dot().shift(2.5*UP) + zinterceptlabel = TextMobject(r'$(0,0,c\prime)$').shift(2.8*UP + RIGHT).scale(0.7) + + yintercept = Dot().shift(3.7*RIGHT + 0.925*DOWN) + yinterceptlabel = TextMobject(r'$(0,b\prime ,0)$').shift(3.7*RIGHT+1.5*DOWN).scale(0.7) + + xintercept = Dot().shift(2.9*LEFT + 0.75*DOWN) + xinterceptlabel = TextMobject(r'$(a\prime ,0,0)$').shift(3*LEFT+1.3*DOWN).scale(0.7) + + self.play(FadeIn(axes), FadeIn(plane1)) + self.add_fixed_in_frame_mobjects(xlabel, ylabel, zlabel, zintercept, zinterceptlabel, yintercept, yinterceptlabel, xintercept, xinterceptlabel) + self.wait(2) + self.remove(zintercept, zinterceptlabel, yintercept, yinterceptlabel, xintercept, xinterceptlabel, xlabel, ylabel, zlabel) + self.begin_ambient_camera_rotation(rate=0.5) + self.wait(5) + self.play(FadeOut(axes), FadeOut(plane1)) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.gif new file mode 100644 index 0000000..b4c259e Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.py new file mode 100644 index 0000000..26ad825 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.py @@ -0,0 +1,49 @@ +from manimlib.imports import * + +class pointnormal(ThreeDScene): + CONFIG = { + 'x_axis_label': '$x$', + 'y_axis_label': '$y$' + } + def construct(self): + axes = ThreeDAxes() + axes.add(axes.get_axis_labels()) + self.set_camera_orientation(phi = 75*DEGREES, theta=45*DEGREES) + + plane = Polygon( + np.array([2,0,2.7]), + np.array([0,0,0.4]), + np.array([-3.2,0,0.55]), + np.array([-3,-2,2.5]), + fill_color = WHITE, fill_opacity = 0.25) + + normal = Arrow((0.25,2,0), (1.5,3.5,0)) + normalLabel = TextMobject(r'$\overrightarrow{n}$').shift((1.5,2.8,0)) + + point = Dot(color = RED).shift((1.6,1.3,0)) + pointLabel = TextMobject(r'$P_{0}$').shift((2,1.2,0)) + + point2 = Dot(color = RED).shift((-0.2,1.8,0)) + point2Label = TextMobject(r'$P$').shift((-0.3,2,0)) + + arrow1 = Arrow((0,-0.25,-0.2), (-2.55,0,1), color = YELLOW).set_stroke(width=3) + arrow2 = Arrow((0,0,-0.25), (0.3,0,2), color = YELLOW).set_stroke(width=3) + res = Arrow((1.8,1.23,0),(-0.35,1.85,0), color = BLUE).set_stroke(width=3) + + arrow1label = TextMobject(r'$\overrightarrow{r_{0}}$').next_to(arrow2, UP).shift(RIGHT + 0.16*DOWN).scale(0.7) + arrow2label = TextMobject(r'$\overrightarrow{r}$').next_to(arrow2, UP).shift(0.7*LEFT).scale(0.7) + reslabel = TextMobject(r'$\overrightarrow{r} - \overrightarrow{r_{0}}$').next_to(arrow2, UP).shift(0.7*RIGHT + 1.2*UP).scale(0.7) + + self.play(FadeIn(axes), FadeIn(plane)) + self.wait(1) + self.add_fixed_in_frame_mobjects(normal, normalLabel) + self.wait(1) + self.add_fixed_in_frame_mobjects(point, pointLabel) + self.add_fixed_in_frame_mobjects(point2, point2Label) + self.play(Write(arrow1), Write(arrow2)) + self.add_fixed_in_frame_mobjects(arrow2label, arrow1label) + self.wait(1) + self.add_fixed_in_frame_mobjects(res, reslabel) + self.play(Write(res), FadeIn(reslabel)) + self.wait(1) + self.play(FadeOut(axes), FadeOut(plane), FadeOut(point), FadeOut(pointLabel), FadeOut(normal), FadeOut(normalLabel), FadeOut(point2), FadeOut(point2Label), FadeOut(arrow1label), FadeOut(arrow2label), FadeOut(reslabel), FadeOut(arrow1), FadeOut(arrow2), FadeOut(res)) \ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.py new file mode 100644 index 0000000..e25c4eb --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.py @@ -0,0 +1,47 @@ +from manimlib.imports import * + +class line_(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + xlabel = TextMobject(r'$x$').shift(4.5*LEFT + 1.7*DOWN) + ylabel = TextMobject(r'$y$').shift(4.5*RIGHT + 1.8*DOWN) + zlabel = TextMobject(r'$z$').shift(3.3*UP+0.5*RIGHT) + + self.set_camera_orientation(phi = 75*DEGREES, theta=45*DEGREES) + pointLabel = TextMobject(r'$P$').shift((2.28,2.12,0)).scale(0.7) + point = Dot(color = RED).shift((1.95,1.9,0)) + + vlabel = TextMobject(r'$\overrightarrow{v}$').shift((0.5,1.3,0)).scale(0.7) + + inf_text = TextMobject(r'Infinitely many lines pass \\ through a single point.').scale(0.6).shift(2*UP + 2.5*LEFT) + pointtext = TextMobject(r'Given a direction vector $\overrightarrow{v}$, \\ a line is obtained as:').scale(0.6).shift(2*UP + 2.5*LEFT) + + + line = Line((0.7,0.7,0), (2,3,0)).shift(0.06*UP+0.6*RIGHT) + v = Vector((0.8,1,0), color = GREEN_E) + #finalLine = Line((-1.56,0,0.5),(-4,0,2.42), color = YELLOW) + finalLine = Line((1,0.8,0),(3,3,0), color = YELLOW).shift(0.05*LEFT) + self.play(FadeIn(axes)) + self.add_fixed_in_frame_mobjects(zlabel, ylabel, xlabel) + self.wait(1) + self.add_fixed_in_frame_mobjects(point, pointLabel) + self.wait(1) + self.add_fixed_in_frame_mobjects(inf_text) + self.wait(1) + self.add_fixed_in_frame_mobjects(line) + + for i in range(9): + self.play(ApplyMethod(line.rotate, -np.pi/12), run_time = 0.7) + if i == 8: + self.add_fixed_in_frame_mobjects(pointtext) + self.play(ReplacementTransform(inf_text, pointtext)) + self.add_fixed_in_frame_mobjects(v, vlabel) + # if i == 13: + # self.add_fixed_in_frame_mobjects(pointtext) + + self.add_fixed_in_frame_mobjects(finalLine) + self.play(FadeIn(finalLine)) + self.play(Transform(line, finalLine), run_time = 4) + #self.play(FadeOut(line), FadeIn(finalLine)) + self.wait(1.5) + self.play(FadeOut(VGroup(*[axes, xlabel, ylabel, zlabel, finalLine, v, vlabel, point, pointLabel, pointtext, line]))) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file1_parametric_circle.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file1_parametric_circle.cpython-38.pyc new file mode 100644 index 0000000..ad30b2a Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file1_parametric_circle.cpython-38.pyc differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file4_helix_visualization.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file4_helix_visualization.cpython-38.pyc new file mode 100644 index 0000000..144d78d Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file4_helix_visualization.cpython-38.pyc differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.py new file mode 100644 index 0000000..40b5150 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.py @@ -0,0 +1,78 @@ +from manimlib.imports import * + +class parametricCircle(ThreeDScene, GraphScene): + def construct(self): + self.x_min = -5 + self.y_min = -5 + self.graph_origin = ORIGIN + self.x_max = 5 + self.y_max = 5 + self.x_axis_label = "" + self.y_axis_label = "" + self.x_axis_width = 10 + self.y_axis_height = 10 + + axes = [] + + self.setup_axes() + self.axes.scale(0.5).shift(3*LEFT) + axes.append(self.axes) + self.setup_axes() + self.axes.scale(0.3).shift(3*RIGHT + 2*UP) + axes.append(self.axes) + self.setup_axes() + self.axes.scale(0.3).shift(3*RIGHT + 2*DOWN) + axes.append(self.axes) + + axes = VGroup(*axes) + t_value = ValueTracker(-3.14) + t_tex = DecimalNumber(t_value.get_value()).add_updater(lambda v: v.set_value(t_value.get_value())) + t_label = TexMobject("t = ") + group = VGroup(t_tex,t_label).shift(3*DOWN) + t_label.next_to(t_tex,LEFT, buff=0.2,aligned_edge=t_label.get_bottom()) + + asint_text = TextMobject(r'$x = a\sin{t}$').scale(0.7).shift(4*RIGHT + 3*UP) + xlabel1 = TextMobject(r'$x$').shift(3.3*RIGHT + 3.7*UP).scale(0.7) + tlabel1 = TextMobject(r'$t$').shift(4.8*RIGHT + 2*UP).scale(0.7) + up_text = VGroup(*[asint_text, xlabel1, tlabel1]) + asint = ParametricFunction( + lambda t: np.array([ + t, + np.sin(t), + 0 + ]), t_min = -np.pi, t_max = np.pi, color = GREEN_E + ).shift(3*RIGHT + 2*UP).scale(0.4) + + acost_text = TextMobject(r'$y = a\cos{t}$').scale(0.7).shift(4*RIGHT + DOWN) + ylabel1 = TextMobject(r'$y$').shift(3.3*RIGHT+0.3*DOWN).scale(0.7) + tlabel2 = TextMobject(r'$t$').shift(4.8*RIGHT + 2*DOWN).scale(0.7) + down_text = VGroup(*[acost_text, ylabel1, tlabel2]) + acost = ParametricFunction( + lambda t: np.array([ + t, + np.cos(t), + 0 + ]), t_min = -np.pi, t_max = np.pi, color = BLUE + ).shift(3*RIGHT + 2*DOWN).scale(0.4) + + up_dot = Dot(color = RED) + down_dot = Dot(color = RED) + circle_dot = Dot(color = RED) + + ylabel2 = TextMobject(r'$y$').scale(0.7).shift(3*UP + 3*LEFT) + xlabel2 = TextMobject(r'$x$').scale(0.7) + ellipse_text = TextMobject(r'$x = a\sin{t}$ \\ $y = a\cos{t}$').scale(0.7).shift(2*UP + 1.3*LEFT) + main_text = VGroup(*[xlabel2, ylabel2, ellipse_text]) + circle = ParametricFunction( + lambda t: np.array([ + np.cos(t), + np.sin(t), + 0 + ]), t_min = -np.pi, t_max = np.pi, color = WHITE + ).shift(3*LEFT) + self.play(FadeIn(axes), FadeIn(asint), FadeIn(acost), FadeIn(circle), FadeIn(up_text), FadeIn(down_text), FadeIn(main_text), FadeIn(group)) + self.wait(1) + self.play(MoveAlongPath(up_dot, asint, run_time = 7), MoveAlongPath(down_dot, acost, run_time = 7), MoveAlongPath(circle_dot, circle, run_time = 7), t_value.set_value,3.14, rate_func=linear, run_time=7) + self.wait(1) + self.play(FadeOut(VGroup(*[axes, asint, acost, circle, up_text, down_text, main_text, up_dot, down_dot, circle_dot, group]))) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid.gif new file mode 100644 index 0000000..39656de Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.gif new file mode 100644 index 0000000..e68b841 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.py new file mode 100644 index 0000000..7b6c0d1 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.py @@ -0,0 +1,46 @@ +from manimlib.imports import * + +t_offset = 0 +c_t = 0 + +class cycloid(Scene): + def construct(self): + + cycl = ParametricFunction( + lambda t: np.array([ + t - np.sin(t), + 1 - np.cos(t), + 0 + ]), t_min = -2.75*np.pi, t_max = 3*np.pi, color = BLUE + ).shift(0.73*RIGHT) + wheel_radius = 1 + wheel_function_path = lambda x : 0 + wheel_radius + + line = FunctionGraph(lambda x : 0, color = BLACK) + wheel_path = FunctionGraph(wheel_function_path) + + velocity_factor = 0.25 + frame_rate = self.camera.frame_rate + self.dt = 1 / frame_rate + + wheel = Circle(color = BLACK, radius = 1) + dot = Dot(radius = 0.16, color = RED) + #dot.move_to(wheel.get_arc_center() + np.array([0,2,0])) + + def update_dot(mob,dt): + global t_offset,c_t + if dt == 0 and c_t == 0: + rate= - velocity_factor * self.dt + c_t += 1 + else: + rate = - dt*velocity_factor + if dt > 0: + c_t = 0 + mob.move_to(wheel.point_from_proportion(((t_offset + rate))%1)) + t_offset += rate + #self.add(mob.copy()) + + #dot.move_to(wheel.get_arc_center() + np.array([0,2,0])) + dot.add_updater(update_dot) + self.add(wheel,dot, line, cycl) + self.play(MoveAlongPath(wheel, wheel_path, run_time = 9, rate_func = linear)) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.gif new file mode 100644 index 0000000..8daf4c0 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.py new file mode 100644 index 0000000..633e500 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.py @@ -0,0 +1,13 @@ +from manimlib.imports import * + +class brachistochrone(Scene): + def construct(self): + curve = ParametricFunction( + lambda t: np.array([ + 0.5*(t - np.sin(t)), + 0.5*(1 - np.cos(t)), + 0 + ]), t_max = np.pi + ).scale(5).rotate(540*DEGREES) + dot = Dot(color = RED, radius = 0.2) + self.play(FadeIn(curve), MoveAlongPath(dot, curve, run_time = 2)) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.py new file mode 100644 index 0000000..eddd3fe --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.py @@ -0,0 +1,31 @@ +from manimlib.imports import * + +class helix_(ThreeDScene): + CONFIG = { + "x_min": -6, + "x_max": 6, + "y_min": -6, + "y_max": 6, + "graph_origin": ORIGIN + } + def construct(self): + axes = ThreeDAxes() + helix = ParametricFunction( + lambda t: np.array([ + 1.5*np.cos(TAU*t), + 1.5*np.sin(TAU*t), + 2*t + ]), t_min = -1, t_max = 2, color = RED + ) + cylinder = ParametricSurface( + lambda u, v: np.array([ + 1.5*np.cos(TAU*v), + 1.5*np.sin(TAU*v), + 2*u + ]), u_min = -1, u_max = 2, fill_opacity = -.4, fill_color = WHITE, color = WHITE + ) + self.set_camera_orientation(phi=60* DEGREES,theta=45*DEGREES) + self.play(FadeIn(axes), FadeIn(cylinder), ShowCreation(helix, run_time = 4)) + self.begin_ambient_camera_rotation(rate=0.5) + self.wait(5) + self.play(FadeOut(axes),FadeOut(helix), FadeOut(cylinder)) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file1_parametric_ellipse.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file1_parametric_ellipse.cpython-38.pyc new file mode 100644 index 0000000..a732643 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file1_parametric_ellipse.cpython-38.pyc differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file2_parametric_helix.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file2_parametric_helix.cpython-38.pyc new file mode 100644 index 0000000..c8e3e2a Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file2_parametric_helix.cpython-38.pyc differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_circletosphere.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_circletosphere.cpython-38.pyc new file mode 100644 index 0000000..bca0d91 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_circletosphere.cpython-38.pyc differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_cone.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_cone.cpython-38.pyc new file mode 100644 index 0000000..ae954c3 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_cone.cpython-38.pyc differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.py new file mode 100644 index 0000000..1ce29d7 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.py @@ -0,0 +1,78 @@ +from manimlib.imports import * + +class parametricEllipse(ThreeDScene, GraphScene): + def construct(self): + self.x_min = -5 + self.y_min = -5 + self.graph_origin = ORIGIN + self.x_max = 5 + self.y_max = 5 + self.x_axis_label = "" + self.y_axis_label = "" + self.x_axis_width = 10 + self.y_axis_height = 10 + + axes = [] + + self.setup_axes() + self.axes.scale(0.5).shift(3*LEFT) + axes.append(self.axes) + self.setup_axes() + self.axes.scale(0.3).shift(3*RIGHT + 2*UP) + axes.append(self.axes) + self.setup_axes() + self.axes.scale(0.3).shift(3*RIGHT + 2*DOWN) + axes.append(self.axes) + + axes = VGroup(*axes) + t_value = ValueTracker(-3.14) + t_tex = DecimalNumber(t_value.get_value()).add_updater(lambda v: v.set_value(t_value.get_value())) + t_label = TexMobject("t = ") + group = VGroup(t_tex,t_label).shift(3*DOWN) + t_label.next_to(t_tex,LEFT, buff=0.2,aligned_edge=t_label.get_bottom()) + + asint_text = TextMobject(r'$x = a\sin{t}$').scale(0.7).shift(4*RIGHT + 3*UP) + xlabel1 = TextMobject(r'$x$').shift(3.3*RIGHT + 3.7*UP).scale(0.7) + tlabel1 = TextMobject(r'$t$').shift(4.8*RIGHT + 2*UP).scale(0.7) + up_text = VGroup(*[asint_text, xlabel1, tlabel1]) + asint = ParametricFunction( + lambda t: np.array([ + t, + np.sin(t), + 0 + ]), t_min = -np.pi, t_max = np.pi, color = GREEN_E + ).shift(3*RIGHT + 2*UP).scale(0.4) + + bcost_text = TextMobject(r'$y = b\cos{t}$').scale(0.7).shift(4*RIGHT + DOWN) + ylabel1 = TextMobject(r'$y$').shift(3.3*RIGHT+0.3*DOWN).scale(0.7) + tlabel2 = TextMobject(r'$t$').shift(4.8*RIGHT + 2*DOWN).scale(0.7) + down_text = VGroup(*[bcost_text, ylabel1, tlabel2]) + bcost = ParametricFunction( + lambda t: np.array([ + t, + 1.5*np.cos(t), + 0 + ]), t_min = -np.pi, t_max = np.pi, color = BLUE + ).shift(3*RIGHT + 2*DOWN).scale(0.4) + + up_dot = Dot(color = RED) + down_dot = Dot(color = RED) + ellipse_dot = Dot(color = RED) + + ylabel2 = TextMobject(r'$y$').scale(0.7).shift(3*UP + 3*LEFT) + xlabel2 = TextMobject(r'$x$').scale(0.7) + ellipse_text = TextMobject(r'$x = a\sin{t}$ \\ $y = b\cos{t}$').scale(0.7).shift(2*UP + 1.3*LEFT) + main_text = VGroup(*[xlabel2, ylabel2, ellipse_text]) + ellipse = ParametricFunction( + lambda t: np.array([ + 1.5*np.cos(t), + np.sin(t), + 0 + ]), t_min = -np.pi, t_max = np.pi, color = WHITE + ).shift(3*LEFT) + self.play(FadeIn(axes), FadeIn(asint), FadeIn(bcost), FadeIn(ellipse), FadeIn(up_text), FadeIn(down_text), FadeIn(main_text), FadeIn(group)) + self.wait(1) + self.play(MoveAlongPath(up_dot, asint, run_time = 7), MoveAlongPath(down_dot, bcost, run_time = 7), MoveAlongPath(ellipse_dot, ellipse, run_time = 7), t_value.set_value,3.14, rate_func=linear, run_time=7) + self.wait(1) + self.play(FadeOut(VGroup(*[axes, asint, bcost, ellipse, up_text, down_text, main_text, up_dot, down_dot, ellipse_dot, group]))) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.py new file mode 100644 index 0000000..3791752 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.py @@ -0,0 +1,91 @@ +from manimlib.imports import * + +class parametricHelix(ThreeDScene, GraphScene): + def construct(self): + self.x_min = -5 + self.y_min = -4 + self.graph_origin = ORIGIN + self.x_max = 5 + self.y_max = 4 + self.x_axis_label = "" + self.y_axis_label = "" + self.x_axis_width = 10 + self.y_axis_height = 7.5 + ax1 = ThreeDAxes().scale(0.65).shift(2.6*RIGHT+DOWN+np.array([0,0,0.5])) + axes_group = [] + + self.setup_axes() + self.axes.shift(3*RIGHT + 2*UP).scale(0.3) + axes_group.append(self.axes) + + self.setup_axes() + self.axes.shift(3*RIGHT + 2*DOWN).scale(0.3) + axes_group.append(self.axes) + + axes_group = VGroup(*axes_group) + + asint_text = TextMobject(r'$x = a\sin{t}$').scale(0.7).shift(4*RIGHT + 3*UP) + xlabel1 = TextMobject(r'$x$').shift(3.3*RIGHT + 3.7*UP).scale(0.7) + tlabel1 = TextMobject(r'$t$').shift(5*RIGHT + 2*UP).scale(0.7) + up_text = VGroup(*[asint_text, xlabel1, tlabel1]) + asint = ParametricFunction( + lambda t: np.array([ + t, + np.sin(t), + 0 + ]), t_min = -4*np.pi, t_max = 4*np.pi, color = GREEN_E + ).shift(3*RIGHT + 2*UP).scale(0.12) + + acost_text = TextMobject(r'$y = a\cos{t}$').scale(0.7).shift(4*RIGHT + DOWN) + ylabel1 = TextMobject(r'$y$').shift(3.3*RIGHT+0.3*DOWN).scale(0.7) + tlabel2 = TextMobject(r'$t$').shift(5*RIGHT + 2*DOWN).scale(0.7) + down_text = VGroup(*[acost_text, ylabel1, tlabel2]) + acost = ParametricFunction( + lambda t: np.array([ + t, + np.cos(t), + 0 + ]), t_min = -4*np.pi, t_max = 4*np.pi, color = BLUE + ).shift(3*RIGHT + 2*DOWN).scale(0.12) + + up_dot = Dot(color = RED).scale(0.6) + down_dot = Dot(color = RED).scale(0.6) + helix_dot = Dot(radius = 0.16, color = RED) + + zlabel = TextMobject(r'$z$').scale(0.7).shift(3*UP + 2.8*LEFT) + ylabel2 = TextMobject(r'$y$').scale(0.7).shift(0.3*DOWN+0.15*RIGHT) + xlabel2 = TextMobject(r'$x$').scale(0.7).shift(0.5*DOWN + 6.4*LEFT) + helix_text = TextMobject(r'$x = a\sin{t}$ \\ $y = a\cos{t}$ \\ $z = ct$').scale(0.7).shift(2.3*UP + 1.3*LEFT) + main_text = VGroup(*[xlabel2, ylabel2, zlabel, helix_text]) + helix = ParametricFunction( + lambda t: np.array([ + np.cos(TAU*t), + np.sin(TAU*t), + 0.4*t + ]), t_min = -2*np.pi/3, t_max = 1.8*np.pi/3, color = WHITE + ).shift(ax1.get_center()) + + self.set_camera_orientation(phi = 75*DEGREES, theta=45*DEGREES) + + t_tracker = ValueTracker(-12.56) + t=t_tracker.get_value + + t_label = TexMobject( + "t = ",color=WHITE + ).next_to(helix_text,DOWN, buff=0.2).scale(0.6) + + t_text = always_redraw( + lambda: DecimalNumber( + t(), + color=WHITE, + ).next_to(t_label, RIGHT, buff=0.2) + ).scale(0.6) + + group = VGroup(t_text,t_label).scale(1.5).move_to(ORIGIN).shift(2*DOWN) + self.add_fixed_in_frame_mobjects(axes_group, main_text, up_text, down_text, acost, asint) + self.play(FadeIn(ax1), FadeIn(axes_group), FadeIn(asint), FadeIn(acost), FadeIn(helix), FadeIn(up_text), FadeIn(down_text), FadeIn(main_text)) + #self.begin_ambient_camera_rotation(rate = 0.06) + self.add_fixed_in_frame_mobjects(up_dot, down_dot, group) + self.play(MoveAlongPath(up_dot, asint, run_time = 8), MoveAlongPath(down_dot, acost, run_time = 8), MoveAlongPath(helix_dot, helix, run_time = 8), t_tracker.set_value,12.56, rate_func=linear, run_time=8) + self.play(FadeOut(VGroup(*[ax1, axes_group, asint, acost, helix, up_text, down_text, main_text, up_dot, down_dot, helix_dot, group]))) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.py new file mode 100644 index 0000000..6c0e810 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.py @@ -0,0 +1,45 @@ +from manimlib.imports import * + +class sphere(GraphScene, ThreeDScene): + CONFIG = { + 'x_min': -10, + 'x_max': 10, + 'y_min': -10, + 'y_max': 10, + 'graph_origin': ORIGIN, + "x_axis_width": 10, + "y_axis_height": 10, + } + def construct(self): + XTD = self.x_axis_width/(self.x_max- self.x_min) + YTD = self.y_axis_height/(self.y_max- self.y_min) + circleeqn = TextMobject(r'Hence, $x^{2} + y^{2} = 2(r^{2} - u^{2})$') + plottext = TextMobject(r'$x = \sqrt{r^{2} - u^{2}}cos\theta$ \\ $y = \sqrt{r^{2} - u^{2}}sin\theta$').shift(2*UP + 3*RIGHT) + + + self.setup_axes() + self.play(FadeIn(self.axes), FadeIn(plottext)) + + dots = [] + for t in range(19): + dot = Dot().shift((3*XTD*np.cos(t), 3*YTD*np.sin(t),0)) + dots.append(dot) + self.play(FadeIn(dot), run_time = 0.2) + dots = VGroup(*dots) + circle = Circle(radius = 3*XTD).set_color(WHITE).set_stroke(width = 10) + self.play(FadeIn(circle), FadeOut(dots), FadeOut(plottext)) + self.wait(2) + + + axes = ThreeDAxes(**self.CONFIG) + sph = Sphere(radius = 3).scale(0.5) + text2 = TextMobject(r'Setting $u = 3$,\\$z = u$').shift(4*YTD*UP + 5*XTD*RIGHT) + + self.play(Transform(self.axes,axes), ReplacementTransform(circle, sph)) + self.add(text2) + self.wait(2) + self.remove(text2) + self.move_camera(phi = 60*DEGREES, theta=45*DEGREES,run_time=5) + self.begin_ambient_camera_rotation(rate=0.03) + self.play(FadeOut(axes), FadeOut(sph), FadeOut(self.axes)) + self.wait(1) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py new file mode 100644 index 0000000..e6ae1c6 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.py @@ -0,0 +1,33 @@ +from manimlib.imports import * + +class cone(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + eqn = TextMobject(r'$z^{2} = x^{2} + y^{2}$') + + conecurve = ParametricFunction( + lambda t: np.array([ + t*np.cos(TAU*t), + t*np.sin(TAU*t), + t + ]), t_min = -2.6, t_max = 2.6 + ).scale(0.85) + + conesurface = ParametricSurface( + lambda u,v: np.array([ + 3*np.sin(u)*np.cos(TAU*v), + 3*np.sin(u)*np.sin(TAU*v), + 2.7*u + ]), u_min = -1 + ).scale(0.85) + + self.play(FadeIn(eqn)) + self.wait(2) + self.play(FadeOut(eqn)) + self.set_camera_orientation(phi = 75*DEGREES, theta=50*DEGREES) + self.play(FadeIn(axes), ShowCreation(conecurve, run_time = 3)) + self.play(FadeOut(conecurve), FadeIn(conesurface)) + self.begin_ambient_camera_rotation(rate=0.03) + self.wait(2) + self.play(FadeOut(axes), FadeOut(conesurface)) + self.wait(2) diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file1_prescribed_plane.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file1_prescribed_plane.gif new file mode 100644 index 0000000..c8668e3 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file1_prescribed_plane.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif new file mode 100644 index 0000000..097652f Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/__pycache__/file2_tangent_spaceCurve.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/__pycache__/file2_tangent_spaceCurve.cpython-38.pyc new file mode 100644 index 0000000..8967b87 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/__pycache__/file2_tangent_spaceCurve.cpython-38.pyc differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file1_smooth_curves.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file1_smooth_curves.gif new file mode 100644 index 0000000..5801796 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file1_smooth_curves.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.py new file mode 100644 index 0000000..67c675e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.py @@ -0,0 +1,22 @@ +from manimlib.imports import * + +class tangent(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + self.set_camera_orientation(phi = 125*DEGREES, theta = 135*DEGREES) + h = ParametricFunction( + lambda t: np.array([ + 4*(t**3) + 5, + t**2 + 2*(t**4), + -2*np.log(2*t) + ]), t_min = -3, t_max = 1.18 + ).shift(5*LEFT) + tgtR = Line((4,3,-2*np.log(2)), (19.5, 16, -4.772588), color=YELLOW) + tgtL =Line((4,3,-2*np.log(2)), (-11.5, -10, 2), color=YELLOW) + dot = Dot((4,3,-2*np.log(2)), color=RED, radius=0.08) + self.play(FadeIn(axes),FadeIn(h), FadeIn(dot)) + self.begin_ambient_camera_rotation(rate=0.4) + self.wait(2) + self.play(FadeIn(tgtL), FadeIn(tgtR)) + self.wait(5) + self.play(FadeOut(axes), FadeOut(h), FadeOut(dot), FadeOut(tgtL), FadeOut(tgtR)) -- cgit From a70dc7346e1b46885852e7a31d1fefa74077b250 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Fri, 19 Jun 2020 15:38:04 +0530 Subject: Update README.md --- .../geometry-of-planes-and-curves/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/README.md index c3db80a..b46936b 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/README.md @@ -1,4 +1,4 @@ -This repository contains the codes written by [Saarth Deshpande](https://github.com/saarthdeshpande) during the course of FOSSEE Summer Fellowship 2020 under the Floss: Mathematics using Python. +This repository contains the codes written by [Saarth Deshpande](https://github.com/saarthdeshpande) during the course of FOSSEE Summer Fellowship 2020 under the FLOSS: Mathematics using Python. __Sub-topics covered__: * Equations of Planes and Lines -- cgit From 4d8f2f09a9049e7a86d4def20f4cd1e2e13d682e Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Fri, 19 Jun 2020 16:49:10 +0530 Subject: video update --- .../file1_simple_visualization.py | 46 +++++++++++++++------- 1 file changed, 32 insertions(+), 14 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.py index 0ae283a..7ab8908 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.py +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.py @@ -11,41 +11,59 @@ class randomcurve(GraphScene): def construct(self): intro = TextMobject('Consider the following curve.') mid = TextMobject(r'Notice how the direction of the unit tangent vectors\\changes with respect to the arc length.') - outro = TextMobject(r'This is called curvature.\\Mathematically, curvature $ = k = \left|{\frac{dT}{ds}}\right|$') + outro = TextMobject(r'The rate of change of unit tangents with \\ respect to the arc length $ds$ is called curvature.\\Mathematically, curvature $ = k = \left|{\frac{dT}{ds}}\right|$') XTD = self.x_axis_width/(self.x_max- self.x_min) YTD = self.y_axis_height/(self.y_max- self.y_min) - + + tgt1 = Arrow((-2.2*XTD,-0.5*YTD,0),(-1*XTD,1,0)) + tgt2 = Arrow((-1.2*XTD, 1.93*YTD,0),(0*XTD,1.6,0)).scale(1.2) + tgt3 = Arrow((-0.3*XTD,3*YTD, 0), (1.5*XTD, 3*YTD,0)) + tgt4 = Arrow((1.4*XTD, 2*YTD,0),(2.4*XTD, 1*YTD,0)).scale(2.8) + tgt5 = Arrow((2.4*XTD, 0, 0), (3.8*XTD,-2*YTD, 0)).scale(1.2).shift(0.26*RIGHT) + tgt6 = Arrow((3.8*XTD,-1*YTD, 0), (4.8*XTD, -1*YTD, 0)).scale(2.8).shift(0.26*RIGHT) + tgt7 = Arrow((5.3*XTD, 0, 0),(6.3*XTD,1,0)).shift(0.35*LEFT+0.1*DOWN).scale(1.3) + + dot1 = Dot(tgt1.get_start(), color = RED) + dot2 = Dot(tgt2.get_start(), color = RED) + dot3 = Dot(tgt3.get_start(), color = RED) + dot4 = Dot(tgt4.get_start(), color = RED) + dot5 = Dot(tgt5.get_start(), color = RED) + dot6 = Dot(tgt6.get_start(), color = RED) + dot7 = Dot(tgt7.get_start(), color = RED) + + dots = VGroup(*[dot1, dot2, dot3, dot4, dot5, dot6, dot7]) + + ds = CurvedArrow((-4, 2, 0), (tgt1.get_start() + tgt2.get_start()) / 2, color = YELLOW) + ds_text = TextMobject(r'$ds$').next_to(ds, UP, buff = 0.1).shift(1.3*LEFT) + self.setup_axes(hideaxes=True) graphobj = self.get_graph(self.curve) self.play(FadeIn(intro)) self.wait(2) self.play(FadeOut(intro)) self.setup_axes(hideaxes=False) - self.play(ShowCreation(graphobj)) + self.play(ShowCreation(graphobj), FadeIn(dots), FadeIn(ds), FadeIn(ds_text)) self.wait(1) - self.play(FadeOut(self.axes), FadeOut(graphobj),FadeIn(mid)) + self.play(FadeOut(self.axes), FadeOut(graphobj),FadeIn(mid), FadeOut(dots), FadeOut(ds), FadeOut(ds_text)) self.wait(2) self.play(FadeOut(mid)) - self.play(FadeIn(self.axes), FadeIn(graphobj)) + self.play(FadeIn(self.axes), FadeIn(graphobj), FadeIn(dots)) + - tgt1 = Arrow((-2.2*XTD,-0.5*YTD,0),(-1*XTD,1,0)) - tgt2 = Arrow((-1.2*XTD, 1.93*YTD,0),(0*XTD,1.6,0)).scale(1.2) - tgt3 = Arrow((-0.3*XTD,3*YTD, 0), (1.5*XTD, 3*YTD,0)) - tgt4 = Arrow((1.4*XTD, 2*YTD,0),(2.4*XTD, 1*YTD,0)).scale(2.8) - tangents = [tgt1, tgt2, tgt3, tgt4] + tangents = [tgt1, tgt2, tgt3, tgt4, tgt5, tgt6, tgt7] for tangent in tangents: - self.play(ShowCreation(tangent)) + self.play(ShowCreation(tangent), run_time = 0.2) self.wait(1) tangents = VGroup(*tangents) - self.play(FadeOut(self.axes), FadeOut(graphobj), FadeOut(tangents)) + self.play(FadeOut(self.axes), FadeOut(graphobj), FadeOut(tangents), FadeOut(dots)) self.wait(1) self.play(FadeIn(outro)) self.wait(2) self.play(FadeOut(outro)) self.wait(1) - + def curve(self, x): - return 3 - (3653*x**2)/5292 + (2477*x**3)/31752 + (13*x**4)/784 - (17*x**5)/5292 + (17*x**6)/63504 \ No newline at end of file + return 3 - (3653*x**2)/5292 + (2477*x**3)/31752 + (13*x**4)/784 - (17*x**5)/5292 + (17*x**6)/63504 -- cgit From 5a80fc01354cb1ed46a42a3e67126a6f966cf4cc Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Sun, 21 Jun 2020 10:25:22 +0530 Subject: last video for curvature --- .../file4_different_curvature_single_curve.py | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.py new file mode 100644 index 0000000..d71adda --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.py @@ -0,0 +1,56 @@ +from manimlib.imports import * + +class GR(GraphScene): + CONFIG = { + "x_axis_label": "", + "y_axis_label": "", + "x_min": -4, + "x_max": 6, + "y_min": -6, + "y_max": 10, + "graph_origin": ORIGIN + } + + def construct(self): + + self.setup_axes() + def curve(x): + return 3 - (3653*x**2)/5292 + (2477*x**3)/31752 + (13*x**4)/784 - (17*x**5)/5292 + (17*x**6)/63504 + + graph = FunctionGraph(curve, x_min=-3, x_max=6, stroke_width = 2, color = BLUE) + + tracker = ValueTracker(-3) + + text = TextMobject(r'The curvature at point $P_{1}$ is \\ lesser than that at point $P_{2}$: \\ as $\kappa = \frac{1}{R}$').shift(3.2*RIGHT+3*UP).scale(0.6) + + dot1 = Dot((0,3,0), color = YELLOW) + dot1label = TextMobject(r'$P_{1}$').next_to(dot1, UP+RIGHT, buff = 0.1) + dot2 = Dot((4,-1, 0), color = YELLOW) + dot2label = TextMobject(r'$P_{2}$').next_to(dot2, DOWN, buff = 0.1) + dots = VGroup(*[dot1, dot2, dot1label, dot2label]) + + def get_tangent_line(): + line = Line( + ORIGIN, 2 * RIGHT, + color=RED, + stroke_width=4, + ) + dx = 0.0001 + + x = tracker.get_value() + p0 = np.array([x-dx,curve(x-dx),0]) + p1 = np.array([x, curve(x), 0]) + p2 = np.array([x + dx, curve(x + dx), 0]) + + angle = angle_of_vector(p2 - p1) + line.rotate(angle) + line.move_to(p0) + return line + + line = always_redraw(get_tangent_line) + + self.add(graph,line, dots, text) + self.wait(1.2) + self.play(tracker.set_value, 6, rate_func=smooth, run_time=13) + self.play(FadeOut(VGroup(*[graph, self.axes, line, dots, text]))) + self.wait() -- cgit From 9ab7138ebd965da0087f1711ead9b53971fca3d2 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 17:20:21 +0530 Subject: removed pyc files --- .../__pycache__/file1_line_eqn.cpython-38.pyc | Bin 1541 -> 0 bytes .../file4_point_normal_form_plane.cpython-38.pyc | Bin 2225 -> 0 bytes .../__pycache__/file1_parametric_circle.cpython-38.pyc | Bin 3089 -> 0 bytes .../__pycache__/file4_helix_visualization.cpython-38.pyc | Bin 1506 -> 0 bytes .../__pycache__/file1_parametric_ellipse.cpython-38.pyc | Bin 3102 -> 0 bytes .../__pycache__/file2_parametric_helix.cpython-38.pyc | Bin 3575 -> 0 bytes .../__pycache__/file3_circletosphere.cpython-38.pyc | Bin 1843 -> 0 bytes .../space-curves/__pycache__/file3_cone.cpython-38.pyc | Bin 1499 -> 0 bytes .../__pycache__/file2_tangent_spaceCurve.cpython-38.pyc | Bin 1429 -> 0 bytes 9 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file1_line_eqn.cpython-38.pyc delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file4_point_normal_form_plane.cpython-38.pyc delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file1_parametric_circle.cpython-38.pyc delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file4_helix_visualization.cpython-38.pyc delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file1_parametric_ellipse.cpython-38.pyc delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file2_parametric_helix.cpython-38.pyc delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_circletosphere.cpython-38.pyc delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_cone.cpython-38.pyc delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/__pycache__/file2_tangent_spaceCurve.cpython-38.pyc (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file1_line_eqn.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file1_line_eqn.cpython-38.pyc deleted file mode 100644 index e129d1d..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file1_line_eqn.cpython-38.pyc and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file4_point_normal_form_plane.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file4_point_normal_form_plane.cpython-38.pyc deleted file mode 100644 index 88377bb..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/__pycache__/file4_point_normal_form_plane.cpython-38.pyc and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file1_parametric_circle.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file1_parametric_circle.cpython-38.pyc deleted file mode 100644 index ad30b2a..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file1_parametric_circle.cpython-38.pyc and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file4_helix_visualization.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file4_helix_visualization.cpython-38.pyc deleted file mode 100644 index 144d78d..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/__pycache__/file4_helix_visualization.cpython-38.pyc and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file1_parametric_ellipse.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file1_parametric_ellipse.cpython-38.pyc deleted file mode 100644 index a732643..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file1_parametric_ellipse.cpython-38.pyc and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file2_parametric_helix.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file2_parametric_helix.cpython-38.pyc deleted file mode 100644 index c8e3e2a..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file2_parametric_helix.cpython-38.pyc and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_circletosphere.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_circletosphere.cpython-38.pyc deleted file mode 100644 index bca0d91..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_circletosphere.cpython-38.pyc and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_cone.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_cone.cpython-38.pyc deleted file mode 100644 index ae954c3..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/__pycache__/file3_cone.cpython-38.pyc and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/__pycache__/file2_tangent_spaceCurve.cpython-38.pyc b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/__pycache__/file2_tangent_spaceCurve.cpython-38.pyc deleted file mode 100644 index 8967b87..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/__pycache__/file2_tangent_spaceCurve.cpython-38.pyc and /dev/null differ -- cgit From 76f2a255a93b362c6fbddf8a3ef89179c81723e9 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:14:32 +0530 Subject: Add files via upload --- .../equations-of-planes-and-lines/file1_line_eqn.gif | Bin 0 -> 4694940 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.gif new file mode 100644 index 0000000..a8a301a Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.gif differ -- cgit From 462f8e73b9bb0ee52f34616dd9e9619f86dae77c Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:23:34 +0530 Subject: Add files via upload --- .../file2_point_normal_form_plane.gif | Bin 0 -> 430431 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.gif new file mode 100644 index 0000000..e651be0 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.gif differ -- cgit From bcbeee103e953bdf7f723eecb46ccff0255901c6 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:32:41 +0530 Subject: Add files via upload --- .../file5_vector_form_line.gif | Bin 0 -> 536607 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.gif new file mode 100644 index 0000000..b6fdb51 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.gif differ -- cgit From 9898bae0b5551e1e6a0153c85cc121aa8ead34c6 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:33:09 +0530 Subject: Create README.md --- .../equations-of-planes-and-lines/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md new file mode 100644 index 0000000..fd3655d --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md @@ -0,0 +1,14 @@ +**file1_line_eqn.py** +![file1_line_eqn.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.gif) + +**file2_point_normal_form_plane.py** +![file2_point_normal_form_plane.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.gif) + +**file3_intercept_form_plane.py** +![file3_intercept_form_plane.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.gif) + +**file4_3d_plane.py** +![file4_3d_plane.py]https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.gif) + +**file5_vector_form_line.py** +![file5_vector_form_line.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.gif) -- cgit From 97d26bedbaefc8300e16828cd8e62c887059b4e8 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:33:40 +0530 Subject: Update README.md --- .../equations-of-planes-and-lines/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md index fd3655d..79061a7 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md @@ -8,7 +8,7 @@ ![file3_intercept_form_plane.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.gif) **file4_3d_plane.py** -![file4_3d_plane.py]https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.gif) +![file4_3d_plane.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.gif) **file5_vector_form_line.py** ![file5_vector_form_line.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.gif) -- cgit From 192baec5e929970344ca174f115f0080bed1561a Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:33:59 +0530 Subject: Update README.md --- .../equations-of-planes-and-lines/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md index 79061a7..d1729ee 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md @@ -1,4 +1,4 @@ -**file1_line_eqn.py** +**file1_line_eqn.py**

![file1_line_eqn.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.gif) **file2_point_normal_form_plane.py** -- cgit From a438abc85805600a737ab309cc59a9a61f54b914 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:34:09 +0530 Subject: Update README.md --- .../equations-of-planes-and-lines/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md index d1729ee..d6b89ef 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md @@ -1,4 +1,4 @@ -**file1_line_eqn.py**

+**file1_line_eqn.py**
![file1_line_eqn.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.gif) **file2_point_normal_form_plane.py** -- cgit From 140a19871867a02023ded8b9b2586e4bbaa0c279 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:41:41 +0530 Subject: Add files via upload --- .../file1_parametric_circle.gif | Bin 0 -> 327132 bytes .../file4_helix_visualization.gif | Bin 0 -> 3596680 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.gif new file mode 100644 index 0000000..732b6bb Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.gif new file mode 100644 index 0000000..16d2509 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.gif differ -- cgit From 86bfd736ab17d7ae035d39b1989e0046cffa87a8 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:45:42 +0530 Subject: Create README.md --- .../general-parametric-curves/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/README.md new file mode 100644 index 0000000..be358ac --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/README.md @@ -0,0 +1,11 @@ +**file1_parametric_circle..py** +![file1_parametric_circle.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.gif) + +**file2_cycloid_manim.py** +![file2_cycloid_manim.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.gif) + +**file3_brachistochrone.py** +![file3_brachistochrone.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.gif) + +**file4_helix_visualization.py** +![file4_helix_visualization.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.gif) -- cgit From 5e356df8454ba89cfc48fb986f64910a89e8c2d7 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:55:58 +0530 Subject: Add files via upload --- .../space-curves/file1_parametric_ellipse.gif | Bin 0 -> 340180 bytes .../space-curves/file2_parametric_helix.gif | Bin 0 -> 389637 bytes .../space-curves/file3_circletosphere.gif | Bin 0 -> 1811911 bytes .../space-curves/file4_cone.gif | Bin 0 -> 987693 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.gif new file mode 100644 index 0000000..90c0349 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.gif new file mode 100644 index 0000000..4f349b1 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.gif new file mode 100644 index 0000000..d6a8afc Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.gif new file mode 100644 index 0000000..b126d20 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.gif differ -- cgit From ff55a5ea68b4ada3592ce3a7c285c37742cd7210 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:58:17 +0530 Subject: Create README.md --- .../geometry-of-planes-and-curves/space-curves/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md new file mode 100644 index 0000000..317ec2c --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md @@ -0,0 +1,11 @@ +**file1_parametric_ellipse.py** +![file1_parametric_ellipse.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.gif) + +**file2_parametric_helix.py** +![file2_parametric_helix.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.gif) + +**file3_circletosphere.py** +![file3_circletosphere.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.gif) + +**file4_cone.py** +![file4_cone.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.gif) -- cgit From 7c635e30569a1a34367a0652a69938f955e08aba Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Tue, 23 Jun 2020 23:58:44 +0530 Subject: Update README.md --- .../geometry-of-planes-and-curves/space-curves/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md index 317ec2c..18516b7 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md @@ -4,8 +4,8 @@ **file2_parametric_helix.py** ![file2_parametric_helix.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.gif) -**file3_circletosphere.py** +**file3_circletosphere.py**
![file3_circletosphere.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file3_circletosphere.gif) -**file4_cone.py** +**file4_cone.py**
![file4_cone.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file4_cone.gif) -- cgit From f31fd0cb6fe4f356a43a1597b0396f6792e5b4c6 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 00:04:29 +0530 Subject: Add files via upload --- .../file1_simple_visualization.gif | Bin 0 -> 686712 bytes .../file2_circle_curvature.gif | Bin 0 -> 346667 bytes .../file4_different_curvature_single_curve.gif | Bin 0 -> 243868 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.gif new file mode 100644 index 0000000..858a8de Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.gif new file mode 100644 index 0000000..989a3b7 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.gif new file mode 100644 index 0000000..3b78b5f Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.gif differ -- cgit From 1a61648b355db2e3bc4fb1c0776f5243ac2aa0f3 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 00:07:21 +0530 Subject: Create README.md --- .../arc-length-and-curvature/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md new file mode 100644 index 0000000..e61fd00 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md @@ -0,0 +1,11 @@ +**file1_simple_visualization.py** +![file1_simple_visualization.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.gif) + +**file2_circle_curvature.py** +![file2_circle_curvature.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.gif) + +**file3_curvature_intuition.gif** +![file3_curvature_intuition.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file3_curvature_intuition.gif) + +**file4_different_curvature_single_curve.py** +![file4_different_curvature_single_curve.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.gif) -- cgit From 5ef30fc9cfe4faef33b65f23b5b3d95f579e2c88 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 00:07:41 +0530 Subject: Update README.md --- .../geometry-of-planes-and-curves/arc-length-and-curvature/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md index e61fd00..f5313c9 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md @@ -1,10 +1,10 @@ **file1_simple_visualization.py** ![file1_simple_visualization.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.gif) -**file2_circle_curvature.py** +**file2_circle_curvature.py**
![file2_circle_curvature.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.gif) -**file3_curvature_intuition.gif** +**file3_curvature_intuition.gif**
![file3_curvature_intuition.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file3_curvature_intuition.gif) **file4_different_curvature_single_curve.py** -- cgit From 62b0909cd0cab3f456ea4e73659163c283aba2c0 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 00:10:06 +0530 Subject: Add files via upload --- .../file2_tangent_space_curve.gif | Bin 0 -> 1317248 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.gif new file mode 100644 index 0000000..06ed70f Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.gif differ -- cgit From 4ccb0de938e035e86e6003f00f90f604c89c533d Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 00:11:25 +0530 Subject: Create README.md --- .../velocity-and-differentiability/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md new file mode 100644 index 0000000..8092cf7 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md @@ -0,0 +1,5 @@ +**file1_smooth_curves.gif** +![file1_smooth_curves.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file1_smooth_curves.gif) + +**file2_tangent_space_curve.py** +![file2_tangent_space_curve.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.gif) -- cgit From a94d10724cbc5866254496becd4b4fc749f08066 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:30:31 +0530 Subject: Update file1_Critical_Point_of_a_function.py --- .../file1_Critical_Point_of_a_function.py | 94 +++++++++++++--------- 1 file changed, 55 insertions(+), 39 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py index f3c16d4..e8cb08d 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py @@ -1,61 +1,77 @@ from manimlib.imports import* import math as m - -class CriticalPoint(ThreeDScene): +#---- 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 - surface = ParametricSurface( #---- partial derivatives of the funtion exists + #---- 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]).fade(0.6).scale(3.5).shift([0,0,1.5]) - - surface2 = ParametricSurface( #---- partial derivatives of the funtion does not exists - 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]) + 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 of surface - - d2 = Dot([0,0,0],color = '#800000') #---- critical point of surface2 - - d_text = TextMobject("$\\frac{\\partial f}{\\partial x}=\\frac{\\partial f}{\\partial y} = 0$").scale(1).to_corner(UL) - - d2_text = TextMobject("$\\frac{\\partial f}{\\partial x}$ and/or $\\frac{\\partial f}{\\partial y}$ does not exist").scale(0.8).to_corner(UL) - - f_text = TextMobject("Critical Point of a function",color = YELLOW).shift([3,0,3.7]).scale(0.7) + d = Dot([0,0,3.75],color = '#800000') #---- critical point - g_text = TextMobject("Critical Point of a function",color = YELLOW).shift(1*DOWN).scale(0.5) - - self.set_camera_orientation(phi=75*DEGREES,theta=90*DEGREES) - self.add(axes) - self.begin_ambient_camera_rotation(rate=0.2) - self.play(Write(surface)) + 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.move_camera(phi=0 * DEGREES,theta = 90*DEGREES) - self.wait(2) self.add_fixed_in_frame_mobjects(f_text) - self.play(FadeOut(f_text),FadeOut(surface),FadeOut(axes),FadeOut(d_text),FadeOut(d),FadeOut(l1)) - self.wait(1) - self.set_camera_orientation(phi=75*DEGREES,theta=60*DEGREES) - self.add(axes) - self.begin_ambient_camera_rotation(rate=0.3) - self.add_fixed_in_frame_mobjects(d2_text) - self.wait(1) + 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)) - l1.fade(0.4) - self.play(Write(l1)) - self.play(Write(d2)) + self.wait(1) + self.play(Write(d2)) + self.wait(1) self.add_fixed_in_frame_mobjects(g_text) - self.wait(2) - + self.wait(2) -- cgit From a0755ea6df7e229196cffb64c8f04efeea0601a7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:42:57 +0530 Subject: Update file2_Traces_and_Tangent.py --- .../Critical-Points/file2_Traces_and_Tangent.py | 105 ++++++++++----------- 1 file changed, 50 insertions(+), 55 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py index 6be4c6a..95c3af9 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py @@ -1,93 +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.15) + 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, - m.exp(-10*u**2-10*v**2) #---- f(x,y) - ]),u_min=-2,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) - - trace = ParametricSurface( + -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([ - m.exp(np.cos(v)+np.sin(v)), - v, - u/4 - ]), v_min = -1, v_max= 2).rotate(1.571,DOWN).shift(2.15*LEFT+[0.6,-0.4,1.54]).scale(1).set_color('#800000') + 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([1.9,0.7,4.1]) #---- critical point - tangent_line = Line(color = '#228B22').scale(1).shift([1.9,0.7,4.1]).rotate(4.5) #---- tangent along y axis + d = Dot(color =YELLOW).shift([-0.05,-0.2,2.3]) #---- critical point - label_x = TextMobject("$x$").shift([5.8,-0.5,0]) - label_y = TextMobject("$y$").shift([-0.5,5.6,0]).rotate(-4.5) + 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') - f_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=60*DEGREES,theta=15*DEGREES) + 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.wait(1) - self.add_fixed_in_frame_mobjects(s_text) - self.add(trace) + self.add_fixed_in_frame_mobjects(x_text) + self.add(curve) self.wait(1) self.play(Write(tangent_line),Write(d)) - self.wait(2) - - + self.wait(1) + + + +#---- tangent to the trace with y constant class secondScene(ThreeDScene): def construct(self): - axes = ThreeDAxes().scale(1.15) + 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, - m.exp(-10*u**2-10*v**2) #---- f(x,y) - ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) + -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) - trace = ParametricSurface( + #---- curve(trace) along x axis + curve = ParametricSurface( lambda u, v: np.array([ - m.exp(np.cos(v)+np.sin(v)), - v, - u/4 - ]), v_min = -1, v_max= 2).rotate(1.571,DOWN).shift(2.15*LEFT+[0.6,-0.4,1.54]).scale(1).set_color('#800000') - - + 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([1.9,0.7,4.1]) #---- critical point - - label_x = TextMobject("$x$").shift([5.8,-0.5,0]) - label_y = TextMobject("$y$").shift([-0.5,5.6,0]).rotate(-4.5) - - f_text = TextMobject("Tangent to the trace with $y$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) + d = Dot(color = YELLOW).shift([0,-0.2,2.3]) #---- critical point - tangent_line = Line(color = '#228B22').scale(1).shift([1.9,0.7,4.1]) #---- tangent along x axis - + 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=60*DEGREES,theta=15*DEGREES) + 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.wait(1) - self.add_fixed_in_frame_mobjects(f_text) - trace.rotate(-5).shift(0.2*RIGHT+0.8*UP+[0.6,-0.4,0.6]) - self.add(trace) + self.add_fixed_in_frame_mobjects(y_text) + self.add(curve) + self.wait(1.5) self.play(Write(tangent_line),Write(d)) - self.wait(1) - - - - - - + self.wait(0.5) -- cgit From ad1c0e62ba7ff5bb9612a8fd674005a26e3fd80b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:44:00 +0530 Subject: Update file2_Traces_and_Tangent.py --- .../Critical-Points/file2_Traces_and_Tangent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py index 95c3af9..4b020e1 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py @@ -6,8 +6,8 @@ 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) + 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( @@ -50,8 +50,8 @@ 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) + 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( -- cgit From 6e5e6936f498a12a514371060916691495cf8c20 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:44:44 +0530 Subject: Update file3_Tangent_plane_at_extrema_of_a_function.py --- ...file3_Tangent_plane_at_extrema_of_a_function.py | 82 ++++++++++++++-------- 1 file changed, 51 insertions(+), 31 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py index b066d04..e674113 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py @@ -1,53 +1,73 @@ from manimlib.imports import* -class TangentPlane(ThreeDScene): +#---- 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: x**2+y**2 - parabola1 = ParametricSurface( + #---- 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) + ]),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) - #----parabola: -x**2-y**2 - parabola2 = 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) - - self.set_camera_orientation(phi=75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.2) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color= '#C0C0C0',fill_opacity = 0.3).move_to(ORIGIN).fade(0.7) #----tangent plane + d = Dot(np.array([0,0,0]), color = '#800000') # ---- critical point - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + tangent_plane = Rectangle(fill_color = '#C0C0C0', fill_opacity = 0.3).move_to(ORIGIN).fade(0.7) # ----tangent plane - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + 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_fixed_in_frame_mobjects(parabola2_text) + self.add(label_x) + self.add(label_y) + self.add_fixed_in_frame_mobjects(parabola_text) self.wait(1) - self.play(Write(parabola1)) + self.play(Write(parabola)) self.play(ShowCreation(d)) self.wait(1) - self.play(ShowCreation(r)) + self.play(ShowCreation(tangent_plane)) self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + 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 - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) + #----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(r)) - self.wait(1) + self.play(ShowCreation(tangent_plane)) + self.wait(2) -- cgit From 53563c2c640988232b1f6a61020e2ce7b3e609f1 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:46:50 +0530 Subject: Update file4_Types_of_critical_points.py --- .../file4_Types_of_critical_points.py | 172 ++++++++++++--------- 1 file changed, 99 insertions(+), 73 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py index 42703ba..656fb68 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py @@ -1,108 +1,134 @@ -from manimlib.imports import * +from manimlib.imports import* + - -class MaximaScene(ThreeDScene): +#---- Relative Maxima +class firstScene(ThreeDScene): def construct(self): - axes = ThreeDAxes() - + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - #----graph of first function f(x,y) = -x**2-y**2 - f = ParametricSurface( + 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], - resolution = (20, 20)).scale(1.5).shift([0,0,-0.51]).fade(0.3) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + ]),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.play(Write(f),Write(d)) + 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(f),FadeOut(f_text),FadeOut(d)) - -class SaddlePoint(ThreeDScene): + 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("Saddle Point",color ='#87CEFA') + r2_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + axes = ThreeDAxes() - - #----graph of third 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 = [PURPLE_B,PURPLE_C,PURPLE_D,PURPLE_E]).scale(1.5).shift([0,0,0]) - - #---- trace along y axis - a = ParametricSurface( - lambda u, v: np.array([ - u, - v, - v**2 - ]),v_min = -1, v_max = 1, u_min = -0.2, u_max = 0.2).shift([0,0,0.36]).scale(1.5).set_color(GREEN) - - #---- trace along x axis - b = ParametricSurface( + 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_min = -0.2, v_max = 0.2, u_min = -1, u_max = 1).scale(1.6).shift([0,0,-0.1]).set_color(GREEN) - - d = Dot(color = '#800000').shift([0,0,0.1]) #---- critical point - - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + 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.set_camera_orientation(phi=75*DEGREES,theta=10*DEGREES) self.play(FadeOut(r2_text)) - self.add(axes) - self.begin_ambient_camera_rotation(rate=0.4) - self.add_fixed_in_frame_mobjects(f2_text) - self.play(Write(f2)) - self.add(b) - self.wait(1) - self.add(a) - self.wait(3) - self.add(d) + 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) - - -class MinimaScene(ThreeDScene): + 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("Relative Minimum at ORIGIN",color ='#87CEFA') + + r3_text = TextMobject("Saddle Point", color = '#87CEFA') + axes = ThreeDAxes() - - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----graph of third function f(x,y) = x**2+y**2 - f3 = ParametricSurface( + 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 =[TEAL_B,TEAL_C,TEAL_D,TEAL_E], - resolution = (20, 20)).scale(1.5).shift([0,0,0.55]).fade(0.1) + -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]) - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + #---- 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.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) + 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) -- cgit From 0560d86317ed48bb7cefa3785d511148803f5faa Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:47:30 +0530 Subject: Update file5_f(x,y)=(y-x)(1-2x-3y).py --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py index 8a90990..41c3b61 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py @@ -1,25 +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_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - - #----f(x,y) = (y-x)(1-2x-3y) - f = ParametricSurface( + #---- 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], - resolution=(20, 20)).scale(1).fade(0.2).shift([0.2,0.2,0]) + ]),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 = 75 * DEGREES,theta= 60*DEGREES) + 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(3) + self.wait(4) -- cgit From 24740d5f0847b83fb00fd7c1c11079f5ab0f85fd Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:51:18 +0530 Subject: Delete file1_Critical_Point_of_a_function.gif --- .../file1_Critical_Point_of_a_function.gif | Bin 7079252 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif deleted file mode 100644 index c376e2d..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif and /dev/null differ -- cgit From e1655eb3623d275b48cd662c0e325384072c5452 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:52:19 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 8077401 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..ca3989c Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From e62f39b12bd273d5e3d47c00c69f7bf59c0457fe Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:53:14 +0530 Subject: Delete file1_Critical_Point_of_a_function.gif --- .../file1_Critical_Point_of_a_function.gif | Bin 8077401 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif deleted file mode 100644 index ca3989c..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif and /dev/null differ -- cgit From b9d4f3663f2b6555162c950850a5e73fe26a408c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:54:33 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 8077401 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..ca3989c Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From 2c55441285f10c62f65f69b51a7c18fa3a2eec10 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:01 +0530 Subject: Delete file1_Critical_Point_of_a_function.gif --- .../file1_Critical_Point_of_a_function.gif | Bin 8077401 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif deleted file mode 100644 index ca3989c..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif and /dev/null differ -- cgit From 90b416dbcf171c2c85693923cf678ca39737f2ff Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:15 +0530 Subject: Delete file2_Traces_and_Tangent.gif --- .../Critical-Points/file2_Traces_and_Tangent.gif | Bin 1105801 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif deleted file mode 100644 index e7a2a46..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif and /dev/null differ -- cgit From d86548e2c9ebd0d45ad1a203c5768aca4e9a319f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:30 +0530 Subject: Delete file3_Tangent_plane_at_extrema_of_a_function.gif --- .../file3_Tangent_plane_at_extrema_of_a_function.gif | Bin 2195510 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif deleted file mode 100644 index 41c72cc..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif and /dev/null differ -- cgit From bed3d0967b74a6bcb90d5f0438b21c44b5515777 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:46 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 2676014 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif deleted file mode 100644 index 6070720..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From 8dffdbbf184c9bda9134b692c6793839c88ed337 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:57 +0530 Subject: Delete file5_f(x,y)=(y-x)(1-2x-3y).gif --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif | Bin 1231893 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif deleted file mode 100644 index 0a2785e..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif and /dev/null differ -- cgit From 0baac10a6e293c6fcdd777f0db48512560f25cee Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:57:46 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 8780553..994622e 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,4 +1,4 @@ -1. Critical Points +SubTopic: Critical Points

-------- Animations -------- -- cgit From ec24b630e802c6fbc628f01cd9f0fe584570ddce Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:59:15 +0530 Subject: Update README.md --- .../Critical-Points/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 994622e..7ad6070 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,4 +1,4 @@ -SubTopic: Critical Points +SubTopic: Critical Points

-------- Animations -------- @@ -7,30 +7,30 @@ SubTopic: Critical Points 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/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +![](?raw=true)



file2_Traces_and_Tangent - ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) + ![](?raw=true)



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/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) + ![](?raw=true)



file4_Types_of_critical_points - ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) + ![](?raw=true)



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/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) + ![](f?raw=true)



-- cgit From 32f8ba3ba6a2453ac08afa7eccc9e726b92b1669 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:00:44 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 8077401 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..ca3989c Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From 16f529f4af22e97785fadbcafa3007f11eeaf438 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:01:47 +0530 Subject: Add files via upload --- .../Critical-Points/file2_Traces_and_Tangent.gif | Bin 0 -> 2552938 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif new file mode 100644 index 0000000..84acf2e Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif differ -- cgit From 2597b0e7e3de8bb7211ebac8a0def0d2b90593f8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:03:20 +0530 Subject: Add files via upload --- .../file3_Tangent_plane_at_extrema_of_a_function.gif | Bin 0 -> 2198637 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif new file mode 100644 index 0000000..14fb318 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif differ -- cgit From a45facc8c59dd1e7a93a91e0a3373c75586f8284 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:04:54 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 3864765 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..91e7084 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From 73eb502063fa9e6c9b4182e4ebb61b85a3398f9c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:06:06 +0530 Subject: Add files via upload --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif | Bin 0 -> 1522415 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif new file mode 100644 index 0000000..4bc92f8 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif differ -- cgit From f4fe7f0a658736bfa68f3da693f45dc3b366fa4d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:09:04 +0530 Subject: Update README.md --- .../approximations-and-optimizations/Critical-Points/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 7ad6070..c8722a3 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -7,30 +7,30 @@ file1_Critical_Point_of_a_function -![](?raw=true) +![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true)



file2_Traces_and_Tangent - ![](?raw=true) + ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true)



file3_Tangent_plane_at_extrema_of_a_function - ![](?raw=true) + ![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true)



file4_Types_of_critical_points - ![](?raw=true) + ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true)



file5_f(x,y)=(y-x)(1-2x-3y) - ![](f?raw=true) + ![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)



-- cgit From 143e210fd2234377ff23b0728c4c2583e8ddb336 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:11:45 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index c8722a3..c665c78 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,6 +1,6 @@ -SubTopic: Critical Points +

SubTopic: Critical Points



--------- Animations -------- +

-------- Animations --------





@@ -33,7 +33,7 @@ ![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)



- + -- cgit From bf1fd9d635a0450f062af7303f9e1f28e82e138b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:13:23 +0530 Subject: Update README.md --- .../Critical-Points/README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index c665c78..4c5021d 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,34 +1,38 @@ -

SubTopic: Critical Points

+

SubTopic: Critical Points



-

-------- Animations --------

+

Animations





- file1_Critical_Point_of_a_function +
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/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true)



+
-file2_Traces_and_Tangent +
file2_Traces_and_Tangent ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true)



+
-file3_Tangent_plane_at_extrema_of_a_function +
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/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true)



+
-file4_Types_of_critical_points +
file4_Types_of_critical_points ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true)



+
-file5_f(x,y)=(y-x)(1-2x-3y) +
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/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)

-- cgit From 02a447e3288b5b5fd0b46a330e197b8fe2717e0b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:15:25 +0530 Subject: Update README.md --- .../Critical-Points/README.md | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 4c5021d..598607b 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,43 +1,36 @@ -

SubTopic: Critical Points

+

SubTopic: Critical Points



-

Animations

+

Animations





-
file1_Critical_Point_of_a_function +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/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true)



-
-
file2_Traces_and_Tangent +file2_Traces_and_Tangent - ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) +![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true)



-
-
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/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) +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/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true)



-
-
file4_Types_of_critical_points +file4_Types_of_critical_points - ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) +![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true)



-
-
file5_f(x,y)=(y-x)(1-2x-3y) +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/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) +![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)



-
- - - -- cgit From 3bf2eb6ac38722218f5a9b3ab89c12629073ed9d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:16:02 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 4 ---- 1 file changed, 4 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 598607b..f0747bb 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,9 +1,5 @@

SubTopic: Critical Points



-

Animations

- -

-

file1_Critical_Point_of_a_function -- cgit From 14038e183235f0c3c9c8b354e1e16b17728e4bbf Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:45:49 +0530 Subject: Create file1_Second_order_partial_derivatives.py Source code of first animation of the lecture note: The second derivative test--- .../file1_Second_order_partial_derivatives.py | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py b/FSF-2020/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/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) -- cgit From 7cfd798434a60d8664b3a0eff04193cfd93b50ab Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:49:25 +0530 Subject: Add files via upload --- .../file1_Second_order_partial_derivatives.gif | Bin 0 -> 3166332 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif new file mode 100644 index 0000000..3471e4d Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif differ -- cgit From 14a06e6bf4ed8a5a661555f193ba145fe8121b86 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 02:04:03 +0530 Subject: Create file4_Contour_Diagram.py --- .../file4_Contour_Diagram.py | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py new file mode 100644 index 0000000..618dcbd --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py @@ -0,0 +1,121 @@ +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) + ]), + resolution=(6, 32)).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(f),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) -- cgit From 1a3fcb648c8be25ff2a21833c532330be6c5238c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 02:44:28 +0530 Subject: Update file4_Contour_Diagram.py --- .../The-Second-Derivative-Test/file4_Contour_Diagram.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py index 618dcbd..d3084e2 100644 --- a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py +++ b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py @@ -50,8 +50,7 @@ class ContourDiagram(ThreeDScene): np.cos(TAU * v), np.sin(TAU * v), 2*(1 - 1.5*u) - ]), - resolution=(6, 32)).fade(0.5).scale(0.61).shift([0,0,0.4]).set_color(YELLOW) + ])).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]) @@ -111,7 +110,7 @@ class ContourDiagram(ThreeDScene): self.wait(1) self.play(Write(c_5)) self.wait(1) - self.play(FadeOut(contour5),FadeOut(axes),FadeOut(f),FadeOut(contour5),FadeOut(contour4),FadeOut(contour3),FadeOut(contour2),FadeOut(contour1)) + 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) -- cgit From 51b69836caaea9743d6d4a3c91a789b3fdc8ceee Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 02:47:35 +0530 Subject: Add files via upload --- .../file4_Contour_Diagram.gif | Bin 0 -> 1150777 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif new file mode 100644 index 0000000..129fedc Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif differ -- cgit From 39e28347b3584d3077cefa2b303d6fa6ac802feb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:47:48 +0530 Subject: Create file2_Degenerate_Hessian_Matrix.py --- .../file2_Degenerate_Hessian_Matrix.py | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py new file mode 100644 index 0000000..c1e3516 --- /dev/null +++ b/FSF-2020/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) -- cgit From 355abf1850e7884e91f6bcf4fc35272a704b45b7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:48:41 +0530 Subject: Create file3_Nondegenerate_Hessian_Matrix.py --- .../file3_Nondegenerate_Hessian_Matrix.py | 145 +++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py new file mode 100644 index 0000000..3056842 --- /dev/null +++ b/FSF-2020/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) -- cgit From e4de3f4275bf5684fc14873730bfb050b4cf7d17 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:55:58 +0530 Subject: Update and rename file1_TangentPlanes.py to file1_Tangent_Plane.py --- .../file1_TangentPlanes.py | 39 ---------------- .../file1_Tangent_Plane.py | 52 ++++++++++++++++++++++ 2 files changed, 52 insertions(+), 39 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py deleted file mode 100644 index 8e3a19e..0000000 --- a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py +++ /dev/null @@ -1,39 +0,0 @@ -from manimlib.imports import* - -class TangenttoSurface(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - #parabola: -x**2-y**2 - p = 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_C,TEAL_D], - resolution=(20, 20)).scale(1).shift(1*RIGHT+2*UP) - self.set_camera_orientation(phi = 35 * DEGREES,theta = -40 * DEGREES ) - - r = Rectangle(side_length=2,side_breadth= 1, fill_color=PURPLE, fill_opacity=0.2).shift(ORIGIN-1+3*UP+2*RIGHT).scale(0.7) #---tangent plane along x axis - - r_text = TextMobject("Tangent Plane along $x$ axis",color = '#FFE4E1').scale(0.6).to_corner(UL) - r2_text = TextMobject("Tangent Plane along $y$ axis",color = '#FFE4E1').scale(0.6).to_corner(UL) - - a = Arrow(color = '#FFFFF0').shift(ORIGIN-1+3*UP+4*RIGHT).scale(0.5) - a2 = Arrow(color = '#FFFFF0').shift(ORIGIN+0.5+3*UP+RIGHT).scale(0.5) - a2.rotate(1.571) #----1.571 radian = 90 degrees - - self.add(axes) - self.play(Write(p)) - self.begin_ambient_camera_rotation(rate = 0.1) - self.add_fixed_in_frame_mobjects(r_text) - self.play(ShowCreation(r)) - self.play(ShowCreation(a)) - self.wait(1) - self.play(FadeOut(r),FadeOut(a),FadeOut(r_text)) - - r.rotate(1.571) #---tangent plane along y axis - self.play(ShowCreation(r)) - self.play(ShowCreation(a2)) - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py new file mode 100644 index 0000000..3632d7e --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py @@ -0,0 +1,52 @@ +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) + + -- cgit From e59375a9f91c17376c690fd59f86cfe0490018d0 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:56:17 +0530 Subject: Update file1_Tangent_Plane.py --- .../Tangent-Plane-Approximations/file1_Tangent_Plane.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py index 3632d7e..4c17f90 100644 --- a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py @@ -48,5 +48,3 @@ class firstScene(ThreeDScene): self.wait(2) self.play(ReplacementTransform(f,s),ReplacementTransform(d,d2),ReplacementTransform(r,r2)) self.wait(2) - - -- cgit From 6a369492d9bfceb37b27856c082d218f50dbcb87 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:56:37 +0530 Subject: Delete file1_TangentPlanes.mp4 --- .../file1_TangentPlanes.mp4 | Bin 1483459 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 deleted file mode 100644 index 6a3ba6d..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 and /dev/null differ -- cgit From 4d945dced9720f944215a39d10f78206334f2f61 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:57:12 +0530 Subject: Delete file2_Tangent_plane_approximation_visualization.mp4 --- ...file2_Tangent_plane_approximation_visualization.mp4 | Bin 336179 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 deleted file mode 100644 index bc3448b..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 and /dev/null differ -- cgit From dd56199fd1aa1e1dc74d7d05280093cc5f5e66b9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:57:23 +0530 Subject: Delete file3_non_differentiable_function.mp4 --- .../file3_non_differentiable_function.mp4 | Bin 424364 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 deleted file mode 100644 index 7417a87..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 and /dev/null differ -- cgit From e37b2e1ad48269d1fa32c402dbf85331b6490376 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:57:34 +0530 Subject: Delete file4_Tangent plane_at_critical_points.mp4 --- .../file4_Tangent plane_at_critical_points.mp4 | Bin 3101810 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 deleted file mode 100644 index 2c64f38..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 and /dev/null differ -- cgit From ada683cd4827f2b996998a10ed5c967b7945d530 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:58:34 +0530 Subject: Add files via upload --- .../file1_Tangent_Plane.gif | Bin 0 -> 827096 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif new file mode 100644 index 0000000..2b8bf5f Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif differ -- cgit From 581ad7f906e4b9a13d5fe963229d458f0abff7f2 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:07:11 +0530 Subject: Update file2_Tangent_plane_approximation_visualization.py --- ...e2_Tangent_plane_approximation_visualization.py | 90 ++++++++++++++++------ 1 file changed, 65 insertions(+), 25 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py index 984db16..d1ecf8c 100644 --- a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py @@ -1,34 +1,74 @@ from manimlib.imports import* -class TangenttoSurface(ThreeDScene): - +#---- tangent plane is parallel to the x-y plane +class MaximaScene(ThreeDScene): def construct(self): - axes = ThreeDAxes() - - #----f(x,y): x**2+y**2 - p = ParametricSurface( + + 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([ - u, - v, - u**2+v**2 - ]),v_min = -1,v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_C,GREEN_D], - resolution = (20, 20)).scale(1) - self.set_camera_orientation(phi = 75*DEGREES) + 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]) - h_text = TextMobject("The graph tends to coincide with its tangent plane").scale(0.5).to_corner(UL) - d = Dot([0,0,0],color ='#800000') #----critical point - r = Rectangle(height = 2,breadth = 1,color = YELLOW).scale(0.5) #----tangent plane to critical point - line1 = DashedLine(color=RED).shift(4*UP+1.3*RIGHT).rotate(1.571,UP).scale(1.2) - line2 = DashedLine(color=RED).shift(4*UP-1.3*RIGHT).rotate(1.571,UP).scale(1.2) + 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) - r2 = Rectangle(height = 2, breadth = 1,color = GREEN, fill_opacity=0.3).scale(0.5) + 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) - self.add(axes) - self.play(Write(r)) - self.play(Write(p),Write(d)) - self.play(ShowCreation(line1),ShowCreation(line2)) - self.wait(2) + 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]) - self.play(FadeOut(line1),FadeOut(line2),ReplacementTransform(p,r2)) - self.add_fixed_in_frame_mobjects(h_text) + #---- 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) -- cgit From 56ab459970db5ee7d05f3f30cdbd750f64f1800b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:47:27 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py | 29 ---------------------- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py | 29 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py deleted file mode 100644 index 41c3b61..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py +++ /dev/null @@ -1,29 +0,0 @@ -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/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) -- cgit From 91f4e736577c6a4bf1f17b5eded2942905a0573d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:49:41 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py --- .../file4_Types_of_critical_points.py | 134 --------------------- .../file4_Types_of_critical_points.py | 134 +++++++++++++++++++++ 2 files changed, 134 insertions(+), 134 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py deleted file mode 100644 index 656fb68..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py +++ /dev/null @@ -1,134 +0,0 @@ -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/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) -- cgit From 9c6d394101ad89681ef497cd0667fa23e6f3d168 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:50:58 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py --- ...file3_Tangent_plane_at_extrema_of_a_function.py | 73 ---------------------- ...file3_Tangent_plane_at_extrema_of_a_function.py | 73 ++++++++++++++++++++++ 2 files changed, 73 insertions(+), 73 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py deleted file mode 100644 index e674113..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py +++ /dev/null @@ -1,73 +0,0 @@ -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/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) -- cgit From a79446a128f65df2de58229ee5b48a12fe29cdd4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:51:58 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py --- .../Critical-Points/file2_Traces_and_Tangent.py | 88 ---------------------- .../Critical-Points/file2_Traces_and_Tangent.py | 88 ++++++++++++++++++++++ 2 files changed, 88 insertions(+), 88 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py deleted file mode 100644 index 4b020e1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py +++ /dev/null @@ -1,88 +0,0 @@ -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/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) -- cgit From 9977b22482702c409517e391ba380f59c5cd557c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:53:16 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py --- .../file1_Critical_Point_of_a_function.py | 77 ---------------------- .../file1_Critical_Point_of_a_function.py | 77 ++++++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py deleted file mode 100644 index e8cb08d..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py +++ /dev/null @@ -1,77 +0,0 @@ -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/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) -- cgit From b94975950b6d53d171cb15123a65c4d4abad75b4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:54:27 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Critical-Points/README.md to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/README.md --- .../Critical-Points/README.md | 32 ---------------------- .../Critical-Points/README.md | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/README.md create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md deleted file mode 100644 index f0747bb..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ /dev/null @@ -1,32 +0,0 @@ -

SubTopic: Critical Points

-

- -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/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) -

-

- -file2_Traces_and_Tangent - -![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) -

-

- -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/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) -

-

- -file4_Types_of_critical_points - -![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) -

-

- -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/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) -

-

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..f0747bb --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/README.md @@ -0,0 +1,32 @@ +

SubTopic: Critical Points

+

+ +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/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +

+

+ +file2_Traces_and_Tangent + +![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) +

+

+ +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/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) +

+

+ +file4_Types_of_critical_points + +![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) +

+

+ +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/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) +

+

-- cgit From 31c5564ddab507edd28994ba8555d61d97cb7eb6 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:55:06 +0530 Subject: Delete file1_Critical_Point_of_a_function.gif --- .../file1_Critical_Point_of_a_function.gif | Bin 8077401 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif deleted file mode 100644 index ca3989c..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif and /dev/null differ -- cgit From 9c4808b4f8c21cf24d92c7b8c9510c8481b06208 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:55:16 +0530 Subject: Delete file2_Traces_and_Tangent.gif --- .../Critical-Points/file2_Traces_and_Tangent.gif | Bin 2552938 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif deleted file mode 100644 index 84acf2e..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif and /dev/null differ -- cgit From 855549cea94aa8d2ab141ec66c318bb84f80c82d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:55:24 +0530 Subject: Delete file3_Tangent_plane_at_extrema_of_a_function.gif --- .../file3_Tangent_plane_at_extrema_of_a_function.gif | Bin 2198637 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif deleted file mode 100644 index 14fb318..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif and /dev/null differ -- cgit From 91d5940494b278eabec2a86a9f95b4c735423d6a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:55:32 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 3864765 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif deleted file mode 100644 index 91e7084..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From efcd9e6b2bc7865523cf428827829d0430450a3a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:55:43 +0530 Subject: Delete file5_f(x,y)=(y-x)(1-2x-3y).gif --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif | Bin 1522415 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif deleted file mode 100644 index 4bc92f8..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif and /dev/null differ -- cgit From 6c1c19388c3c24c5a0b91ac82272e015a004484c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:56:35 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py --- .../file1_Second_order_partial_derivatives.py | 78 ---------------------- .../file1_Second_order_partial_derivatives.py | 78 ++++++++++++++++++++++ 2 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py deleted file mode 100644 index 84052cc..0000000 --- a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py +++ /dev/null @@ -1,78 +0,0 @@ -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/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) -- cgit From 9f8a0bc5d0ccec1a1260d7922e5fdc6c44d1f3e5 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:57:43 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py --- .../file2_Degenerate_Hessian_Matrix.py | 52 ---------------------- .../file2_Degenerate_Hessian_Matrix.py | 52 ++++++++++++++++++++++ 2 files changed, 52 insertions(+), 52 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py deleted file mode 100644 index c1e3516..0000000 --- a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py +++ /dev/null @@ -1,52 +0,0 @@ -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/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) -- cgit From 622bc30da5bb6691861b8ef27d4b95f4d125cdf4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:58:37 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py --- .../file3_Nondegenerate_Hessian_Matrix.py | 145 --------------------- .../file3_Nondegenerate_Hessian_Matrix.py | 145 +++++++++++++++++++++ 2 files changed, 145 insertions(+), 145 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py deleted file mode 100644 index 3056842..0000000 --- a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py +++ /dev/null @@ -1,145 +0,0 @@ -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/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) -- cgit From 3bd06348ce843694c7af3883da101bfdb89a09f5 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:59:24 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py --- .../file4_Contour_Diagram.py | 120 --------------------- .../file4_Contour_Diagram.py | 120 +++++++++++++++++++++ 2 files changed, 120 insertions(+), 120 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py deleted file mode 100644 index d3084e2..0000000 --- a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py +++ /dev/null @@ -1,120 +0,0 @@ -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/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) -- cgit From 064d4eb84b2389d1cea5b1bac0cdd5c5f6fc2d0d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 04:59:54 +0530 Subject: Delete file1_Second_order_partial_derivatives.gif --- .../file1_Second_order_partial_derivatives.gif | Bin 3166332 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif deleted file mode 100644 index 3471e4d..0000000 Binary files a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif and /dev/null differ -- cgit From cf4ac5da5fd0cd1322bcdbd5ef8e2d641fc8bdf4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:00:04 +0530 Subject: Delete file4_Contour_Diagram.gif --- .../file4_Contour_Diagram.gif | Bin 1150777 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif deleted file mode 100644 index 129fedc..0000000 Binary files a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif and /dev/null differ -- cgit From f61bef8de2ee952f3dbb73fd148024931426e427 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:01:05 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py --- .../file1_Tangent_Plane.py | 50 ---------------------- .../file1_Tangent_Plane.py | 50 ++++++++++++++++++++++ 2 files changed, 50 insertions(+), 50 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py deleted file mode 100644 index 4c17f90..0000000 --- a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py +++ /dev/null @@ -1,50 +0,0 @@ -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/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) -- cgit From 38fc15ed3749f7bf9140a45e7c5f210b3d4fc3c5 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:01:53 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py --- ...e2_Tangent_plane_approximation_visualization.py | 74 ---------------------- ...e2_Tangent_plane_approximation_visualization.py | 74 ++++++++++++++++++++++ 2 files changed, 74 insertions(+), 74 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py deleted file mode 100644 index d1ecf8c..0000000 --- a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py +++ /dev/null @@ -1,74 +0,0 @@ -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/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) -- cgit From 1cd25dcc113d8834a50ca29fbc16b8fe97529056 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:02:47 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py --- .../file3_non_differentiable_function.py | 30 ---------------------- .../file3_non_differentiable_function.py | 30 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py deleted file mode 100644 index 13bd73e..0000000 --- a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py +++ /dev/null @@ -1,30 +0,0 @@ -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() - - #----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) - - self.set_camera_orientation(phi = 75 * DEGREES) - - d = Dot([0,0,0],color = '#800000') #----critical point - d_text = TextMobject("$(0,0)$").scale(0.5).shift(0.2*DOWN) - f_text = TextMobject("$f$ is not differentiable at origin").scale(0.5).to_corner(UL) - - self.begin_ambient_camera_rotation(rate=0.1) - self.add(axes) - self.play(Write(p),Write(d)) - self.add_fixed_in_frame_mobjects(d_text) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) 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..13bd73e --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py @@ -0,0 +1,30 @@ +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() + + #----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) + + self.set_camera_orientation(phi = 75 * DEGREES) + + d = Dot([0,0,0],color = '#800000') #----critical point + d_text = TextMobject("$(0,0)$").scale(0.5).shift(0.2*DOWN) + f_text = TextMobject("$f$ is not differentiable at origin").scale(0.5).to_corner(UL) + + self.begin_ambient_camera_rotation(rate=0.1) + self.add(axes) + self.play(Write(p),Write(d)) + self.add_fixed_in_frame_mobjects(d_text) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) -- cgit From a8a11ea17285b594f0017a6e7f86a43679312730 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:03:34 +0530 Subject: Rename FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py --- .../file4_Tangent plane_at_critical_points.py | 62 ---------------------- .../file4_Tangent plane_at_critical_points.py | 62 ++++++++++++++++++++++ 2 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py deleted file mode 100644 index d129213..0000000 --- a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py +++ /dev/null @@ -1,62 +0,0 @@ -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/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.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_critical_points.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) -- cgit From 1dffda2a1214985a21c83ad782f26d3640649f8c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:03:57 +0530 Subject: Delete file1_Tangent_Plane.gif --- .../file1_Tangent_Plane.gif | Bin 827096 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif deleted file mode 100644 index 2b8bf5f..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif and /dev/null differ -- cgit From 6cb42c9f196cdc4c29671a4d5dbccaf1ebcc780e Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:10:35 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 8077401 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..ca3989c Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From dea86496011a0c1e907f04a0c998f67a120a95b6 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:11:15 +0530 Subject: Add files via upload --- .../Critical-Points/file2_Traces_and_Tangent.gif | Bin 0 -> 2552938 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..84acf2e Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif differ -- cgit From b902d20de6d51e29dddaaf8b7f2623f22ac2ef05 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:12:08 +0530 Subject: Add files via upload --- .../file3_Tangent_plane_at_extrema_of_a_function.gif | Bin 0 -> 2198637 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..14fb318 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif differ -- cgit From 0ce6295d88d64bca989c79d6f92e2c12f8c02bc3 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:12:50 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 3864765 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..91e7084 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From 23d5769f486b79619bbef9da101fd08e299d59fe Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:13:41 +0530 Subject: Add files via upload --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif | Bin 0 -> 1522415 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..4bc92f8 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif differ -- cgit From f2e7374ca9dcb5803490067da9cd937de2acc838 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:15:06 +0530 Subject: Update README.md --- .../approximations-and-optimizations/Critical-Points/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'FSF-2020') 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 index f0747bb..5bd9cc5 100644 --- 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 @@ -3,30 +3,30 @@ 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/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +![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)



file2_Traces_and_Tangent -![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) +![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)



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/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) +![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)



file4_Types_of_critical_points -![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) +![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)



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/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) +![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)



-- cgit From 122266d4f63a332fae6874f0ee4f374d63fe74a0 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:16:38 +0530 Subject: Add files via upload --- .../file1_Tangent_Plane.gif | Bin 0 -> 827096 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..2b8bf5f Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif differ -- cgit From 4bf7207eae112e03423d463b8f2ae179ef64fdf7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:17:53 +0530 Subject: Add files via upload --- ...file2_Tangent_plane_approximation_visualization.gif | Bin 0 -> 946542 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..d23405d Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.gif differ -- cgit From dc445ffca6bb7d90bb067ef43af3b69933e05210 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:21:15 +0530 Subject: Update and rename file3_non_differentiable_function.py to file3_Non_Differentiable_Function.py --- .../file3_Non_Differentiable_Function.py | 47 ++++++++++++++++++++++ .../file3_non_differentiable_function.py | 30 -------------- 2 files changed, 47 insertions(+), 30 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_Non_Differentiable_Function.py delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py (limited to 'FSF-2020') 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/file3_non_differentiable_function.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py deleted file mode 100644 index 13bd73e..0000000 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py +++ /dev/null @@ -1,30 +0,0 @@ -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() - - #----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) - - self.set_camera_orientation(phi = 75 * DEGREES) - - d = Dot([0,0,0],color = '#800000') #----critical point - d_text = TextMobject("$(0,0)$").scale(0.5).shift(0.2*DOWN) - f_text = TextMobject("$f$ is not differentiable at origin").scale(0.5).to_corner(UL) - - self.begin_ambient_camera_rotation(rate=0.1) - self.add(axes) - self.play(Write(p),Write(d)) - self.add_fixed_in_frame_mobjects(d_text) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) -- cgit From 56c7beddac5a11140e75713d8ea6227180f5b6b5 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:22:00 +0530 Subject: Add files via upload --- .../file3_Non_Differentiable_Function.gif | Bin 0 -> 708466 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_Non_Differentiable_Function.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..7581a33 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file3_Non_Differentiable_Function.gif differ -- cgit From 6ee18b418db6a504346f247df3acb15fdc40fb71 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 05:23:45 +0530 Subject: Rename file4_Tangent plane_at_critical_points.py to file4_Tangent_plane_at_extrema_and_saddle_point.py --- .../file4_Tangent plane_at_critical_points.py | 62 ---------------------- ...e4_Tangent_plane_at_extrema_and_saddle_point.py | 62 ++++++++++++++++++++++ 2 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent_plane_at_extrema_and_saddle_point.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py deleted file mode 100644 index d129213..0000000 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py +++ /dev/null @@ -1,62 +0,0 @@ -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/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) -- cgit From 7ac13a747b847c10aefab6a3d440e8b21ae3d98a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 06:57:29 +0530 Subject: Add files via upload --- .../file1_Second_order_partial_derivatives.gif | Bin 0 -> 3166332 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..3471e4d Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif differ -- cgit From 0d176c3c509a0438b0a11c6e50c71cbc9b146007 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 06:58:33 +0530 Subject: Add files via upload --- .../file4_Contour_Diagram.gif | Bin 0 -> 1150777 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..129fedc Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif differ -- cgit From 336667599163bc51997ba45ff4bf7f793bb60573 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:02:18 +0530 Subject: Add files via upload --- ...ile4_Tangent plane_at_extrema_and_saddle_point.gif | Bin 0 -> 2513197 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_extrema_and_saddle_point.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..cfe054b Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_extrema_and_saddle_point.gif differ -- cgit From 697d32d369da41e60dfe9a00a25b72192357a251 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:07:33 +0530 Subject: Add files via upload --- .../file2_Degenerate_Hessian_Matrix.gif | Bin 0 -> 3202838 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..d49cdd5 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.gif differ -- cgit From 6c53bdbff8ed1cd0541c9ce4a1de9ecda09c1bb0 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:16:10 +0530 Subject: Create file1_Visualization_of_dz.py --- .../file1_Visualization_of_dz.py | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.py (limited to 'FSF-2020') 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) -- cgit From 375032b863947e3eb39c805ce1e79d12fad98141 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:16:33 +0530 Subject: Add files via upload --- .../file3_Nondegenerate_Hessian_Matrix.gif | Bin 0 -> 8724439 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..2b0acb3 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.gif differ -- cgit From 2c72a6e97be61b9f6f8230951b90918ef654c695 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:18:42 +0530 Subject: Create file2_Differentials.py --- .../Total-Differential/file2_Differentials.py | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.py (limited to 'FSF-2020') 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) -- cgit From 382ba54a0a80bc2e60187f94b225e2d9deef5cb9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:20:16 +0530 Subject: Create file3_Total_differential_of_z.py --- .../file3_Total_differential_of_z.py | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.py (limited to 'FSF-2020') 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) + -- cgit From a423cd75c192f771764e95da3ec562dd06bb1779 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:22:16 +0530 Subject: Create file4_total_differential_change.py --- .../file4_total_differential_change.py | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.py (limited to 'FSF-2020') 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) + + + + + + -- cgit From 2100c05f63318542f26cbbe7fb3786635504be32 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:24:17 +0530 Subject: Create file5_Total_differential_approximation.py --- .../file5_Total_differential_approximation.py | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.py (limited to 'FSF-2020') 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) -- cgit From d48776b46313ba46965c7414600536b48e846a6d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:27:33 +0530 Subject: Add files via upload --- .../Total-Differential/file1_Visualization_of_dz.gif | Bin 0 -> 558983 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..e00a946 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif differ -- cgit From 2a0e8cc2544adf192218b58b153d7569a34e7a5b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:29:52 +0530 Subject: Add files via upload --- .../Total-Differential/file2_Differentials.gif | Bin 0 -> 576535 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..620b49e Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif differ -- cgit From afda4b2757055fcba6c036f44dd4dae08b9e8370 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:31:46 +0530 Subject: Add files via upload --- .../file3_Total_differential_of_z.gif | Bin 0 -> 732678 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..5aae2a1 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif differ -- cgit From c9ab65f4fcda26f2be6dd60628e072f544e894c6 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:33:18 +0530 Subject: Add files via upload --- .../file4_total_differential_change.gif | Bin 0 -> 300675 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..f2227a8 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.gif differ -- cgit From 988fbb80727496b4839dfe5c7036bff1d848eff2 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 07:34:42 +0530 Subject: Add files via upload --- .../file5_Total_differential_approximation.gif | Bin 0 -> 423652 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..4f4627d Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif differ -- cgit From 2c882380322e86d894bb1c36e7aac00839f205ae Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 08:15:49 +0530 Subject: Create file1_Extrema_over_g(x,y)=k.py --- .../file1_Extrema_over_g(x,y)=k.py | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py (limited to 'FSF-2020') 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) + + -- cgit From e21e7a8b9ad0c4ee941be780252e01f1cf0fe4dc Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 08:17:08 +0530 Subject: Create file2_Geometric_Proof.py --- .../Lagrange-Multipliers/file2_Geometric_Proof.py | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.py (limited to 'FSF-2020') 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) -- cgit From 3c5b714525c48f088bda1371cea7257ac7fb6e72 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 08:18:20 +0530 Subject: Create file3_Optimizing_function_w.r.t_one_constraint.py --- ...le3_Optimizing_function_w.r.t_one_constraint.py | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.py (limited to 'FSF-2020') 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) -- cgit From 5daed5a560b208dab38019f1f1e0be359e18c93e Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 08:20:21 +0530 Subject: Add files via upload --- .../file1_Extrema_over_g(x,y)=k.gif | Bin 0 -> 499796 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..1e1782e Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.gif differ -- cgit From ab7570549a8ad1c2b654c3590265c5518ce2ed57 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 08:21:58 +0530 Subject: Add files via upload --- .../Lagrange-Multipliers/file2_Geometric_Proof.gif | Bin 0 -> 419262 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..b22afb3 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.gif differ -- cgit From c50ab89a445f3748b96eb99904484a08edf19390 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 08:23:21 +0530 Subject: Add files via upload --- ...file3_Optimizing_function_w.r.t_one_constraint.gif | Bin 0 -> 2177236 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..9602283 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.gif differ -- cgit From b2542c71573f8bae8f7c82b3f38fc550dadb2af6 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 09:36:29 +0530 Subject: Update README.md --- .../geometry-of-planes-and-curves/arc-length-and-curvature/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md index f5313c9..a2a86e6 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md @@ -1,4 +1,4 @@ -**file1_simple_visualization.py** +**file1_simple_visualization.py**
![file1_simple_visualization.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file1_simple_visualization.gif) **file2_circle_curvature.py**
@@ -7,5 +7,5 @@ **file3_curvature_intuition.gif**
![file3_curvature_intuition.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file3_curvature_intuition.gif) -**file4_different_curvature_single_curve.py** +**file4_different_curvature_single_curve.py**
![file4_different_curvature_single_curve.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.gif) -- cgit From 7a7bab3efc3a4c8d02905466b686be050b536c87 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 09:44:47 +0530 Subject: Update README.md --- .../geometry-of-planes-and-curves/space-curves/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md index 18516b7..42f5df1 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/README.md @@ -1,7 +1,7 @@ -**file1_parametric_ellipse.py** +**file1_parametric_ellipse.py**
![file1_parametric_ellipse.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file1_parametric_ellipse.gif) -**file2_parametric_helix.py** +**file2_parametric_helix.py**
![file2_parametric_helix.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/space-curves/file2_parametric_helix.gif) **file3_circletosphere.py**
-- cgit From d01408565b129dc85ef36d0448302ca612221ab6 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 10:19:41 +0530 Subject: Update README.md --- .../general-parametric-curves/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/README.md index be358ac..8a47a0e 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/README.md @@ -1,11 +1,11 @@ -**file1_parametric_circle..py** +**file1_parametric_circle..py**
![file1_parametric_circle.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file1_parametric_circle.gif) -**file2_cycloid_manim.py** +**file2_cycloid_manim.py**
![file2_cycloid_manim.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file2_cycloid_manim.gif) -**file3_brachistochrone.py** +**file3_brachistochrone.py**
![file3_brachistochrone.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file3_brachistochrone.gif) -**file4_helix_visualization.py** +**file4_helix_visualization.py**
![file4_helix_visualization.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/general-parametric-curves/file4_helix_visualization.gif) -- cgit From 6e1fd99eaf81433196d4f33018307a684b53d304 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 10:20:58 +0530 Subject: Update README.md --- .../velocity-and-differentiability/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md index 8092cf7..b08375b 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md @@ -1,5 +1,5 @@ -**file1_smooth_curves.gif** +**file1_smooth_curves.gif**
![file1_smooth_curves.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file1_smooth_curves.gif) -**file2_tangent_space_curve.py** +**file2_tangent_space_curve.py**
![file2_tangent_space_curve.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.gif) -- cgit From 3e6832a776041727478a6928ad41100b21794c23 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 10:51:43 +0530 Subject: Create README.md --- .../tnb-frame-and-serret-frenet-formulae/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md new file mode 100644 index 0000000..fe09907 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md @@ -0,0 +1,5 @@ +**file1_prescribed_plane.gif**
+![file1_prescribed_plane.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file1_prescribed_plane.gif) + +**file2_TNB_frame.gif**
+![file2_TNB_frame.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif) -- cgit From d8de81420dd15a86e1e45fe937e3bf3d75c065b3 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 10:54:57 +0530 Subject: Update README.md --- .../equations-of-planes-and-lines/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md index d6b89ef..29d2f6a 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/README.md @@ -1,14 +1,14 @@ **file1_line_eqn.py**
![file1_line_eqn.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file1_line_eqn.gif) -**file2_point_normal_form_plane.py** +**file2_point_normal_form_plane.py**
![file2_point_normal_form_plane.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file2_point_normal_form_plane.gif) -**file3_intercept_form_plane.py** +**file3_intercept_form_plane.py**
![file3_intercept_form_plane.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file3_intercept_form_plane.gif) -**file4_3d_plane.py** +**file4_3d_plane.py**
![file4_3d_plane.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file4_3d_plane.gif) -**file5_vector_form_line.py** +**file5_vector_form_line.py**
![file5_vector_form_line.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/equations-of-planes-and-lines/file5_vector_form_line.gif) -- cgit From 950344546229095d1c2019e1305e682959b9fafd Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 13:11:09 +0530 Subject: Update README.md --- .../geometry-of-planes-and-curves/arc-length-and-curvature/README.md | 3 --- 1 file changed, 3 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md index a2a86e6..a2f71d7 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/README.md @@ -4,8 +4,5 @@ **file2_circle_curvature.py**
![file2_circle_curvature.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file2_circle_curvature.gif) -**file3_curvature_intuition.gif**
-![file3_curvature_intuition.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file3_curvature_intuition.gif) - **file4_different_curvature_single_curve.py**
![file4_different_curvature_single_curve.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/arc-length-and-curvature/file4_different_curvature_single_curve.gif) -- cgit From 28cb4d37575ed5a4dd3630e21f72431101075991 Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 13:12:07 +0530 Subject: Delete README.md --- .../tnb-frame-and-serret-frenet-formulae/README.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md deleted file mode 100644 index fe09907..0000000 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md +++ /dev/null @@ -1,5 +0,0 @@ -**file1_prescribed_plane.gif**
-![file1_prescribed_plane.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file1_prescribed_plane.gif) - -**file2_TNB_frame.gif**
-![file2_TNB_frame.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif) -- cgit From 6725b1f2f29dd2165364856905b31d83aa8daeab Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Wed, 24 Jun 2020 13:12:26 +0530 Subject: Update README.md --- .../velocity-and-differentiability/README.md | 3 --- 1 file changed, 3 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md index b08375b..bc571c6 100644 --- a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/README.md @@ -1,5 +1,2 @@ -**file1_smooth_curves.gif**
-![file1_smooth_curves.gif](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file1_smooth_curves.gif) - **file2_tangent_space_curve.py**
![file2_tangent_space_curve.py](https://raw.githubusercontent.com/saarthdeshpande/FSF-mathematics-python-code-archive/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/velocity-and-differentiability/file2_tangent_space_curve.gif) -- cgit From 69c003a243ea5f36e52e8010c4fa63fef7d7bbb4 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Wed, 24 Jun 2020 13:23:04 +0530 Subject: Create file4_surface.py --- .../surface-integrals/file4_surface.py | 237 +++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_surface.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_surface.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_surface.py new file mode 100644 index 0000000..3c2e145 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_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######### + + -- cgit From bd51f25304cd0305a20f448db306deb03cf1093c Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Wed, 24 Jun 2020 13:23:36 +0530 Subject: Rename file4_surface.py to file5_surface.py --- .../surface-integrals/file4_surface.py | 237 --------------------- .../surface-integrals/file5_surface.py | 237 +++++++++++++++++++++ 2 files changed, 237 insertions(+), 237 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_surface.py create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file5_surface.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_surface.py b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_surface.py deleted file mode 100644 index 3c2e145..0000000 --- a/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file4_surface.py +++ /dev/null @@ -1,237 +0,0 @@ -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/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######### + + -- cgit From a865350d4775d430765d60cdaef021374c1435aa Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Wed, 24 Jun 2020 13:31:40 +0530 Subject: Add files via upload --- .../surface-integrals/file5_surface.gif | Bin 0 -> 7241572 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file5_surface.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..27dcac8 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file5_surface.gif differ -- cgit From b5f5577b9a5fadd92febd2e9ead886469be4b0af Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Wed, 24 Jun 2020 13:33:20 +0530 Subject: Update README.md --- .../triple-and-surface-integrals/surface-integrals/README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'FSF-2020') 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 a4a1c84..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 @@ -6,3 +6,5 @@ ![file3_cube_sideC](sideC.gif) **file4_pauseandponder.py** ![file4_pauseandponder](pauseandponder.gif) +**file5_surface.py** +![file5_surface](file5_surface.gif) -- cgit From ebfe7a6656b240aacffc4c92e873d4f3fed79971 Mon Sep 17 00:00:00 2001 From: vishal786-commits Date: Wed, 24 Jun 2020 13:36:10 +0530 Subject: Update file4_cube_surface.py --- .../flux/file4_cube_surface.py | 195 +++++++++++++++++++-- 1 file changed, 176 insertions(+), 19 deletions(-) (limited to 'FSF-2020') 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() + -- cgit From 82b3f04bc10d746282a618458797486e2096a28c Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Thu, 25 Jun 2020 03:06:20 +0530 Subject: tnb --- .../file2_TNB_frame.gif | Bin 150050 -> 0 bytes .../file2_tnb_frame.gif | Bin 0 -> 150050 bytes .../file2_tnb_frame_manim.gif | Bin 0 -> 837251 bytes .../file2_tnb_frame_manim.py | 125 +++++++++++++++++++++ 4 files changed, 125 insertions(+) delete mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame_manim.gif create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame_manim.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif deleted file mode 100644 index 097652f..0000000 Binary files a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_TNB_frame.gif and /dev/null differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame.gif new file mode 100644 index 0000000..097652f Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame_manim.gif b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame_manim.gif new file mode 100644 index 0000000..784b6a6 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame_manim.gif differ diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame_manim.py b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame_manim.py new file mode 100644 index 0000000..ee5e717 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame_manim.py @@ -0,0 +1,125 @@ +from manimlib.imports import * + +class tnb(ThreeDScene): + def construct(self): + self.set_camera_orientation(phi = 75*DEGREES, theta=45*DEGREES) + + t = TextMobject(r'T', color = YELLOW) + n = TextMobject(r'N', color = BLUE).next_to(t, RIGHT, buff=0) + b = TextMobject(r'B', color = GREEN_E).next_to(n, RIGHT, buff=0) + frame = TextMobject(r'Frame').next_to(b, RIGHT, buff=0.2) + + text = VGroup(*[t,n,b,frame]).move_to(ORIGIN).shift(3*UP) + + helix1 = ParametricFunction( + lambda t: np.array([ + np.cos(TAU*t), + np.sin(TAU*t), + 0.4*t + ]), t_min = -2*np.pi/3, t_max = -1.638*np.pi/3, color = WHITE + ) + + helix2 = ParametricFunction( + lambda t: np.array([ + np.cos(TAU*t), + np.sin(TAU*t), + 0.4*t + ]), t_min = -1.638*np.pi/3, t_max = -1.33*np.pi/3, color = WHITE + ) + + helix3 = ParametricFunction( + lambda t: np.array([ + np.cos(TAU*t), + np.sin(TAU*t), + 0.4*t + ]), t_min = -1.33*np.pi/3, t_max = -np.pi/3, color = WHITE + ) + + helix4 = ParametricFunction( + lambda t: np.array([ + np.cos(TAU*t), + np.sin(TAU*t), + 0.4*t + ]), t_min = -np.pi/3, t_max = -1.3*np.pi/6, color = WHITE + ) + + helix5 = ParametricFunction( + lambda t: np.array([ + np.cos(TAU*t), + np.sin(TAU*t), + 0.4*t + ]), t_min = -1.3*np.pi/6, t_max = 0, color = WHITE + ) + + helix_dot = Dot(radius = 0.16, color = RED) + + dot0 = Dot(np.array([np.cos(-2*np.pi/3), np.sin(-2*np.pi/3), -0.8*np.pi/3]), radius = 0.16, color=RED).shift(np.array([4.65,0,-0.8])) + tgt0 = Arrow((0,0,0), (1,2,0), color = YELLOW).shift(dot0.get_center() - np.array([0.04,0.2,0])) + nm0 = Arrow((0,0,0), (-2,1,0), color = BLUE).shift(dot0.get_center() + np.array([0.3,0,0])) + bnm0 = Arrow((0,0,0), (0,2,0), color = GREEN_E).shift(6.1*LEFT + 3*DOWN) + plane0 = Square(color = DARK_BROWN, fill_color = WHITE, fill_opacity=0.3).shift(dot0.get_center() + np.array([-0.35, 0.85, 0])).scale(1.2).rotate(65*DEGREES) + point0 = VGroup(*[dot0, tgt0, nm0, bnm0, plane0]).scale(0.8).shift(np.array([1,0,0])) + + dot1 = Dot(np.array([np.cos(-np.pi/3), np.sin(-np.pi/3), -0.4*np.pi/3]) + np.array([0,0.2,0]), radius = 0.16, color=RED) + tgt1 = Arrow((0,0,0), (-2,-0.55,0), color = YELLOW).shift(dot1.get_center() + np.array([0.18,0.04,0])) + nm1 = Arrow((0,0,0), (0.4,-2,0), color = BLUE).shift(dot1.get_center() + np.array([0,0.26,0])) + bnm1 = Arrow((0,0,0), (0,2,0), color=GREEN_E).shift(3.68*RIGHT+2.48*DOWN) + plane1 = Square(color = DARK_BROWN, fill_color = WHITE, fill_opacity=0.3).shift(dot1.get_center() + np.array([-0.4, -0.6, 0])).rotate(13*DEGREES).scale(1.2) + point1 = VGroup(*[dot1, tgt1, nm1, plane1]).scale(0.8).shift(np.array([1,6.25,0])) + + dot2 = Dot(np.array([np.cos(-np.pi/6), np.sin(-np.pi/6), -0.2*np.pi/3]) - np.array([1.9,0,0]), radius=0.16,color=RED) + tgt2 = Arrow((0,0,0), (1,-2,0), color = YELLOW).shift(dot2.get_center() + np.array([-0.2,0.2,0])) + nm2 = Arrow((0,0,0), (2,1,0), color = BLUE).shift(dot2.get_center() + np.array([-0.2,-0.06,0])) + bnm2 = Arrow((0,0,0), (0,2,0), color=GREEN_E).shift(0.4*RIGHT + 0.16*DOWN) + plane2 = Square(color = DARK_BROWN, fill_color = WHITE, fill_opacity=0.3).shift(dot2.get_center() + np.array([0.92, -0.5, 0])).rotate(23*DEGREES).scale(1.2) + point2 = VGroup(*[dot2, tgt2, nm2, bnm2, plane2]) + + helix = VGroup(*[helix1, helix2, helix3, helix4, helix5]) + self.add_fixed_in_frame_mobjects(text) + self.play(FadeIn(helix), FadeIn(text)) + self.play(ApplyMethod(helix.scale, 4)) + self.add_fixed_in_frame_mobjects(bnm0) + self.play(FadeIn(point0), MoveAlongPath(helix_dot, helix1, run_time=5)) + + self.add_fixed_in_frame_mobjects(bnm1) + self.play(ApplyMethod(point0.set_color, GRAY), FadeIn(point1)) + self.play(MoveAlongPath(helix_dot, helix2, run_time = 5)) + + self.add_fixed_in_frame_mobjects(bnm2) + self.play(ApplyMethod(point1.set_color, GRAY), ApplyMethod(bnm1.set_color, GRAY), FadeIn(point2)) + self.play(MoveAlongPath(helix_dot, helix3, run_time=5)) + + dot3 = Dot(np.array([np.cos(-np.pi/3), np.sin(-np.pi/3), -0.4*np.pi/3]) + np.array([3.3,-0.25,0]), radius = 0.16, color=RED) + tgt3 = Arrow((0,0,0), (0,2,0), color = YELLOW).shift(helix_dot.get_center() - np.array([-0.05,0.2,0])) + nm3 = Arrow((0,0,0), (-2,0,0), color = BLUE).shift(helix_dot.get_center() + np.array([0.25,0,0])) + bnm3 = Arrow((0,0,0), (0,2,0), color = GREEN_E).shift(3.87*LEFT + 1.24*DOWN) + plane3 = Square(color = DARK_BROWN, fill_color = WHITE, fill_opacity=0.3).shift(helix_dot.get_center() + np.array([-0.5, 0.62, 0])) + point3 = VGroup(*[dot3, tgt3, nm3, bnm3, plane3]).shift(np.array([0,0,0])) + + dot4 = Dot(np.array([np.cos(-np.pi/12), np.sin(-np.pi/12), -0.1*np.pi/3]) + np.array([-3.4,3.4,0]), radius = 0.16, color=RED) + tgt4 = Arrow((0,0,0), (-2,-0.85,0), color = YELLOW).shift(dot4.get_center() - np.array([-0.05,0,0])) + nm4 = Arrow((0,0,0), (0.8,-2,0), color = BLUE).shift(dot4.get_center() + np.array([-0.1,0.25,0])) + bnm4 = Arrow((0,0,0), (0,2,0), color = GREEN_E).shift(4.03*RIGHT + 0.5*DOWN) + plane4 = Square(color = DARK_BROWN, fill_color = WHITE, fill_opacity=0.3).shift(dot4.get_center() + np.array([-0.4,-1,0])).rotate(22*DEGREES).scale(1.2) + point4 = VGroup(*[dot4, tgt4, nm4, bnm4, plane4]) + + dot5 = Dot((1,0,0) + np.array([2.3,-1,1])) + tgt5 = Arrow((0,0,0), (0,2,0), color = YELLOW).shift(dot5.get_center() - np.array([-0.05,0.2,0])) + nm5 = Arrow((0,0,0), (-2,0,0), color = BLUE).shift(dot5.get_center() + np.array([0.25,0,0])) + bnm5 = Arrow((0,0,0), (0,2,0), color = GREEN_E).shift(3.34*LEFT+0.3*UP) + plane5 = Square(color = DARK_BROWN, fill_color = WHITE, fill_opacity=0.3).shift(dot5.get_center() + np.array([-0.5,0.5,0])) + point5 = VGroup(*[tgt5, nm5, bnm5, plane5]) + + self.add_fixed_in_frame_mobjects(bnm3) + self.play(ApplyMethod(point2.set_color, GRAY), FadeIn(point3)) + self.play(MoveAlongPath(helix_dot, helix4, run_time=5)) + + self.add_fixed_in_frame_mobjects(bnm4) + self.play(ApplyMethod(point3.set_color, GRAY), FadeIn(point4)) + self.play(MoveAlongPath(helix_dot, helix5, run_time=5)) + + self.add_fixed_in_frame_mobjects(bnm5) + self.play(ApplyMethod(point4.set_color, GRAY), FadeIn(point5)) + self.wait(2) + + self.play(FadeOut(VGroup(*[helix, bnm1, point0, point1, point2, point3, point4, point5, helix_dot]))) -- cgit From f97ad581d99f06f62389903c80ffdd6de982363b Mon Sep 17 00:00:00 2001 From: Saarth Deshpande Date: Thu, 25 Jun 2020 03:08:34 +0530 Subject: Create README.md --- .../tnb-frame-and-serret-frenet-formulae/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md new file mode 100644 index 0000000..34885b2 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/README.md @@ -0,0 +1,2 @@ +**file2_tnb_frame_manim.py**
+![file2_tnb_frame_manim.py](https://github.com/saarthdeshpande/FSF-mathematics-python-code-archive/blob/master/FSF-2020/calculus-of-several-variables/geometry-of-planes-and-curves/tnb-frame-and-serret-frenet-formulae/file2_tnb_frame_manim.gif) -- cgit From c6468ed920ee42e9b9b712065ffea02d1a426837 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 03:31:59 +0530 Subject: Rename file5_f(x,y)=(y-x)(1-2x-3y).py to file6_f(x,y)=(y-x)(1-2x-3y).py --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py | 29 ---------------------- .../Critical-Points/file6_f(x,y)=(y-x)(1-2x-3y).py | 29 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file6_f(x,y)=(y-x)(1-2x-3y).py (limited to 'FSF-2020') 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 deleted file mode 100644 index 41c3b61..0000000 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py +++ /dev/null @@ -1,29 +0,0 @@ -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/Critical-Points/file6_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file6_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/file6_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) -- cgit From d26ae780a0b1f66c94ed8ffcf903cd23dc92846d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 03:32:50 +0530 Subject: Delete file5_f(x,y)=(y-x)(1-2x-3y).gif --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif | Bin 1522415 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 4bc92f8..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif and /dev/null differ -- cgit From 46c0d7092a97118b1268595236d74455e92bc550 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 03:35:36 +0530 Subject: Add files via upload --- .../Critical-Points/file6_f(x,y)=(y-x)(1-2x-3y).gif | Bin 0 -> 1522415 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file6_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file6_f(x,y)=(y-x)(1-2x-3y).gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file6_f(x,y)=(y-x)(1-2x-3y).gif new file mode 100644 index 0000000..4bc92f8 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file6_f(x,y)=(y-x)(1-2x-3y).gif differ -- cgit From f1dfbd78a5fea187577cc648f0d251c897a9c907 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 03:36:38 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 3864765 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 91e7084..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From cfba6959b00fab943e6d590a28bd57c24032d71e Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 03:37:33 +0530 Subject: Update and rename file4_Types_of_critical_points.py to file4_Relative_Maxima_and_Relative_Minima.py --- .../file4_Relative_Maxima_and_Relative_Minima.py | 51 ++++++++ .../file4_Types_of_critical_points.py | 134 --------------------- 2 files changed, 51 insertions(+), 134 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.py delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.py new file mode 100644 index 0000000..7999527 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.py @@ -0,0 +1,51 @@ +from manimlib.imports import* +import math as m + +#---- locating extrema of a funtion using critical points +class Extrema(ThreeDScene): + def construct(self): + + h_text = TextMobject("Relative Maxima and Relative Minima",color = GREEN) + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.3,5.5,0]).rotate(-4.5) #---- y axis + + #---- f(x,y) = 5(x+y)e^(-x^2-y^2) + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + 5*(u+v)*m.exp(-u**2-v**2) + ]),u_min = -PI, u_max = PI, v_min = -PI, v_max = PI).set_color(TEAL).shift([0,0,0]).fade(0.4) + + d1 = Dot(color = YELLOW).shift([0.5,0.5,3.02]) #---- critical point for maxima + l1 = Line([0.5,0.5,0.1],[0.5,0.5,3],color = YELLOW) + + d2 = Dot(color = YELLOW).shift([-1.15,0,-2.98]) #---- critical point for minima + l2 = Line([-1.15,0,0],[-1.15,0,-2.98],color = YELLOW) + + max_text = TextMobject("Relative Maxima").shift(3.1*UP+1.5*RIGHT).scale(0.5) + min_text = TextMobject("Relative Minima").shift(3.1*DOWN+1.5*LEFT).scale(0.5) + + self.add_fixed_in_frame_mobjects(h_text) + self.wait(1) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.set_camera_orientation(phi = 100*DEGREES, theta = -40*DEGREES) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.wait(1) + self.play(Write(l1),Write(d1)) + self.add_fixed_in_frame_mobjects(max_text) + self.wait(1) + self.play(Write(l2),Write(d2)) + self.add_fixed_in_frame_mobjects(min_text) + self.wait(1) + self.wait(1) + self.play(FadeOut(l1),FadeOut(d1),FadeOut(l2),FadeOut(d2),FadeOut(max_text),FadeOut(min_text)) + self.begin_ambient_camera_rotation(rate = 0.3) + self.wait(3) 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 deleted file mode 100644 index 656fb68..0000000 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py +++ /dev/null @@ -1,134 +0,0 @@ -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) -- cgit From 90aeb7ca1eb59ee91a49852045e4e3b1614a515f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 03:39:45 +0530 Subject: Create file5_Saddle_Point.py --- .../Critical-Points/file5_Saddle_Point.py | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_Saddle_Point.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_Saddle_Point.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_Saddle_Point.py new file mode 100644 index 0000000..67dbb18 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_Saddle_Point.py @@ -0,0 +1,71 @@ +from manimlib.imports import* +import math as m + +#---- saddle point of a function +class SaddlePoint(ThreeDScene): + def construct(self): + + h_text = TextMobject("Saddle Point",color = GREEN) + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.3,5.5,0]).rotate(-4.5) #---- y axis + + #---- 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 = [BLUE_B,BLUE_C,BLUE_D,BLUE_E]).shift([0,0,0]).scale(3) + + #---- curve(trace) along y axis + curve_x = ParametricSurface( + lambda u, v: np.array([ + u*0.1, + v, + v**2 + ]),v_min = -1, v_max = 1, u_min = -0.2, u_max = 0.2).shift([0,0,-2]).scale(3.1).set_color("#800000").rotate(m.radians(180),UP) + + x_text = TextMobject("A dip at critical point along x axis").scale(0.5).to_corner(UL) + + #---- curve(trace) along x axis + curve_y = ParametricSurface( + lambda u, v: np.array([ + u, + v*0.1, + -u**2 + ]),v_min = -0.2, v_max = 0.2, u_min = -1, u_max = 1).scale(3).shift([0.1,0,2.2]).set_color("#800000").rotate(m.radians(182),DOWN) + + y_text = TextMobject("A peak at critical point along y axis").scale(0.5).to_corner(UL) + + d = Dot(color = YELLOW).shift([0,-0.22,0]) #---- critical point(saddle point) + + self.add_fixed_in_frame_mobjects(h_text) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.set_camera_orientation(phi = 75*DEGREES, theta = 40*DEGREES) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.wait(1) + self.move_camera(phi = 45*DEGREES, theta = 70*DEGREES) + self.add(curve_y) + self.play(Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(x_text) + self.wait(1) + self.wait(1) + self.play(FadeOut(curve_y),FadeOut(d),FadeOut(x_text)) + self.wait(1) + self.move_camera(phi = 40*DEGREES, theta = 30*DEGREES) + self.add(curve_x) + self.play(Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(y_text) + self.begin_ambient_camera_rotation(rate = 0.3) + self.wait(3) + self.play(FadeOut(curve_x),FadeOut(d),FadeOut(y_text)) + self.wait(1) -- cgit From b8e7cacb5bc993e0e760486270c0314d85ec943d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 03:42:38 +0530 Subject: Add files via upload --- .../file4_Relative_Maxima_and_Relative_Minima.gif | Bin 0 -> 1574608 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif new file mode 100644 index 0000000..30cea35 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif differ -- cgit From 8e3006aadce5dfa840e0a45a94f569711daa8805 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 03:44:16 +0530 Subject: Add files via upload --- .../Critical-Points/file5_Saddle_Point.gif | Bin 0 -> 7136893 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_Saddle_Point.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_Saddle_Point.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_Saddle_Point.gif new file mode 100644 index 0000000..7300f3a Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_Saddle_Point.gif differ -- cgit From ca9d449b68c2393a58dcb090f664739a8282919f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 03:46:19 +0530 Subject: Update README.md --- .../Critical-Points/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'FSF-2020') 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 index 5bd9cc5..6cf8f40 100644 --- 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 @@ -21,12 +21,18 @@ 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) +![file4_Relative_Maxima_and_Relative_Minima](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif?raw=true)



-file5_f(x,y)=(y-x)(1-2x-3y) +file5_Saddle_Point -![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) +![file5_Saddle_Point](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file5_Saddle_Point.gif?raw=true) +

+

+ +file6_f(x,y)=(y-x)(1-2x-3y) + +![file6_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/file6_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)



-- cgit From 66e1207623862b92d68ccff098705194e05516de Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 23:32:46 +0530 Subject: Update and rename file3_Nondegenerate_Hessian_Matrix.py to file2_Nondegenerate_Hessian_Matrix.py --- .../file2_Nondegenerate_Hessian_Matrix.py | 158 +++++++++++++++++++++ .../file3_Nondegenerate_Hessian_Matrix.py | 145 ------------------- 2 files changed, 158 insertions(+), 145 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Nondegenerate_Hessian_Matrix.py delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Nondegenerate_Hessian_Matrix.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Nondegenerate_Hessian_Matrix.py new file mode 100644 index 0000000..32c1559 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Nondegenerate_Hessian_Matrix.py @@ -0,0 +1,158 @@ +from manimlib.imports import* +import math as m + +class Minima(ThreeDScene): + def construct(self): + + heading = TextMobject("Nondegenerate Hessian Matrix",color = BLUE) + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.3,5.5,0]).rotate(-4.5) #---- y axis + + h_text = TextMobject("Case 1: $\\frac{\\partial^2 f}{\\partial x^2}>0$ and $\\frac{\\partial^2 f}{\\partial y^2}>0$").scale(1) + + #---- determiniant of Hessian Matrix + hessian_surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -0.5*m.exp(-u**2-v**2) + ]),u_min = -PI, u_max = PI, v_min = -PI, v_max =PI).set_color(TEAL).shift([0,0,0]).scale(1).fade(0.2) + + det_text= TextMobject("$det \\hspace{1mm} H = (\\frac{\\partial^2 f}{\\partial x^2})(\\frac{\\partial^2 f}{\\partial y^2})-(\\frac{\\partial^2 f}{\\partial x \\partial y})^2 $").to_corner(UL).scale(0.7) + + #---- function f(x,y) + f_surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),u_min = -1.3, u_max = 1.3, v_min = -1.3, v_max = 1.3).set_color(TEAL).shift([0,0,-0.5]) + + f_text= TextMobject("surface of the function").to_corner(UL).scale(0.8) + + d = Dot(color = "#800000").shift([0,0,-0.52]) #---- critical point + + self.set_camera_orientation(phi = 75*DEGREES, theta = 40*DEGREES) + self.add_fixed_in_frame_mobjects(heading) + self.wait(1) + self.play(FadeOut(heading)) + self.wait(1) + self.add_fixed_in_frame_mobjects(h_text) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(hessian_surface)) + self.wait(1) + self.add_fixed_in_frame_mobjects(det_text) + self.move_camera(phi = 90*DEGREES, theta= 60*DEGREES) + self.play(Write(d)) + self.wait(1) + self.play(FadeOut(det_text),ReplacementTransform(hessian_surface,f_surface)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.play(FadeOut(f_text),FadeOut(f_surface),FadeOut(axes),FadeOut(label_x),FadeOut(label_y),FadeOut(d)) + +class Maxima(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.3,5.5,0]).rotate(-4.5) #---- y axis + + h_text = TextMobject("Case 2: $\\frac{\\partial^2 f}{\\partial x^2}<0$ and $\\frac{\\partial^2 f}{\\partial y^2}<0$").scale(1) + + #---- determiniant of Hessian Matrix + hessian_surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + 0.5*m.exp(-u**2-v**2) + ]),u_min = -PI, u_max = PI, v_min = -PI, v_max =PI).set_color(TEAL).shift([0,0,0]).scale(1).fade(0.2) + + det_text= TextMobject("$det \\hspace{1mm} H = (\\frac{\\partial^2 f}{\\partial x^2})(\\frac{\\partial^2 f}{\\partial y^2})-(\\frac{\\partial^2 f}{\\partial x \\partial y})^2 $").to_corner(UL).scale(0.7) + + #---- function g(x,y) + g_surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),u_min = -1.3, u_max = 1.3, v_min = -1.3, v_max = 1.3).set_color(TEAL).shift([0,0,0.5]) + + g_text= TextMobject("surface of the function").to_corner(UL).scale(0.8) + + d = Dot(color = "#800000").shift([0,0,0.5]) #---- critical point + + self.set_camera_orientation(phi = 75*DEGREES, theta = 40*DEGREES) + self.add_fixed_in_frame_mobjects(h_text) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(hessian_surface)) + self.wait(1) + self.add_fixed_in_frame_mobjects(det_text) + self.play(Write(d)) + self.wait(1) + self.play(FadeOut(det_text),ReplacementTransform(hessian_surface,g_surface)) + self.wait(1) + self.add_fixed_in_frame_mobjects(g_text) + self.wait(1) + self.play(FadeOut(g_text),FadeOut(g_surface),FadeOut(axes),FadeOut(label_x),FadeOut(label_y),FadeOut(d)) + +class SaddlePoint(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.3,5.5,0]).rotate(-4.5) #---- y axis + + h_text = TextMobject("Case 3: $\\frac{\\partial^2 f}{\\partial x^2}$ and $\\frac{\\partial^2 f}{\\partial y^2}$ have opposite signs").scale(1) + + #---- determiniant of Hessian Matrix + hessian_surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + m.exp(0.5*u**2-0.5*v**2) + ]),u_min = -1.2, u_max = 1.2, v_min = -2.5, v_max = 2.5).set_color(TEAL).shift([0,0,-1]).scale(1).fade(0.2) + + det_text= TextMobject("$det \\hspace{1mm} H = (\\frac{\\partial^2 f}{\\partial x^2})(\\frac{\\partial^2 f}{\\partial y^2})-(\\frac{\\partial^2 f}{\\partial x \\partial y})^2 $").to_corner(UL).scale(0.7) + + #---- function p(x,y) + p_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(TEAL).shift([0,0,0]).scale(2) + + p_text= TextMobject("surface of the function").to_corner(UL).scale(0.8) + + d = Dot(color = "#800000").shift([0,0,0]) #---- critical point + + self.set_camera_orientation(phi = 80*DEGREES, theta = 60*DEGREES) + self.add_fixed_in_frame_mobjects(h_text) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.wait(1) + self.play(Write(hessian_surface)) + self.play(Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(det_text) + self.wait(2) + self.play(FadeOut(det_text),ReplacementTransform(hessian_surface,p_surface)) + self.add_fixed_in_frame_mobjects(p_text) + self.wait(2) 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 deleted file mode 100644 index 3056842..0000000 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py +++ /dev/null @@ -1,145 +0,0 @@ -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) -- cgit From 167452dd7e68203a39990f5af4ea99404078d958 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 23:33:12 +0530 Subject: Rename file2_Degenerate_Hessian_Matrix.py to file3_Degenerate_Hessian_Matrix.py --- .../file2_Degenerate_Hessian_Matrix.py | 52 ---------------------- .../file3_Degenerate_Hessian_Matrix.py | 52 ++++++++++++++++++++++ 2 files changed, 52 insertions(+), 52 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py (limited to 'FSF-2020') 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 deleted file mode 100644 index c1e3516..0000000 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py +++ /dev/null @@ -1,52 +0,0 @@ -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_Degenerate_Hessian_Matrix.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_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/file3_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) -- cgit From 1a08a9dcea173dcd180078a8032c2bb8853bcda2 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 23:33:25 +0530 Subject: Delete file2_Degenerate_Hessian_Matrix.gif --- .../file2_Degenerate_Hessian_Matrix.gif | Bin 3202838 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index d49cdd5..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.gif and /dev/null differ -- cgit From a9afb294a078ea365a1a42d714deb2a5bf5312f8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Fri, 26 Jun 2020 23:34:19 +0530 Subject: Add files via upload --- .../file2_Nondegenerate_Hessian_Matrix.gif | Bin 0 -> 2047897 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Nondegenerate_Hessian_Matrix.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Nondegenerate_Hessian_Matrix.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Nondegenerate_Hessian_Matrix.gif new file mode 100644 index 0000000..0d58b4f Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Nondegenerate_Hessian_Matrix.gif differ -- cgit From 2008bd765735cdef19a451940bfb6d0b3958c883 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 02:26:47 +0530 Subject: Update file3_Degenerate_Hessian_Matrix.py --- .../file3_Degenerate_Hessian_Matrix.py | 83 ++++++++++++---------- 1 file changed, 44 insertions(+), 39 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py index c1e3516..4f76daf 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py @@ -1,52 +1,57 @@ from manimlib.imports import* - -class firstscene(Scene): +import math as m + +class DegenerateHessian(ThreeDScene): 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) + heading = TextMobject("Degenerate Hessian Matrix",color = BLUE) + h_text = TextMobject("For $det \\hspace{1mm} H = 0$, the surface of the function at the critical point would be flat.").scale(0.7) - t_text = TextMobject("$D_2 = 0$(Inconclusive)", color = TEAL).scale(1).shift(2*DOWN) + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.3,5.5,0]).rotate(-4.5) #---- y axis - self.play(ShowCreation(h_text)) + #---- function f(x,y) + f_surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -4*u**3-v**3 + ]),u_min = -0.8, u_max = 0.8, v_min = -0.8, v_max = 0.8).set_color(TEAL).shift([0,1,0]).scale(1.3) + + #---- function f(x,y) + zoom_surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -4*u**3-v**3 + ]),u_min = -0.8, u_max = 0.8, v_min = -0.8, v_max = 0.8).set_color(TEAL).shift([0,1,0]).scale(2.5) + + f_text= TextMobject("surface of the function").to_corner(UL).scale(0.5) + + d = Dot(color = "#800000").shift([0,1,0]) #---- critical point + d2 = Dot(color = "#800000").shift([0,0.7,0]) #---- critical point + plane = Rectangle(color = YELLOW,fill_opacity= 0.3).shift([0,0.6,0]).rotate(m.radians(90)).scale(0.4) + + self.set_camera_orientation(phi = 70*DEGREES, theta = 45*DEGREES) + self.add_fixed_in_frame_mobjects(heading) self.wait(1) + self.play(FadeOut(heading)) + self.add_fixed_in_frame_mobjects(h_text) + self.wait(2) self.play(FadeOut(h_text)) self.wait(1) - self.play(ShowCreation(f_text)) - self.wait(1) - self.play(ShowCreation(c_text)) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(f_surface)) + self.add_fixed_in_frame_mobjects(f_text) self.wait(1) - self.play(ShowCreation(m_text)) + self.play(Write(d)) + self.wait(1) + self.play(ReplacementTransform(f_surface,zoom_surface),ReplacementTransform(d,d2)) self.wait(2) - self.play(ReplacementTransform(m_text,d_text)) + self.play(Write(plane)) 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) -- cgit From 4280330114ad16782a6b584c26adf78c1820d298 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 02:27:07 +0530 Subject: Update file3_Degenerate_Hessian_Matrix.py --- .../The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py | 1 - 1 file changed, 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py index 4f76daf..732ef4f 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py @@ -54,4 +54,3 @@ class DegenerateHessian(ThreeDScene): self.wait(2) self.play(Write(plane)) self.wait(1) - -- cgit From 38eac13cd8fc554d4bf10c5cc0a6c2dbfb31ca7b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 02:27:47 +0530 Subject: Delete file3_Nondegenerate_Hessian_Matrix.gif --- .../file3_Nondegenerate_Hessian_Matrix.gif | Bin 8724439 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 2b0acb3..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.gif and /dev/null differ -- cgit From 404ac6463e266bcb1cff33e7f85606a91496499d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 02:29:21 +0530 Subject: Add files via upload --- .../file3_Degenerate_Hessian_Matrix.gif | Bin 0 -> 652724 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif new file mode 100644 index 0000000..36fd25c Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif differ -- cgit From a68eb145ac849444d222c3eaea619e7dfca9f410 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 02:50:19 +0530 Subject: Update and rename file4_Relative_Maxima_and_Relative_Minima.py to file4_Relative_Maximum_and_Relative_Minimum.py --- .../file4_Relative_Maxima_and_Relative_Minima.py | 51 ---------------------- .../file4_Relative_Maximum_and_Relative_Minimum.py | 51 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 51 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.py create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maximum_and_Relative_Minimum.py (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.py deleted file mode 100644 index 7999527..0000000 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.py +++ /dev/null @@ -1,51 +0,0 @@ -from manimlib.imports import* -import math as m - -#---- locating extrema of a funtion using critical points -class Extrema(ThreeDScene): - def construct(self): - - h_text = TextMobject("Relative Maxima and Relative Minima",color = GREEN) - - axes = ThreeDAxes() - label_x = TextMobject("$x$").shift([5.5,-0.3,0]) #---- x axis - label_y = TextMobject("$y$").shift([-0.3,5.5,0]).rotate(-4.5) #---- y axis - - #---- f(x,y) = 5(x+y)e^(-x^2-y^2) - surface = ParametricSurface( - lambda u, v: np.array([ - u, - v, - 5*(u+v)*m.exp(-u**2-v**2) - ]),u_min = -PI, u_max = PI, v_min = -PI, v_max = PI).set_color(TEAL).shift([0,0,0]).fade(0.4) - - d1 = Dot(color = YELLOW).shift([0.5,0.5,3.02]) #---- critical point for maxima - l1 = Line([0.5,0.5,0.1],[0.5,0.5,3],color = YELLOW) - - d2 = Dot(color = YELLOW).shift([-1.15,0,-2.98]) #---- critical point for minima - l2 = Line([-1.15,0,0],[-1.15,0,-2.98],color = YELLOW) - - max_text = TextMobject("Relative Maxima").shift(3.1*UP+1.5*RIGHT).scale(0.5) - min_text = TextMobject("Relative Minima").shift(3.1*DOWN+1.5*LEFT).scale(0.5) - - self.add_fixed_in_frame_mobjects(h_text) - self.wait(1) - self.wait(1) - self.play(FadeOut(h_text)) - self.wait(1) - self.set_camera_orientation(phi = 100*DEGREES, theta = -40*DEGREES) - self.add(axes) - self.add(label_x) - self.add(label_y) - self.play(Write(surface)) - self.wait(1) - self.play(Write(l1),Write(d1)) - self.add_fixed_in_frame_mobjects(max_text) - self.wait(1) - self.play(Write(l2),Write(d2)) - self.add_fixed_in_frame_mobjects(min_text) - self.wait(1) - self.wait(1) - self.play(FadeOut(l1),FadeOut(d1),FadeOut(l2),FadeOut(d2),FadeOut(max_text),FadeOut(min_text)) - self.begin_ambient_camera_rotation(rate = 0.3) - self.wait(3) diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maximum_and_Relative_Minimum.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maximum_and_Relative_Minimum.py new file mode 100644 index 0000000..3bd810d --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maximum_and_Relative_Minimum.py @@ -0,0 +1,51 @@ +from manimlib.imports import* +import math as m + +#---- locating extrema of a funtion using critical points +class Extrema(ThreeDScene): + def construct(self): + + h_text = TextMobject("Relative Maximum and Relative Minimum",color = GREEN) + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.3,5.5,0]).rotate(-4.5) #---- y axis + + #---- f(x,y) = 5(x+y)e^(-x^2-y^2) + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + 5*(u+v)*m.exp(-u**2-v**2) + ]),u_min = -PI, u_max = PI, v_min = -PI, v_max = PI).set_color(TEAL).shift([0,0,0]).fade(0.4) + + d1 = Dot(color = YELLOW).shift([0.5,0.5,3.02]) #---- critical point for maxima + l1 = Line([0.5,0.5,0.1],[0.5,0.5,3],color = YELLOW) + + d2 = Dot(color = YELLOW).shift([-1.15,0,-2.98]) #---- critical point for minima + l2 = Line([-1.15,0,0],[-1.15,0,-2.98],color = YELLOW) + + max_text = TextMobject("Relative Maximum").shift(3.1*UP+1.5*RIGHT).scale(0.5) + min_text = TextMobject("Relative Minimum").shift(3.1*DOWN+1.5*LEFT).scale(0.5) + + self.add_fixed_in_frame_mobjects(h_text) + self.wait(1) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.set_camera_orientation(phi = 100*DEGREES, theta = -40*DEGREES) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.wait(1) + self.play(Write(l1),Write(d1)) + self.add_fixed_in_frame_mobjects(max_text) + self.wait(1) + self.play(Write(l2),Write(d2)) + self.add_fixed_in_frame_mobjects(min_text) + self.wait(1) + self.wait(1) + self.play(FadeOut(l1),FadeOut(d1),FadeOut(l2),FadeOut(d2),FadeOut(max_text),FadeOut(min_text)) + self.begin_ambient_camera_rotation(rate = 0.3) + self.wait(3) -- cgit From ff66437567d0d7923d0e2291edba668aa05e7197 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 02:50:43 +0530 Subject: Delete file4_Relative_Maxima_and_Relative_Minima.gif --- .../file4_Relative_Maxima_and_Relative_Minima.gif | Bin 1574608 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif deleted file mode 100644 index 30cea35..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif and /dev/null differ -- cgit From 825d0d1b187d3d378869f8d77cfe1af5bd9c8a67 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 02:51:20 +0530 Subject: Update README.md --- .../approximations-and-optimizations/Critical-Points/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') 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 index 6cf8f40..83abfd3 100644 --- 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 @@ -19,9 +19,9 @@



-file4_Types_of_critical_points +file4_Relative_Maximum_and_Relative_Minimum -![file4_Relative_Maxima_and_Relative_Minima](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maxima_and_Relative_Minima.gif?raw=true) +![file4_Relative_Maxima_and_Relative_Minima](?raw=true)



-- cgit From 8ead1443c9c8f9eac9fa698e78c4dabfbac6c188 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 02:52:12 +0530 Subject: Add files via upload --- .../file4_Relative_Maximum_and_Relative_Minimum.gif | Bin 0 -> 1587319 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maximum_and_Relative_Minimum.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maximum_and_Relative_Minimum.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maximum_and_Relative_Minimum.gif new file mode 100644 index 0000000..6b93359 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maximum_and_Relative_Minimum.gif differ -- cgit From 9950f6e2906a69175c0474545ec489a952735920 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 02:54:14 +0530 Subject: Update README.md --- .../approximations-and-optimizations/Critical-Points/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') 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 index 83abfd3..857d298 100644 --- 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 @@ -21,7 +21,7 @@ file4_Relative_Maximum_and_Relative_Minimum -![file4_Relative_Maxima_and_Relative_Minima](?raw=true) +![file4_Relative_Maxima_and_Relative_Minima](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file4_Relative_Maximum_and_Relative_Minimum.gif?raw=true)



-- cgit From 84569f5fcc0195a488e055b5566225235d93011f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 03:03:52 +0530 Subject: Create README.md --- .../The-Second-Derivative-Test/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md new file mode 100644 index 0000000..e9cc918 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md @@ -0,0 +1,21 @@ +

SubTopic: The Second Derivative Test

+

+ +file1_Second_order_partial_derivatives + +![file1_Second_order_partial_derivatives](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif?raw=true) +

+

+ +file2_Nondegenerate_Hessian_Matrix + +![file2_Nondegenerate_Hessian_Matrix](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file2_Nondegenerate_Hessian_Matrix.gif?raw=true) +

+

+ +file3_Degenerate_Hessian_Matrix + +![file3_Degenerate_Hessian_Matrix](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif?raw=true) +

+

+ -- cgit From 2fb88c2ae4a8218572ec276e80d80c3cdadd5fbb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 19:44:01 +0530 Subject: Update file3_Degenerate_Hessian_Matrix.py --- .../file3_Degenerate_Hessian_Matrix.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py index 732ef4f..9310553 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py @@ -17,22 +17,13 @@ class DegenerateHessian(ThreeDScene): lambda u, v: np.array([ u, v, - -4*u**3-v**3 - ]),u_min = -0.8, u_max = 0.8, v_min = -0.8, v_max = 0.8).set_color(TEAL).shift([0,1,0]).scale(1.3) - - #---- function f(x,y) - zoom_surface = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -4*u**3-v**3 - ]),u_min = -0.8, u_max = 0.8, v_min = -0.8, v_max = 0.8).set_color(TEAL).shift([0,1,0]).scale(2.5) + -u**4-v**4 + ]),u_min = -0.8, u_max = 0.8, v_min = -0.8, v_max = 0.8).set_color(TEAL).shift([0,0,-0.5]).scale(2) f_text= TextMobject("surface of the function").to_corner(UL).scale(0.5) - d = Dot(color = "#800000").shift([0,1,0]) #---- critical point - d2 = Dot(color = "#800000").shift([0,0.7,0]) #---- critical point - plane = Rectangle(color = YELLOW,fill_opacity= 0.3).shift([0,0.6,0]).rotate(m.radians(90)).scale(0.4) + d = Dot(color = "#800000").shift([0,0,-0.5]) #---- critical point + plane = Square(color = YELLOW,fill_opacity= 0.2).shift([0,0,-0.5]).scale(1.3) self.set_camera_orientation(phi = 70*DEGREES, theta = 45*DEGREES) self.add_fixed_in_frame_mobjects(heading) @@ -49,8 +40,6 @@ class DegenerateHessian(ThreeDScene): self.add_fixed_in_frame_mobjects(f_text) self.wait(1) self.play(Write(d)) - self.wait(1) - self.play(ReplacementTransform(f_surface,zoom_surface),ReplacementTransform(d,d2)) - self.wait(2) + self.wait(1) self.play(Write(plane)) self.wait(1) -- cgit From 7d8096521d44ae96be2aac0d8c87b3eb55948185 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 19:45:05 +0530 Subject: Delete file4_Contour_Diagram.gif --- .../file4_Contour_Diagram.gif | Bin 1150777 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 129fedc..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif and /dev/null differ -- cgit From 5520bb3fa19ef395385c52a78cac00c286e0be6a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 19:45:26 +0530 Subject: Update README.md --- .../The-Second-Derivative-Test/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md index e9cc918..daf49f2 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md @@ -15,7 +15,7 @@ file3_Degenerate_Hessian_Matrix -![file3_Degenerate_Hessian_Matrix](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif?raw=true) +![file3_Degenerate_Hessian_Matrix](?raw=true)



-- cgit From 03b84adf2345c2dc1cc63eaa29021b9a7ff024be Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 19:46:36 +0530 Subject: Delete file3_Degenerate_Hessian_Matrix.gif --- .../file3_Degenerate_Hessian_Matrix.gif | Bin 652724 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif deleted file mode 100644 index 36fd25c..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif and /dev/null differ -- cgit From 1d4cf4cda4dc6c778c8339532e8baad5badfd9f1 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 19:47:28 +0530 Subject: Add files via upload --- .../file3_Degenerate_Hessian_Matrix.gif | Bin 0 -> 407350 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif new file mode 100644 index 0000000..5aae300 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif differ -- cgit From 8b578d7993f33115aaa3259be85ed87ab71466cb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 27 Jun 2020 19:48:48 +0530 Subject: Update README.md --- .../The-Second-Derivative-Test/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md index daf49f2..e9cc918 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md @@ -15,7 +15,7 @@ file3_Degenerate_Hessian_Matrix -![file3_Degenerate_Hessian_Matrix](?raw=true) +![file3_Degenerate_Hessian_Matrix](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.gif?raw=true)



-- cgit From c53b6cd7e1a10b0e5c4f12801412646fd17569c8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 28 Jun 2020 02:05:21 +0530 Subject: Add files via upload --- .../file4_Contour_Diagram.gif | Bin 0 -> 1140109 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..41068e2 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif differ -- cgit From 7650a4ad8777a8a979c4899c1e0d852bd5111be8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 28 Jun 2020 02:06:42 +0530 Subject: Update README.md --- .../The-Second-Derivative-Test/README.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md index e9cc918..96b32bf 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/README.md @@ -19,3 +19,9 @@



+file4_Contour_Diagram + +![file4_Contour_Diagram](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif?raw=true) +

+

+ -- cgit From f78f8e6889c00cc3d9ec4e0094fb8417cdf74240 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Mon, 29 Jun 2020 00:42:54 +0530 Subject: Delete file1_Extrema_over_g(x,y)=k.gif --- .../file1_Extrema_over_g(x,y)=k.gif | Bin 499796 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 1e1782e..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.gif and /dev/null differ -- cgit From a4c28a866815b0b2687e3baf2d1dbc96a7039324 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Mon, 29 Jun 2020 00:43:56 +0530 Subject: Update file1_Extrema_over_g(x,y)=k.py --- .../Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'FSF-2020') 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 index 17f31ac..17ba858 100644 --- 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 @@ -1,14 +1,18 @@ from manimlib.imports import* +import math as m class firstScene(ThreeDScene): def construct(self): - axes = ThreeDAxes() + axes = ThreeDAxes().fade(0.4) + label_x = TextMobject("$x$").shift([5.5,-0.5,0]).fade(0.4) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5).fade(0.4) #---- y axis + 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) + ]),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(TEAL).fade(0.4) c = Circle().set_color('#FF00FF').shift([-0.4,0,1.5]).rotate(1.9,UP).scale(0.7) @@ -26,10 +30,11 @@ class firstScene(ThreeDScene): 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) - + label_g = TextMobject("$g(x,y)=k$",color = '#8A2BE2').scale(0.5).shift(2*RIGHT) self.add(axes) + self.add(label_x) + self.add(label_y) self.set_camera_orientation(phi=75*DEGREES,theta=45*DEGREES) self.play(Write(surface)) self.add_fixed_in_frame_mobjects(label_f) @@ -49,5 +54,3 @@ class firstScene(ThreeDScene): self.play(Write(maxima_refl)) self.play(Write(minima_refl)) self.wait(1) - - -- cgit From 838dfb6f044db8a1ec2b0bfeb191632cfd60054f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Mon, 29 Jun 2020 00:51:08 +0530 Subject: Add files via upload --- .../file1_Extrema_over_g(x,y)=k.gif | Bin 0 -> 595677 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..9d64d50 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.gif differ -- cgit From 076b497787e65f119430837acf8d8b812c82003c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Mon, 29 Jun 2020 00:57:02 +0530 Subject: Update file1_Extrema_over_g(x,y)=k.py --- .../Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'FSF-2020') 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 index 17ba858..da17aac 100644 --- 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 @@ -1,7 +1,8 @@ from manimlib.imports import* import math as m -class firstScene(ThreeDScene): +#---- optimizing funtion f(x,y) w.r.t to g(x,y) +class ConstrainedExtrema(ThreeDScene): def construct(self): axes = ThreeDAxes().fade(0.4) label_x = TextMobject("$x$").shift([5.5,-0.5,0]).fade(0.4) #---- x axis -- cgit From 7638fde966190d0cdd22d763767df7551ccd980d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Mon, 29 Jun 2020 16:05:43 +0530 Subject: Delete file2_Geometric_Proof.gif --- .../Lagrange-Multipliers/file2_Geometric_Proof.gif | Bin 419262 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index b22afb3..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file2_Geometric_Proof.gif and /dev/null differ -- cgit From 85875270cfe25fe3e5b666fe45a76eece2419452 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Mon, 29 Jun 2020 16:15:49 +0530 Subject: Update file2_Geometric_Proof.py --- .../Lagrange-Multipliers/file2_Geometric_Proof.py | 48 ++++++++++++++++------ 1 file changed, 35 insertions(+), 13 deletions(-) (limited to 'FSF-2020') 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 index 4374ff7..2c2a9de 100644 --- 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 @@ -1,8 +1,12 @@ from manimlib.imports import* -class firstScene(ThreeDScene): +#---- visualization of geometric proof of Lagrange multiplier +class GeometricProof(ThreeDScene): def construct(self): - axes = ThreeDAxes().scale(0.7).rotate(math.radians(180)) + axes = ThreeDAxes().scale(0.7).rotate(math.radians(180)) + label_x = TextMobject("$x$").shift(4*RIGHT).fade(0.4) #---- x axis + label_y = TextMobject("$y$").shift(3.2*DOWN+0.2*RIGHT).rotate(math.radians(180)).fade(0.4) #---- y axis + surface = ParametricSurface( lambda u, v: np.array([ 1*np.sin(u)*np.cos(v), @@ -11,15 +15,16 @@ class firstScene(ThreeDScene): ]),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 + a_df = Arrow(color = '#00FFFF').rotate(-2).shift(3.2*DOWN+2.3*LEFT) #---- f parallel to g at maxima + a_dg = Arrow(color = '#FF00FF').scale(0.8).shift(3.2*DOWN+2.3*LEFT).rotate(-2) #---- g parallel to f at maxima - 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 + b_dg = Arrow(color = '#00FFFF').rotate(1.1).shift(0.82*LEFT+0.15*UP) #---- g parallel to f at minima + b_df = Arrow(color = '#FF00FF').scale(0.6).rotate(-2).shift(1.43*LEFT+1.1*DOWN) #---- f parallel to g at minima qd = Dot(color = '#800000').shift(1.2*LEFT+0.6*DOWN) + #---- level curves 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) @@ -36,19 +41,36 @@ class firstScene(ThreeDScene): 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) + #---- labelling of level curves + l1_text = TextMobject("$w=$ 17").rotate(math.radians(180)).scale(0.4).shift(2.7*DOWN+4.36*LEFT) + l2_text = TextMobject("$w=$ 16").rotate(math.radians(180)).scale(0.4).shift(2.46*DOWN+4.36*LEFT) + l3_text = TextMobject("$w=$ 15").rotate(math.radians(180)).scale(0.4).shift(2.2*DOWN+4.36*LEFT) + l4_text = TextMobject("$w=$ 14").rotate(math.radians(180)).scale(0.4).shift(1.97*DOWN+4.36*LEFT) + l5_text = TextMobject("$w=$ 13").rotate(math.radians(180)).scale(0.4).shift(1.74*DOWN+4.36*LEFT) + l6_text = TextMobject("$w=$ 12").rotate(math.radians(180)).scale(0.4).shift(1.5*DOWN+4.36*LEFT) + l7_text = TextMobject("$w=$ 11").rotate(math.radians(180)).scale(0.4).shift(1.26*DOWN+4.36*LEFT) + l8_text = TextMobject("$w=$ 10").rotate(math.radians(180)).scale(0.4).shift(1.05*DOWN+4.36*LEFT) + l9_text = TextMobject("$w=$ 9").rotate(math.radians(180)).scale(0.4).shift(0.8*DOWN+4.32*LEFT) + l10_text = TextMobject("$w=$ 8").rotate(math.radians(180)).scale(0.4).shift(0.6*DOWN+4.32*LEFT) + l11_text = TextMobject("$w=$ 7").rotate(math.radians(180)).scale(0.4).shift(0.4*DOWN+4.32*LEFT) + l12_text = TextMobject("$w=$ 6").rotate(math.radians(180)).scale(0.4).shift(0.2*DOWN+4.32*LEFT) + l13_text = TextMobject("$w=$ 5").rotate(math.radians(180)).scale(0.4).shift(-0.02*DOWN+4.32*LEFT) + l14_text = TextMobject("$w=$ 4").rotate(math.radians(180)).scale(0.4).shift(-0.23*DOWN+4.32*LEFT) + l15_text = TextMobject("$w=$ 3").rotate(math.radians(180)).scale(0.4).shift(-0.44*DOWN+4.32*LEFT) + + level_Curve = VGroup(l1,l1_text,l2,l2_text,l3,l3_text,l4,l4_text,l5,l5_text,l6,l6_text,l7,l7_text,l8,l8_text,l9,l9_text,l10,l10_text,l11,l11_text,l12,l12_text,l13,l13_text,l14,l14_text,l15,l15_text) + self.set_camera_orientation(phi=0 * DEGREES, theta = 90*DEGREES) + self.add(axes) + self.add(label_x) + self.add(label_y) self.play(Write(surface)) self.wait(1) self.play(ShowCreation(level_Curve)) @@ -61,8 +83,8 @@ class firstScene(ThreeDScene): 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.wait(1) + self.play(ShowCreation(b_dg)) self.add_fixed_in_frame_mobjects(g_text) self.wait(1) -- cgit From 2fc0bbf646c2aaf31d3e1f578a6427012b4a214e Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 00:39:05 +0530 Subject: Delete file1_Visualization_of_dz.gif --- .../Total-Differential/file1_Visualization_of_dz.gif | Bin 558983 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index e00a946..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif and /dev/null differ -- cgit From 1d775364041157dbe2db000676ec2e185c0ccb84 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 00:42:21 +0530 Subject: Update file1_Visualization_of_dz.py --- .../file1_Visualization_of_dz.py | 80 ++++++++++++++-------- 1 file changed, 52 insertions(+), 28 deletions(-) (limited to 'FSF-2020') 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 index a097a96..2a1a750 100644 --- 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 @@ -1,53 +1,77 @@ from manimlib.imports import* - -class firstScene(ThreeDScene): - +#---- visualization of the differential dz between two points on the surface of the function +class differentialdz(ThreeDScene): def construct(self): - - axes = ThreeDAxes().rotate(1.571) + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]).fade(0.4) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5).fade(0.4) #---- y axis + 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) + ]),u_min=-1,u_max=1, v_min=-1,v_max=1).set_color("#FF69B4").shift([0,2.5,0.3]).scale(1.2) #----surface z = f(x,y) + - d = Dot([1.4,1.75,1],color = '#00FFFF').rotate(1.571,UP) - d2 = Dot([2,2,1],color = '#00FFFF').rotate(1.571,UP) + + plane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(3).shift(-1*RIGHT+3*UP).fade(0.9) #---- x-y plane + + d = Dot([1,2,1],color = '#9400D3').rotate(1.571,UP) #---- point on the surface + d2 = Dot([2,2.9,1],color = '#9400D3').rotate(1.571,UP) #---- point on the surface 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) + p2 = TextMobject("$P_2$",color = '#ADFF2F').scale(0.6).shift(2.6*RIGHT+0.4*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) + 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) - a = Arrow(color = '#FFFACD').scale(0.7).rotate(1.38,RIGHT).shift(2.5*LEFT+3.1*UP) + label_dz= TextMobject("$dz$").scale(0.4).shift(5.3*RIGHT+0.4*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) + l3 = Line(color = '#FFDAB9').scale(0.8).shift(1.95*UP+0.7*RIGHT).rotate(1.571,DOWN).fade(0.2) + l4 = Line(color = '#FFDAB9').scale(0.6).shift(2.86*UP+0.9*RIGHT).rotate(1.571,DOWN).fade(0.2) - label = TextMobject("$z = f(x,y)$").scale(0.6).shift(3.5*RIGHT+1.8*UP) - + 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.set_camera_orientation(phi=75*DEGREES,theta=10*DEGREES) self.add(axes) - self.set_camera_orientation(phi=75*DEGREES,theta=-10*DEGREES) - self.wait(1) + self.add(label_x) + self.add(label_y) self.play(Write(plane)) - self.play(Write(surface)) + 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.play(Write(d),Write(d2)) 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.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) - self.add_fixed_in_frame_mobjects(a_text) - self.wait(2) -- cgit From ab75cfbbfbf634b6f06f7687d8defc9ab35038b1 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 00:43:20 +0530 Subject: Delete file2_Differentials.gif --- .../Total-Differential/file2_Differentials.gif | Bin 576535 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 620b49e..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif and /dev/null differ -- cgit From 29fdeb06d1c7c7eaf740332dbcc28e33a98bc7f8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 00:45:13 +0530 Subject: Delete file3_Total_differential_of_z.gif --- .../file3_Total_differential_of_z.gif | Bin 732678 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 5aae2a1..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif and /dev/null differ -- cgit From 8fcc588bd40a5d8ea4daa24d9b4056598df5c96a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 00:46:16 +0530 Subject: Add files via upload --- .../Total-Differential/file1_Visualization_of_dz.gif | Bin 0 -> 565199 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..2e148af Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif differ -- cgit From 042395420527585b7880fc2690d236d607c3467f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 00:50:51 +0530 Subject: Update file1_Visualization_of_dz.py --- .../file1_Visualization_of_dz.py | 80 +++++++++------------- 1 file changed, 31 insertions(+), 49 deletions(-) (limited to 'FSF-2020') 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 index 2a1a750..1fdd0b9 100644 --- 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 @@ -1,77 +1,59 @@ from manimlib.imports import* -#---- visualization of the differential dz between two points on the surface of the function -class differentialdz(ThreeDScene): +#---- visualization of total differential dz between two points lying on the surface of the function +class differentialdz(ThreeDScene): + def construct(self): - - axes = ThreeDAxes() - label_x = TextMobject("$x$").shift([5.5,-0.3,0]).fade(0.4) #---- x axis + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]).fade(0.4) #---- x axis label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5).fade(0.4) #---- y axis - + + #---- surface of the funtion f(x,y) 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").shift([0,2.5,0.3]).scale(1.2) #----surface z = f(x,y) - + ]),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) - - plane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(3).shift(-1*RIGHT+3*UP).fade(0.9) #---- x-y plane - - d = Dot([1,2,1],color = '#9400D3').rotate(1.571,UP) #---- point on the surface - d2 = Dot([2,2.9,1],color = '#9400D3').rotate(1.571,UP) #---- point on the surface + d = Dot([1.4,1.75,1],color = '#00FFFF').rotate(1.571,UP) #---- point on the surface + d2 = Dot([2,2,1],color = '#00FFFF').rotate(1.571,UP) #---- point on the surface 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) + p2 = TextMobject("$P_2$",color = '#ADFF2F').scale(0.6).shift(2.6*RIGHT+0.9*UP) - label_dz= TextMobject("$dz$").scale(0.4).shift(5.3*RIGHT+0.4*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) - l3 = Line(color = '#FFDAB9').scale(0.8).shift(1.95*UP+0.7*RIGHT).rotate(1.571,DOWN).fade(0.2) - l4 = Line(color = '#FFDAB9').scale(0.6).shift(2.86*UP+0.9*RIGHT).rotate(1.571,DOWN).fade(0.2) + a = Arrow(color = '#FFFACD').scale(0.7).rotate(1.38,RIGHT).shift(2.5*LEFT+3.1*UP) - 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) + a_text = TextMobject("$dz$",color='#800000').scale(0.5).shift(2.3*RIGHT+0.5*UP) - label_dy= TextMobject("$dy$").scale(0.6).shift(3*RIGHT+0.8*DOWN).rotate(math.radians(90)) + plane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(3).shift(1*RIGHT+3*UP).fade(0.9) - 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.set_camera_orientation(phi=75*DEGREES,theta=10*DEGREES) + label = TextMobject("$z = f(x,y)$").scale(0.6).shift(3.5*RIGHT+1.8*UP) + + self.set_camera_orientation(phi=75*DEGREES,theta=-10*DEGREES) self.add(axes) self.add(label_x) self.add(label_y) + self.wait(1) self.play(Write(plane)) - self.play(Write(surface)) + self.play(Write(surface)) self.add_fixed_in_frame_mobjects(label) self.wait(1) - self.play(Write(d),Write(d2)) + 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.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.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) -- cgit From 50e24a7c48bb2ce318b66d8690776258f54224fe Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 00:52:47 +0530 Subject: Update file2_Differentials.py --- .../Total-Differential/file2_Differentials.py | 31 +++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'FSF-2020') 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 index b40be70..1025210 100644 --- 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 @@ -1,16 +1,21 @@ from manimlib.imports import* - -class firstScene(ThreeDScene): - +#---- visualization of the differentials along the axes +class differentials(ThreeDScene): def construct(self): - axes = ThreeDAxes() + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]).fade(0.4) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5).fade(0.4) #---- y axis - 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) + 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").shift([0,2.5,0.3]).scale(1.2) #----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) @@ -27,8 +32,8 @@ class firstScene(ThreeDScene): 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) + l3 = Line(color = '#FFDAB9').scale(0.8).shift(1.95*UP+0.7*RIGHT).rotate(1.571,DOWN).fade(0.2) + l4 = Line(color = '#FFDAB9').scale(0.6).shift(2.86*UP+0.9*RIGHT).rotate(1.571,DOWN).fade(0.2) 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) @@ -43,12 +48,12 @@ class firstScene(ThreeDScene): 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.add(axes) + self.add(label_x) + self.add(label_y) self.play(Write(plane)) - self.play(ShowCreation(label_y)) - self.add_fixed_in_frame_mobjects(label_x) - self.play(Write(s)) + self.play(Write(surface)) self.add_fixed_in_frame_mobjects(label) self.wait(1) self.play(Write(d),Write(d2)) -- cgit From 6f6d931675d33a7a6e2b70c929f644d154dce847 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 00:55:01 +0530 Subject: Add files via upload --- .../Total-Differential/file2_Differentials.gif | Bin 0 -> 725835 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..29207e3 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif differ -- cgit From 8f060d75dd518f8d2c235837962daa67e45e40d7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 00:55:57 +0530 Subject: Add files via upload --- .../file3_Total_differential_of_z.gif | Bin 0 -> 1444924 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..a54d2da Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif differ -- cgit From 3a42ab7ee6ebce1ad7c97b4f466ce26d11c0506c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:02:18 +0530 Subject: Create README.md --- .../Total-Differential/README.md | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md new file mode 100644 index 0000000..51768b6 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md @@ -0,0 +1,32 @@ +

SubTopic: Total Differential

+

+ +file1_Visualization_of_dz + +![file1_Visualization_of_dz](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file1_Visualization_of_dz.gif?raw=true) +

+

+ +file2_Differentials + +![file2_Differentials](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif?raw=true) +

+

+ +file3_Total_differential_of_z + +![file3_Total_differential_of_z](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file3_Total_differential_of_z.gif?raw=true) +

+

+ +file4_total_differential_change + +![file4_total_differential_change](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file4_total_differential_change.gif?raw=true) +

+

+ +file5_Total_differential_approximation + +![file5_Total_differential_approximation](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif?raw=true) +

+

-- cgit From 2c18d3645c579576f7cc5caf2a0989d8a35510d6 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:14:41 +0530 Subject: Update file5_Total_differential_approximation.py --- .../file5_Total_differential_approximation.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'FSF-2020') 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 index 83017ed..e7b39bb 100644 --- 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 @@ -1,11 +1,14 @@ from manimlib.imports import* - -class firstScene(ThreeDScene): +#---- approximation value of function between two points using total differentials +class approximation(ThreeDScene): def construct(self): - axes = ThreeDAxes().rotate(1.571) + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.3,0]).fade(0.4) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5).fade(0.4) #---- y axis + surface = ParametricSurface( lambda u, v: np.array([ np.sin(u), @@ -29,9 +32,10 @@ class firstScene(ThreeDScene): 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.add(axes) + self.add(label_x) + self.add(label_y) self.wait(1) self.play(Write(plane)) self.wait(1) -- cgit From 96d2742303391c0005c59f2317a16c1850da449a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:15:42 +0530 Subject: Delete file5_Total_differential_approximation.gif --- .../file5_Total_differential_approximation.gif | Bin 423652 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 4f4627d..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif and /dev/null differ -- cgit From e29f7549016c88960601bf0dfcee31bd1eabde3f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:15:56 +0530 Subject: Update README.md --- .../approximations-and-optimizations/Total-Differential/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md index 51768b6..089ecd3 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md @@ -27,6 +27,6 @@ file5_Total_differential_approximation -![file5_Total_differential_approximation](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif?raw=true) +![file5_Total_differential_approximation](?raw=true)



-- cgit From 4ab55ba27c21b5009180e345500105d6469efd8c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:16:18 +0530 Subject: Add files via upload --- .../file5_Total_differential_approximation.gif | Bin 0 -> 423246 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..ebbf240 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif differ -- cgit From 9725bfc14b0f98e6542110125c5502484e3bf6a2 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:16:53 +0530 Subject: Delete file5_Total_differential_approximation.gif --- .../file5_Total_differential_approximation.gif | Bin 423246 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index ebbf240..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif and /dev/null differ -- cgit From 16d7412eff57960c262fd5417a227b5867821110 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:17:51 +0530 Subject: Add files via upload --- .../file5_Total_differential_approximation.gif | Bin 0 -> 423246 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..ebbf240 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif differ -- cgit From b268e0e2187ec72061ebedf9236c65becc0d3fcb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:19:15 +0530 Subject: Delete file5_Total_differential_approximation.gif --- .../file5_Total_differential_approximation.gif | Bin 423246 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index ebbf240..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif and /dev/null differ -- cgit From 89e6a94cc369de704573c502c83ece5d06fd5336 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:19:37 +0530 Subject: Update README.md --- .../approximations-and-optimizations/Total-Differential/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md index 089ecd3..e51ede3 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md @@ -27,6 +27,6 @@ file5_Total_differential_approximation -![file5_Total_differential_approximation](?raw=true) +![file5_Total_differential_approximation]



-- cgit From fe28c4c821cdc250beb6582f2f439e73b064daef Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:20:12 +0530 Subject: Add files via upload --- .../file5_Total_differential_approximation.gif | Bin 0 -> 423246 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..ebbf240 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif differ -- cgit From b4d09c2c9fd0f5488fcffa7b747db1582af97521 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:20:44 +0530 Subject: Delete file5_Total_differential_approximation.gif --- .../file5_Total_differential_approximation.gif | Bin 423246 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index ebbf240..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif and /dev/null differ -- cgit From e4cde6e13778391e5fae623573d8656290b09988 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:21:47 +0530 Subject: Update README.md --- .../approximations-and-optimizations/Total-Differential/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md index e51ede3..3987542 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md @@ -9,7 +9,7 @@ file2_Differentials -![file2_Differentials](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif?raw=true) +



@@ -27,6 +27,6 @@ file5_Total_differential_approximation -![file5_Total_differential_approximation] +



-- cgit From d8ed52c1d3c09890c12c88e299aa0bfab66d2113 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:23:52 +0530 Subject: Add files via upload --- .../file5_Total_differential_approximation.gif | Bin 0 -> 423246 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..ebbf240 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif differ -- cgit From b5d70ad25e3a20278ab6483b099eb523e8e1f1c0 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:24:38 +0530 Subject: Delete file2_Differentials.gif --- .../Total-Differential/file2_Differentials.gif | Bin 725835 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 29207e3..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif and /dev/null differ -- cgit From 25a650bf03669ce8b7acc1d19b2a7277a8dac2c4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:25:20 +0530 Subject: Add files via upload --- .../Total-Differential/file2_Differentials.gif | Bin 0 -> 729982 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..6baf271 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif differ -- cgit From 0175a361342a7baa627333c76ab5a7e248670241 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:26:07 +0530 Subject: Delete file2_Differentials.gif --- .../Total-Differential/file2_Differentials.gif | Bin 729982 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif (limited to 'FSF-2020') 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 deleted file mode 100644 index 6baf271..0000000 Binary files a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif and /dev/null differ -- cgit From ce5466c5fa13951701a1737b84582cfe5cb61b53 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:27:44 +0530 Subject: Add files via upload --- .../Total-Differential/file2_Differentials.gif | Bin 0 -> 729982 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif (limited to 'FSF-2020') 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 new file mode 100644 index 0000000..6baf271 Binary files /dev/null and b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif differ -- cgit From 96159e5ec9a939dea4a7d1adaa1fb729fa85fadd Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:29:58 +0530 Subject: Update README.md --- .../approximations-and-optimizations/Total-Differential/README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'FSF-2020') diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md index 3987542..ce4da11 100644 --- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md +++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/README.md @@ -9,6 +9,7 @@ file2_Differentials +![file2_Differentials](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file2_Differentials.gif?raw=true)



@@ -27,6 +28,7 @@ file5_Total_differential_approximation + ![file5_Total_differential_approximation](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.gif?raw=true)



-- cgit From 6eaafd2b199661ba0b2221ed8f75bfc4c5e18514 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 30 Jun 2020 01:34:49 +0530 Subject: Update file3_Total_differential_of_z.py --- .../file3_Total_differential_of_z.py | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'FSF-2020') 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 index b29a7a3..b8d6f96 100644 --- 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 @@ -1,8 +1,16 @@ from manimlib.imports import* -class firstScene(ThreeDScene): +#---- visualization of total differential definition +class totaldifferential(ThreeDScene): def construct(self): axes = ThreeDAxes().fade(0.5) + 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).shift([1,0.8,1.5]).scale(2) + 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) @@ -57,17 +65,19 @@ class firstScene(ThreeDScene): self.add_fixed_in_frame_mobjects(label_y) self.add_fixed_in_frame_mobjects(label_z) self.wait(1) + self.play(Write(surface)) + 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(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(FadeOut(surface)) self.play(ShowCreation(d3)) self.add_fixed_in_frame_mobjects(d3_text) self.play(ShowCreation(m1_line)) @@ -88,4 +98,3 @@ class firstScene(ThreeDScene): self.play(ShowCreation(delx)) self.add_fixed_in_frame_mobjects(delx_text) self.wait(1) - -- cgit