From 7cad73c8009d93d2c9ee3aa9167b425e0064d221 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 20 Jun 2020 21:32:51 +0530 Subject: Delete Subspace_Example.py --- .../Vector-Spaces/Subspaces/Subspace_Example.py | 82 ---------------------- 1 file changed, 82 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py deleted file mode 100644 index ada173e..0000000 --- a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py +++ /dev/null @@ -1,82 +0,0 @@ -from manimlib.imports import * -class Subspace_Example(Scene): - def construct(self): - sq = Square(side = 2, color=BLACK).shift(2*LEFT) - sq.set_fill(color=RED,opacity=350) - line1=Line(color=BLACK).shift(2*LEFT) - line1.rotate(np.pi/2) - line2=Line(color=BLACK).shift(2.5*LEFT+0.5*UP) - line2.scale(0.5) - line3=Line(color=BLACK).shift(+1.5*LEFT) - line3.scale(0.5) - a1=TextMobject(r"$a_1$",color=BLACK).scale(0.5).shift(3.4*LEFT+0.7*UP) - a2=TextMobject(r"$a_2$",color=BLACK).scale(0.5).shift(3.4*LEFT+0.3*DOWN) - a3=TextMobject(r"$a_3$",color=BLACK).scale(0.5).shift(0.7*LEFT+0.5*DOWN) - a4=TextMobject(r"$a_4$",color=BLACK).scale(0.5).shift(0.7*LEFT+0.5*UP) - big_rect=Rectangle().scale(3).shift(0.5*DOWN) - big_rect.set_fill(color=GREY,opacity=350) - vec_space=TextMobject("$Vector Space$").scale(0.77).shift(4.5*RIGHT+3.5*UP) - sub=TextMobject(r"$Subspace$",color=BLACK).scale(0.77).shift(3.8*RIGHT+2*UP) - self.play(ShowCreation(vec_space)) - self.play(ShowCreation(big_rect),ShowCreation(sub)) - self.play(ShowCreation(sq),ShowCreation(line1),ShowCreation(line2),ShowCreation(line3),ShowCreation(a1),ShowCreation(a2),ShowCreation(a3),ShowCreation(a4)) - rec = Rectangle(color=BLACK).scale(0.5).shift(1*RIGHT) - rec.rotate(np.pi/2) - rec.set_fill(color=BLUE,opacity=350) - line4=Line(color=BLACK).shift(1*RIGHT).rotate(np.pi/2) - line5=Line(color=BLACK).scale(0.25).shift(0.75*RIGHT) - line6=Line(color=BLACK).scale(0.25).shift(0.5*DOWN+1.25*RIGHT) - b1=TextMobject(r"$b_1$",color=BLACK).scale(0.5).shift(0.3*RIGHT+0.5*UP) - b2=TextMobject(r"$b_2$",color=BLACK).scale(0.5).shift(0.3*RIGHT+0.5*DOWN) - b3=TextMobject(r"$b_3$",color=BLACK).scale(0.5).shift(1.67*RIGHT+0.8*DOWN) - b4=TextMobject(r"$b_4$",color=BLACK).scale(0.5).shift(1.67*RIGHT+0.5*UP) - self.play(ShowCreation(rec),ShowCreation(line4),ShowCreation(line5),ShowCreation(line6),ShowCreation(b1),ShowCreation(b2),ShowCreation(b3),ShowCreation(b4)) - self.wait(1) - text1=TextMobject(r"$a_1 + a_2 = a_3 + a_4$",color=BLACK).scale(0.5).shift(2*LEFT+1.5*DOWN) - text2=TextMobject(r"$b_1 + b_2 = b_3 + b_4$",color=BLACK).scale(0.5).shift(1.5*RIGHT+1.5*DOWN) - self.play(ShowCreation(text1),ShowCreation(text2)) - self.wait(3) - self.play(FadeOut(text1),FadeOut(text2)) - rec.shift(3*LEFT+2.01*DOWN) - line4.shift(3*LEFT+2*DOWN) - line5.shift(3*LEFT+2*DOWN) - line6.shift(3*LEFT+2*DOWN) - b1.shift(3.1*LEFT+2.1*DOWN) - b2.shift(3.1*LEFT+2.1*DOWN) - b3.shift(2.9*LEFT+2*DOWN) - b4.shift(2.9*LEFT+2.3*DOWN) - self.play(ShowCreation(rec),ShowCreation(line4),ShowCreation(line5),ShowCreation(line6),ShowCreation(b1),ShowCreation(b2),ShowCreation(b3),ShowCreation(b4)) - self.wait(2) - - text3=TextMobject(r"$(a_1 + a_2) + (b_1 + b_2) = (a_3 + a_4) + (b_3 + b_4)$",color=BLACK).scale(0.5).shift(2.5*RIGHT+0.5*DOWN) - text3=TextMobject(r"$(a_1 + a_2) + (b_1 + b_2) = (a_3 + a_4) + (b_3 + b_4)$",color=BLACK).scale(0.5).shift(2.5*RIGHT+0.5*DOWN) - text4=TextMobject("Vector Addition",color=BLACK).scale(0.8).shift(2.5*RIGHT+0.5*UP) - self.play(ShowCreation(text3),ShowCreation(text4)) - self.wait(3) - rec.set_fill(color=GREY,opacity=350) - self.play(FadeOut(text3),FadeOut(text4),FadeOut(line4),FadeOut(line5),FadeOut(line6),FadeOut(rec),FadeOut(b4),FadeOut(b3),FadeOut(b2),FadeOut(b1)) - sq1=Square(color=BLACK).scale(0.5).shift(1.5*LEFT+1.5*UP) - sq1.set_fill(color=RED,opacity=350) - sq2=Square(color=BLACK).scale(0.5).shift(1.5*LEFT+1.5*DOWN) - sq2.set_fill(color=RED,opacity=350) - rec1=Rectangle(height=0.5,width=1,color=BLACK).shift(2.5*LEFT+1.2*UP) - rec1.set_fill(color=RED,opacity=350) - rec2=Rectangle(height=1.5,width=1,color=BLACK) - rec2.set_fill(color=RED,opacity=350).shift(2.5*LEFT+1.5*DOWN) - self.play(ShowCreation(sq1),ShowCreation(sq2),ShowCreation(rec1),ShowCreation(rec2)) - a=TextMobject(r"$a_1$",color=BLACK).scale(0.5).shift(3.4*LEFT+1.2*UP) - b=TextMobject(r"$a_2$",color=BLACK).scale(0.5).shift(3.4*LEFT+1.4*DOWN) - c=TextMobject(r"$a_3$",color=BLACK).scale(0.5).shift(0.7*LEFT+1.4*DOWN) - d=TextMobject(r"$a_4$",color=BLACK).scale(0.5).shift(0.7*LEFT+1.4*UP) - self.play(ShowCreation(a),ShowCreation(b),ShowCreation(c),ShowCreation(d)) - self.wait(2.3) - text4=TextMobject("Scalar Multiplication",color=BLACK).scale(0.8).shift(2.5*RIGHT+0.5*UP) - text5=TextMobject(r"$\implies 2(a_1 + a_2) = 2(a_3 + a_4)$",color=BLACK).scale(0.5).shift(2*RIGHT+0.5*DOWN) - text6=TextMobject(r"$(a_1 + a_1) + (a_2 + a_2) = (a_3 + a_3) + (a_4 +a_4)$",color=BLACK).scale(0.5).shift(2.5*RIGHT) - self.play(ShowCreation(text4),ShowCreation(text5),ShowCreation(text6)) - self.wait(3) - - - - - -- cgit From 48f264dcde24c776f501f6e8f16d5da6aa47ba4d Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 20 Jun 2020 21:34:58 +0530 Subject: Add files via upload --- .../Vector-Spaces/Subspaces/Subspace_Example.py | 86 ++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py new file mode 100644 index 0000000..d87cd89 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py @@ -0,0 +1,86 @@ +from manimlib.imports import * +class Subspace_Example(Scene): + def construct(self): + sq = Square(side = 2, color=BLACK).shift(2*LEFT) + sq.set_fill(color=RED,opacity=350) + line1=Line(color=BLACK).shift(2*LEFT) + line1.rotate(np.pi/2) + line2=Line(color=BLACK).shift(2.5*LEFT+0.5*UP) + line2.scale(0.5) + line3=Line(color=BLACK).shift(+1.5*LEFT) + line3.scale(0.5) + a1=TextMobject(r"$a_1$",color=BLACK).scale(0.5).shift(3.4*LEFT+0.7*UP) + a2=TextMobject(r"$a_2$",color=BLACK).scale(0.5).shift(3.4*LEFT+0.3*DOWN) + a3=TextMobject(r"$a_3$",color=BLACK).scale(0.5).shift(0.7*LEFT+0.5*DOWN) + a4=TextMobject(r"$a_4$",color=BLACK).scale(0.5).shift(0.7*LEFT+0.5*UP) + big_rect1 = Rectangle().scale(3.3).shift(0.3*DOWN) + big_rect1.set_fill(color=GOLD,opacity=350) + + + big_rect2=Rectangle().scale(2.7).shift(0.5*DOWN) + big_rect2.set_fill(color=GREY,opacity=350) + vec_space=TextMobject("$Vector Space$",color=BLACK).scale(0.73).shift(4.65*RIGHT+2.6*UP) + sub=TextMobject(r"$Subspace$",color=BLACK).scale(0.73).shift(3.8*RIGHT+1.7*UP) + self.play(ShowCreation(big_rect1),ShowCreation(vec_space)) + self.play(ShowCreation(big_rect2),ShowCreation(sub)) + self.play(ShowCreation(sq),ShowCreation(line1),ShowCreation(line2),ShowCreation(line3),ShowCreation(a1),ShowCreation(a2),ShowCreation(a3),ShowCreation(a4)) + rec = Rectangle(color=BLACK).scale(0.5).shift(1*RIGHT) + rec.rotate(np.pi/2) + rec.set_fill(color=BLUE,opacity=350) + line4=Line(color=BLACK).shift(1*RIGHT).rotate(np.pi/2) + line5=Line(color=BLACK).scale(0.25).shift(0.75*RIGHT) + line6=Line(color=BLACK).scale(0.25).shift(0.5*DOWN+1.25*RIGHT) + b1=TextMobject(r"$b_1$",color=BLACK).scale(0.5).shift(0.3*RIGHT+0.5*UP) + b2=TextMobject(r"$b_2$",color=BLACK).scale(0.5).shift(0.3*RIGHT+0.5*DOWN) + b3=TextMobject(r"$b_3$",color=BLACK).scale(0.5).shift(1.67*RIGHT+0.8*DOWN) + b4=TextMobject(r"$b_4$",color=BLACK).scale(0.5).shift(1.67*RIGHT+0.5*UP) + self.play(ShowCreation(rec),ShowCreation(line4),ShowCreation(line5),ShowCreation(line6),ShowCreation(b1),ShowCreation(b2),ShowCreation(b3),ShowCreation(b4)) + self.wait(1) + text1=TextMobject(r"$a_1 + a_2 = a_3 + a_4$",color=BLACK).scale(0.5).shift(2*LEFT+1.5*DOWN) + text2=TextMobject(r"$b_1 + b_2 = b_3 + b_4$",color=BLACK).scale(0.5).shift(1.5*RIGHT+1.5*DOWN) + self.play(ShowCreation(text1),ShowCreation(text2)) + self.wait(3) + self.play(FadeOut(text1),FadeOut(text2)) + rec.shift(3*LEFT+2.01*DOWN) + line4.shift(3*LEFT+2*DOWN) + line5.shift(3*LEFT+2*DOWN) + line6.shift(3*LEFT+2*DOWN) + b1.shift(3.1*LEFT+2.1*DOWN) + b2.shift(3.1*LEFT+2.1*DOWN) + b3.shift(2.9*LEFT+2*DOWN) + b4.shift(2.9*LEFT+2.3*DOWN) + self.play(ShowCreation(rec),ShowCreation(line4),ShowCreation(line5),ShowCreation(line6),ShowCreation(b1),ShowCreation(b2),ShowCreation(b3),ShowCreation(b4)) + self.wait(2) + + text3=TextMobject(r"$(a_1 + a_2) + (b_1 + b_2) = (a_3 + a_4) + (b_3 + b_4)$",color=BLACK).scale(0.5).shift(2.5*RIGHT+0.5*DOWN) + text3=TextMobject(r"$(a_1 + a_2) + (b_1 + b_2) = (a_3 + a_4) + (b_3 + b_4)$",color=BLACK).scale(0.5).shift(2.5*RIGHT+0.5*DOWN) + text4=TextMobject("Vector Addition",color=BLACK).scale(0.8).shift(2.5*RIGHT+0.5*UP) + self.play(ShowCreation(text3),ShowCreation(text4)) + self.wait(3) + rec.set_fill(color=GREY,opacity=350) + self.play(FadeOut(text3),FadeOut(text4),FadeOut(line4),FadeOut(line5),FadeOut(line6),FadeOut(rec),FadeOut(b4),FadeOut(b3),FadeOut(b2),FadeOut(b1)) + sq1=Square(color=BLACK).scale(0.5).shift(1.5*LEFT+1.5*UP) + sq1.set_fill(color=RED,opacity=350) + sq2=Square(color=BLACK).scale(0.5).shift(1.5*LEFT+1.5*DOWN) + sq2.set_fill(color=RED,opacity=350) + rec1=Rectangle(height=0.5,width=1,color=BLACK).shift(2.5*LEFT+1.2*UP) + rec1.set_fill(color=RED,opacity=350) + rec2=Rectangle(height=1.5,width=1,color=BLACK) + rec2.set_fill(color=RED,opacity=350).shift(2.5*LEFT+1.5*DOWN) + self.play(ShowCreation(sq1),ShowCreation(sq2),ShowCreation(rec1),ShowCreation(rec2)) + a=TextMobject(r"$a_1$",color=BLACK).scale(0.5).shift(3.4*LEFT+1.2*UP) + b=TextMobject(r"$a_2$",color=BLACK).scale(0.5).shift(3.4*LEFT+1.4*DOWN) + c=TextMobject(r"$a_3$",color=BLACK).scale(0.5).shift(0.7*LEFT+1.4*DOWN) + d=TextMobject(r"$a_4$",color=BLACK).scale(0.5).shift(0.7*LEFT+1.4*UP) + self.play(ShowCreation(a),ShowCreation(b),ShowCreation(c),ShowCreation(d)) + self.wait(2.3) + text4=TextMobject("Scalar Multiplication",color=BLACK).scale(0.8).shift(2.5*RIGHT+0.5*UP) + text5=TextMobject(r"$\implies 2(a_1 + a_2) = 2(a_3 + a_4)$",color=BLACK).scale(0.5).shift(2*RIGHT+0.5*DOWN) + text6=TextMobject(r"$(a_1 + a_1) + (a_2 + a_2) = (a_3 + a_3) + (a_4 +a_4)$",color=BLACK).scale(0.5).shift(2.5*RIGHT) + self.play(ShowCreation(text4),ShowCreation(text5),ShowCreation(text6)) + self.wait(3) + + + + + -- cgit From 2c81d2ccbcd01dec465c5f1186fa65b3516c56dd Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 20 Jun 2020 21:36:05 +0530 Subject: Add files via upload --- .../Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 | Bin 0 -> 608079 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 new file mode 100644 index 0000000..46e1f3b Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 differ -- cgit From adbdd989f5d27461c457ab21601e907241ca0fd8 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 20 Jun 2020 21:37:02 +0530 Subject: Delete Subspace_Example.gif --- .../Vector-Spaces/Subspaces/gifs/Subspace_Example.gif | Bin 647405 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif deleted file mode 100644 index 32b02be..0000000 Binary files a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif and /dev/null differ -- cgit From 75b6e721aecb4aea903b560f4c584f751b269155 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 20 Jun 2020 21:56:47 +0530 Subject: Add files via upload --- ...ate_Symmetry_and_Positivity_of_Inner_Product.py | 141 +++++++++++++++++ .../Inner_Product_Space_Example.py | 175 +++++++++++++++++++++ .../Inner-Product_Spaces/Inner_product.py | 28 ++++ .../Instances_of_Topological_Spaces.py | 36 +++++ .../Interpretation_of_Norm_as_Length.py | 42 +++++ .../Linearity_of_Inner_Product.py | 28 ++++ .../Inner-Product_Spaces/Vector_Projection.py | 43 +++++ 7 files changed, 493 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Conjugate_Symmetry_and_Positivity_of_Inner_Product.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Space_Example.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_product.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Instances_of_Topological_Spaces.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Interpretation_of_Norm_as_Length.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Linearity_of_Inner_Product.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Vector_Projection.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Conjugate_Symmetry_and_Positivity_of_Inner_Product.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Conjugate_Symmetry_and_Positivity_of_Inner_Product.py new file mode 100644 index 0000000..1d84842 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Conjugate_Symmetry_and_Positivity_of_Inner_Product.py @@ -0,0 +1,141 @@ +from manimlib.imports import * +VECTORS = [[0, 2], + [1, 1], + [0, -2], + [1, -1], + [2, -2], + [2, 2], + [2, 2], + [-2, -1], + [3, 4]] +class Scene1(LinearTransformationScene): + CONFIG = { + "include_background_plane": True, + "include_foreground_plane": False, + "show_coordinates": True, + "show_basis_vectors": False, + "basis_vector_stroke_width": 3, + } + def construct(self): + text1 = TextMobject(r"\text{$u$}",r"\text{ = $0 + 2i$, }",r"\text{$v$}",r"\text{ = $1 + i$}").scale(0.6).shift(3.5*UP+4*LEFT) + text1[0].set_color(YELLOW) + text1[2].set_color(RED) + text1.add_background_rectangle() + self.play(ShowCreation(text1)) + text2 = TextMobject(r"\text{$\overline{u}$}",r"\text{ = $0 - 2i$, }",r"\text{$\overline{v}$}",r"\text{ = $1 - i$}").scale(0.6).shift(3*UP+4*LEFT) + text2[0].set_color(YELLOW) + text2[2].set_color(RED) + text2.add_background_rectangle() + self.play(ShowCreation(text2)) + self.wait(2) + v1 = self.add_vector(VECTORS[0],color = YELLOW, stroke_width = 3.5) + u = TextMobject(r"$u$",color=YELLOW).shift(0.3*LEFT+2*UP).scale(0.6) + self.play(ShowCreation(u)) + v1b = self.add_vector(VECTORS[2],color = YELLOW, stroke_width = 3.5) + ub = TextMobject(r"$\overline{u}$",color=YELLOW).shift(2*DOWN+0.3*LEFT).scale(0.6) + self.play(ShowCreation(ub)) + self.wait(2) + v2 = self.add_vector(VECTORS[1],color = RED, stroke_width = 3.5) + v = TextMobject(r"$v$",color=RED).shift(1.2*RIGHT+1*UP).scale(0.6) + self.play(ShowCreation(v)) + v2b = self.add_vector(VECTORS[3],color = RED, stroke_width = 3.5) + vb = TextMobject(r"$\overline{v}$",color=RED).shift(1.2*RIGHT+1*DOWN).scale(0.6) + self.play(ShowCreation(vb)) + text3 = TextMobject(r"\text{$$}",r"\text{ = }",r"\text{$\overline{u}$",r"\text{$\cdot$}",r"\text{$v$}",r"\text{ = }",r"\text{$2 - 2i$}").shift(2.5*UP+3.7*LEFT).scale(0.6) + text3[0].set_color(BLUE) + text3[2].set_color(YELLOW) + text3[4].set_color(RED) + text3.add_background_rectangle() + self.play(ShowCreation(text3)) + self.wait(2) + text4 = TextMobject(r"\text{$<\overline{u, v}>$",r"\text{ = }",r"\text{$\overline{u}$",r"\text{$\cdot$}",r"\text{$v$}",r"\text{ = }",r"\text{$2 + 2i$}").shift(2*UP+3.7*LEFT).scale(0.6) + text4[0].set_color(BLUE) + text4[2].set_color(YELLOW) + text4[4].set_color(RED) + text4.add_background_rectangle() + line = Line(stroke_width = 1.5).scale(0.33).shift(2.2*UP+3.54*LEFT) + self.play(ShowCreation(text4),ShowCreation(line)) + self.wait(2) + self.play(FadeOut(v1),FadeOut(v1b),FadeOut(v2),FadeOut(v2b),FadeOut(u),FadeOut(ub),FadeOut(v),FadeOut(vb)) + v3 = self.add_vector(VECTORS[4],color = BLUE, stroke_width = 3.5) + uv = TextMobject(r"$\overline{u}\cdot v$",color=BLUE).shift(2.4*RIGHT+2.1*DOWN).scale(0.6) + self.play(ShowCreation(uv)) + v3b = self.add_vector(VECTORS[5],color = BLUE, stroke_width = 3.5) + uvb = TextMobject(r"$\overline{\overline{u}\cdot v}$",color=BLUE).shift(2.4*RIGHT+2.1*UP).scale(0.6) + self.play(ShowCreation(uvb)) + self.wait(2) + text5 = TextMobject(r"\text{$$}",r"\text{ = }",r"\text{$\overline{v}$",r"\text{$\cdot$}",r"\text{$u$}",r"\text{ = }",r"\text{$2 + 2i$}").shift(1.5*UP+3.7*LEFT).scale(0.6) + text5[0].set_color(MAROON_B) + text5[2].set_color(RED) + text5[4].set_color(YELLOW) + text5.add_background_rectangle() + self.play(ShowCreation(text5)) + self.wait(2) + v4 = self.add_vector(VECTORS[5],color = MAROON_B, stroke_width = 3.5) + vu = TextMobject(r"$\overline{v}\cdot u$",color=MAROON_B).shift(1.3*RIGHT+2.1*UP).scale(0.6) + self.play(ShowCreation(vu)) + self.play(FadeOut(uvb)) + self.wait(2) + text6 = TextMobject(r"\text{$<\overline{u, v}>$",r"\text{ = }",r"\text{$$").scale(0.6).shift(0.8*UP+4.2*LEFT) + text6[0].set_color(BLUE) + text6[2].set_color(MAROON_B) + text6.add_background_rectangle() + self.play(ShowCreation(text6)) + rect = Rectangle(height = 0.7,width = 3.5) + rect.surround(text6) + self.play(ShowCreation(rect)) + self.wait(3) + self.play(FadeOut(line),FadeOut(text1),FadeOut(text2),FadeOut(text3),FadeOut(text4),FadeOut(text5),FadeOut(text6),FadeOut(v4),FadeOut(vu),FadeOut(v3),FadeOut(uv),FadeOut(rect),FadeOut(v3b)) + + text7 = TextMobject(r"\text{$u$}",r"\text{ = $(1 + i) > 0$}").scale(0.6).shift(3.5*UP+4.5*LEFT) + text7[0].set_color(YELLOW) + text7.add_background_rectangle() + self.play(ShowCreation(text7)) + v5 = self.add_vector(VECTORS[1],color = YELLOW, stroke_width = 3.5) + u = TextMobject(r"$u$",color=YELLOW).shift(1.2*RIGHT+1*UP).scale(0.6) + self.play(ShowCreation(u)) + self.wait(1.5) + text8 = TextMobject(r"\text{$$}",r"\text{ = $(0 + 2i) > 0$ }").scale(0.6).shift(2.7*UP+4*LEFT) + text8[0].set_color(GREEN) + text8.add_background_rectangle() + rect1 = Rectangle(height = 0.55, width = 3.3) + rect1.surround(text8) + self.play(ShowCreation(text8),ShowCreation(rect1)) + self.wait(2) + v6 = self.add_vector(VECTORS[0],color = GREEN, stroke_width = 3.5) + uu = TextMobject(r"$$",color=GREEN).shift(0.8*LEFT+1.9*UP).scale(0.6) + self.play(ShowCreation(uu)) + text9 = TextMobject(r"\text{$v$}",r"\text{ = $(-2 - i) < 0$}").scale(0.6).shift(1.5*UP+4.4*LEFT) + text9[0].set_color(RED) + text9.add_background_rectangle() + self.play(ShowCreation(text9)) + self.wait(1.5) + v7 = self.add_vector(VECTORS[7],color = RED, stroke_width = 3.5) + v = TextMobject(r"$v$",color=RED).shift(2.2*LEFT+1*DOWN).scale(0.6) + self.play(ShowCreation(v)) + self.wait(1.5) + text10 = TextMobject(r"\text{$$}",r"\text{ = $(3 + 4i) > 0$ }").scale(0.6).shift(0.7*UP+4*LEFT) + text10[0].set_color(BLUE) + text10.add_background_rectangle() + rect2 = Rectangle(height=0.55,width=3.3) + rect2.surround(text10) + self.play(ShowCreation(text10),ShowCreation(rect2)) + self.wait(2) + v8 = self.add_vector(VECTORS[8],color = BLUE, stroke_width = 3.5) + vv = TextMobject(r"$$",color=BLUE).shift(2.1*RIGHT+3.8*UP).scale(0.6) + self.play(ShowCreation(vv)) + self.wait(4) + + + + + + + + + + + + + + diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Space_Example.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Space_Example.py new file mode 100644 index 0000000..1f98bad --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Space_Example.py @@ -0,0 +1,175 @@ +from manimlib.imports import * +from scipy import sin,cos +class Inner_Product_Space_Example(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 5, + "y_min" : 0, + "y_max" : 6, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color":LIGHT_GRAY, + "x_labeled_nums" : list(range(6)), + "y_labeled_nums" : list(range(6)) + } + def construct(self): + self.setup_axes(animate=True) + curve1 = self.get_graph(lambda x : sin(x), x_min=0,x_max=2.3,color=RED) + curve2 = self.get_graph(lambda x : x, x_min=0,x_max=2.3,color=DARK_BLUE) + curve3 = self.get_graph(lambda x : 1.4, x_min=0,x_max=2.3,color=GREEN) + text1 = TextMobject(r"$f(x)$").scale(0.5).shift(1.77*DOWN+0.55*RIGHT) + + text2 = TextMobject(r"$g(x)$").scale(0.5).shift(0.15*DOWN+0.55*RIGHT) + text3 = TextMobject(r"$h(x)$").scale(0.5).shift(1.03*DOWN+0.55*RIGHT) + + self.play(ShowCreation(curve1),ShowCreation(text1)) + self.wait(1) + self.play(ShowCreation(curve2),ShowCreation(text2)) + self.wait(1) + self.play(ShowCreation(curve3),ShowCreation(text3)) + self.wait(2) + curve4 = self.get_graph(lambda x : sin(x) + x, x_min=0,x_max=2.3,color=YELLOW) + text4 = TextMobject(r"$f(x) + g(x)$").scale(0.5).shift(0.6*UP+1*RIGHT) + self.wait(1.5) + + self.play(ShowCreation(curve4),ShowCreation(text4),FadeOut(curve2),FadeOut(text2),FadeOut(curve1),FadeOut(text1)) + self.wait(1.5) + text5 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} (f(x) + g(x))h(x)$ $dx$}").scale(0.57).shift(4*RIGHT+3.5*UP) + text5[1].set_color(ORANGE) + self.play(ShowCreation(text5)) + + curve5 = self.get_graph(lambda x : (sin(x) + x)*1.6, x_min=0,x_max=2.3,color=ORANGE) + text6 = TextMobject(r"$(f(x) + g(x))\cdot h(x)$").scale(0.5).shift(2.2*UP+1.4*RIGHT) + area1 = self.get_area(curve5,0,2.3) + area1.set_color(ORANGE) + self.wait(1) + self.play(FadeOut(curve4),FadeOut(text4),FadeOut(curve3),FadeOut(text3),ShowCreation(curve5),ShowCreation(text6),ShowCreation(area1)) + self.wait(2) + text7 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} (f(x)h(x)$ $dx$}").scale(0.57).shift(5*RIGHT+3*UP) + text7[1].set_color(BLUE) + self.play(ShowCreation(text7)) + self.wait(1.5) + curve6 = self.get_graph(lambda x : (sin(x))*1.6, x_min=0,x_max=2.3,color=BLUE) + text8 = TextMobject(r"$f(x)\cdot h(x)$").scale(0.5).shift(1.4*DOWN+0.8*RIGHT) + area2 = self.get_area(curve6,0,2.3) + self.play(ShowCreation(curve6),ShowCreation(text8),ShowCreation(area2)) + self.wait(1.5) + text9 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} (g(x)h(x)$ $dx$}").scale(0.57).shift(5*RIGHT+2.5*UP) + text9[1].set_color(MAROON_B) + self.play(ShowCreation(text9)) + self.wait(1.5) + curve7 = self.get_graph(lambda x : x*1.6, x_min=0,x_max=2.3,color=MAROON_B) + text10 = TextMobject(r"$g(x)\cdot h(x)$").scale(0.5).shift(0.8*RIGHT+1*UP) + area3 = self.get_area(curve7,0,2.3) + area3.set_color(MAROON_B) + self.play(ShowCreation(curve7),ShowCreation(text10),ShowCreation(area3)) + self.wait(2.6) + curve8 = self.get_graph(lambda x : (sin(x))*1.6 + x*1.6, x_min=0,x_max=2.3,color=RED_C) + area4 = self.get_area(curve8,0,2.3) + area4.set_color(RED_C) + text11 = TextMobject(r"$f(x)h(x) + g(x)h(x)$").scale(0.5).shift(2.2*UP + 1.4*RIGHT) + self.play(FadeOut(curve6),FadeOut(text8),FadeOut(curve7),FadeOut(text10),FadeOut(area2),FadeOut(area3),ShowCreation(curve8),ShowCreation(area4)) + self.wait(1) + self.play(Transform(text6,text11)) + self.wait(1.7) + text12 = TextMobject(r"$$ = $$ + $$").scale(0.465).shift(0.7*UP+4*RIGHT) + rect1 = Rectangle(height=0.5) + rect1.surround(text12) + self.play(ShowCreation(text12),ShowCreation(rect1)) + self.wait(3) + self.play(FadeOut(text6),FadeOut(text5),FadeOut(text7),FadeOut(text9),FadeOut(text12),FadeOut(rect1),FadeOut(curve8),FadeOut(area4),FadeOut(text11),FadeOut(curve5),FadeOut(area1)) + + curve2.set_color(ORANGE) + self.play(ShowCreation(curve1),ShowCreation(text1)) + self.wait(1) + self.play(ShowCreation(curve2),ShowCreation(text2)) + self.wait(2) + curve9 = self.get_graph(lambda x : 2*sin(x), x_min=0,x_max=2.3,color=GREEN) + text13 = TextMobject(r"$2f(x)$").scale(0.5).shift(1.1*DOWN+0.55*RIGHT) + self.play(Transform(curve1,curve9),Transform(text1,text13)) + self.wait(1.5) + + text14 = TextMobject(r"\text{$<2f(x), g(x)>$ = ",r"\text{$\int_{a}^{b} (2f(x))g(x)$ $dx$}").scale(0.57).shift(4*RIGHT+3.5*UP) + text14[1].set_color(YELLOW) + self.play(ShowCreation(text14)) + self.wait(2.2) + curve10 = self.get_graph(lambda x : 2*sin(x)*x, x_min=0,x_max=2.3,color=YELLOW) + text15 = TextMobject(r"$2f(x)\cdot g(x)$").scale(0.5).shift(1*RIGHT+0.97*UP) + area5 = self.get_area(curve10,0,2.3) + area5.set_color(YELLOW) + self.play(ShowCreation(area5),ShowCreation(curve10),ShowCreation(text15),FadeOut(curve1),FadeOut(text1),FadeOut(curve2),FadeOut(text2)) + self.wait(2) + text16 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} f(x)g(x)$ $dx$}").scale(0.57).shift(3.8*RIGHT+2.9*UP) + text16[1].set_color(TEAL) + self.play(ShowCreation(text16)) + self.wait(1.7) + curve11 = self.get_graph(lambda x : sin(x)*x, x_min=0,x_max=2.3,color=TEAL) + area6 = self.get_area(curve11,0,2.3) + area6.set_color(TEAL) + text17 = TextMobject(r"$f(x)\cdot g(x)$").scale(0.5).shift(0.9*RIGHT+0.7*DOWN) + self.play(ShowCreation(curve11),ShowCreation(text17),ShowCreation(area6)) + self.wait(2) + + text18 = TextMobject(r"\text{$2 $ = ",r"\text{$2 \int_{a}^{b} f(x)g(x)$ $dx$}").scale(0.57).shift(4*RIGHT+2.3*UP) + text18[1].set_color(DARK_BLUE) + self.play(ShowCreation(text18)) + self.wait(2) + curve12 = self.get_graph(lambda x : 2*sin(x)*x, x_min=0,x_max=2.3,color=DARK_BLUE) + area7 = self.get_area(curve12,0,2.3) + area7.set_color(DARK_BLUE) + text19 = TextMobject(r"= $2( f(x)\cdot g(x) )$").scale(0.5).shift(2.5*RIGHT+0.97*UP) + self.play(ShowCreation(curve12),ShowCreation(area7),ShowCreation(text19),FadeOut(text17),FadeOut(area6),FadeOut(curve11)) + + self.wait(2.5) + text20 = TextMobject(r"$<2f(x), g(x)>$ = $2$").scale(0.57).shift(0.6*DOWN+4*RIGHT) + rect2 = Rectangle(height=0.5) + rect2.surround(text20) + self.play(ShowCreation(text20),ShowCreation(rect2)) + self.wait(3) + + self.play(FadeOut(text14),FadeOut(text15),FadeOut(text19),FadeOut(text16),FadeOut(text18),FadeOut(rect2),FadeOut(curve10),FadeOut(area5),FadeOut(curve12),FadeOut(area7),FadeOut(text20)) + curve1 = self.get_graph(lambda x : sin(x), x_min=0,x_max=2.3,color=YELLOW) + text1 = TextMobject(r"$f(x)$").scale(0.5).shift(1.77*DOWN+0.55*RIGHT) + self.play(ShowCreation(curve1),ShowCreation(text1)) + self.wait(1.5) + self.play(ShowCreation(curve2),ShowCreation(text2)) + self.wait(1.7) + text21 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} f(x)g(x)$ $dx$}").scale(0.57).shift(3.5*RIGHT+3*UP) + text21[1].set_color(GREEN) + self.play(ShowCreation(text21)) + self.wait(2) + curve13 = self.get_graph(lambda x : sin(x)*x, x_min=0,x_max=2.3,color=GREEN) + area8 = self.get_area(curve13,0,2.3) + area8.set_color(GREEN) + text22 = TextMobject(r"$f(x)\cdot g(x)$").scale(0.5).shift(0.8*RIGHT+0.7*DOWN) + self.play(ShowCreation(curve13),ShowCreation(area8),ShowCreation(text22),FadeOut(curve1),FadeOut(text1),FadeOut(curve2),FadeOut(text2)) + self.wait(2.2) + curve14 = self.get_graph(lambda x : sin(x)*x, x_min=0,x_max=2.3,color=RED) + area9 = self.get_area(curve14,0,2.3) + area9.set_color(RED) + self.play(ShowCreation(curve14),ShowCreation(area9)) + text23 = TextMobject(r"= $\overline{f(x)\cdot g(x)}$").scale(0.5).shift(0.7*DOWN+2.1*RIGHT) + self.play(ShowCreation(text23)) + self.wait(2) + text24 = TextMobject(r"For all the real functions").scale(0.5).shift(2*RIGHT+2*UP) + text25 = TextMobject(r"$<\overline{f(x), g(x)}>$ = $$").scale(0.5).shift(2*RIGHT+1.4*UP) + rect3 = Rectangle(height=0.7) + rect3.surround(text25) + self.play(ShowCreation(text24),ShowCreation(text25),ShowCreation(rect3)) + self.wait(3) + + + + + + + + + + + + + + + + diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_product.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_product.py new file mode 100644 index 0000000..e1344f7 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_product.py @@ -0,0 +1,28 @@ +from manimlib.imports import * +import numpy as np +class InnerProduct(Scene): + def construct(self): + big_box=Rectangle().scale(2.7) + box = Rectangle(height=2,width=2,color=DARK_GREY).set_fill(color=BLUE_B,opacity=350) + arrow1 = Arrow(color=RED).shift(1.8*LEFT+0.5*UP) + arrow2 = Arrow(color=RED).shift(1.8*LEFT+0.5*DOWN) + arrow3 = Arrow(color=GREEN).shift(1.8*RIGHT) + Inner = TextMobject("INNER",color=BLACK).scale(0.65).shift(0.2*UP) + Product = TextMobject("PRODUCT",color=BLACK).scale(0.65).shift(0.2*DOWN) + u = TextMobject(r"$\vec{u}$",color=YELLOW).scale(0.7).shift(2.8*LEFT+0.5*UP) + v = TextMobject(r"$\vec{v}$",color=YELLOW).scale(0.7).shift(2.8*LEFT+0.5*DOWN) + scalar = TextMobject("(Scalar)").scale(0.55).shift(3.3*RIGHT+0.4*DOWN) + u.v = TextMobject(r"$<\vec{u}, \vec{v}>$",color=YELLOW).scale(0.7).shift(3.3*RIGHT) + V = TextMobject("V").scale(0.7).shift(2*UP+3.8*RIGHT) + text = TextMobject(r"The Inner Product is an operation that takes $\vec{u}, \vec{v} \in$ V as inputs and gives a scalar as an output.").scale(0.55).shift(2*DOWN) + self.play(ShowCreation(big_box),ShowCreation(V)) + self.play(ShowCreation(box)) + self.play(ShowCreation(Product),ShowCreation(Inner)) + self.wait(2) + self.play(ShowCreation(arrow1),ShowCreation(u)) + self.play(ShowCreation(arrow2),ShowCreation(v)) + self.wait(1.5) + self.play(ShowCreation(arrow3),ShowCreation(scalar),ShowCreation(u.v)) + self.wait(1) + self.play(ShowCreation(text)) + self.wait(10) diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Instances_of_Topological_Spaces.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Instances_of_Topological_Spaces.py new file mode 100644 index 0000000..2b3cf14 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Instances_of_Topological_Spaces.py @@ -0,0 +1,36 @@ +from manimlib.imports import * +class InnerProduct(Scene): + def construct(self): + + circle1 = Circle(color=DARK_GREY).scale(3.7) + circle1.set_fill(color=GOLD,opacity=350) + square1 = Square(color=DARK_GREY).scale(2.5) + square1.set_fill(color=DARK_BLUE,opacity=350) + square2=Square(color=DARK_GREY).scale(1.6).shift(0.2*DOWN) + square2.rotate(np.pi/4).set_fill(color=YELLOW,opacity=350) + square3 = Square(color=DARK_GREY).scale(1).shift(0.3*DOWN) + square3.set_fill(color=BLACK,opacity=350) + circle2 = Circle(color=DARK_GREY).scale(0.5).shift(0.45*DOWN) + circle2.set_fill(color=MAROON_A,opacity=350) + text1 = TextMobject("Topological Spaces",color=BLACK).scale(0.5).shift(3*UP) + text2 = TextMobject("Metric Spaces",color=BLACK).scale(0.5).shift(2.2*UP) + text3 = TextMobject("Normed",color=BLACK).scale(0.44).shift(1.4*UP) + text4 = TextMobject("Vector Spaces",color=BLACK).scale(0.44).shift(1.17*UP) + text5 = TextMobject("Inner Product",color=WHITE).scale(0.37).shift(0.5*UP) + text6 = TextMobject("Spaces",color=WHITE).scale(0.37).shift(0.27*UP) + text7 = TextMobject("Dot",color=BLACK).scale(0.37).shift(0.3*DOWN) + text8 = TextMobject("Product",color=BLACK).scale(0.32).shift(0.5*DOWN) + + + + + self.play(ShowCreation(circle1),ShowCreation(text1)) + self.wait(1.5) + self.play(ShowCreation(square1),ShowCreation(text2)) + self.wait(1.5) + self.play(ShowCreation(square2),ShowCreation(text3),ShowCreation(text4)) + self.wait(1.5) + self.play(ShowCreation(square3),ShowCreation(text5),ShowCreation(text6)) + self.wait(1.5) + self.play(ShowCreation(circle2),ShowCreation(text7),ShowCreation(text8)) + self.wait(4) diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Interpretation_of_Norm_as_Length.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Interpretation_of_Norm_as_Length.py new file mode 100644 index 0000000..23c568d --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Interpretation_of_Norm_as_Length.py @@ -0,0 +1,42 @@ +from manimlib.imports import * +import numpy as np +class Interpretation_of_norm_as_length(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 5, + "y_min" : 0, + "y_max" : 5, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color":LIGHT_GRAY, + "x_axis_width": 5, + "y_axis_height":5, + "graph_origin" : ORIGIN + 2*DOWN + 2*LEFT, + "enclude_zero_label": False + + } + def construct(self): + self.setup_axes(animate=False) + dot = Dot().scale(0.5) + self.play(ShowCreation(dot)) + origin = TextMobject(r"(0, 0)").scale(0.5).shift(2.5*LEFT+2.2*DOWN) + line1 = self.get_graph(lambda x : x, x_min=0,x_max=2,color=WHITE) + line2 = Line().rotate(np.pi/2).shift(1*DOWN) + text1 = TextMobject(r"$(v_1, 0)$").scale(0.5).shift(2.2*DOWN+0.2*RIGHT) + text2 = TextMobject(r"$(0, v_2)$").scale(0.5).shift(2.5*LEFT) + text3 = TextMobject(r"$(v_1, v_2)$").scale(0.5).shift(0.5*RIGHT) + text4 = TextMobject(r"$| v_1 |$",color=RED_B).scale(0.5).shift(1*LEFT+2.3*DOWN) + text5 = TextMobject(r"$| v_2 |$",color=RED_B).scale(0.5).shift(0.3*RIGHT+1*DOWN) + text6 = TextMobject(r"$\sqrt{{v_1}^2 + {v_2}^2}$",color=RED_B).scale(0.5).rotate(np.pi/4).shift(1.3*LEFT+1*DOWN) + line3 = Line(color=YELLOW).shift(1*LEFT+2*DOWN) + self.play(ShowCreation(line1),ShowCreation(line2),ShowCreation(text1),ShowCreation(text2),ShowCreation(text3),ShowCreation(origin)) + self.wait(1.5) + self.play(ShowCreation(line3),ShowCreation(text4)) + self.wait(1.5) + line2 = Line(color=YELLOW).rotate(np.pi/2).shift(1*DOWN) + self.play(ShowCreation(line2),ShowCreation(text5)) + self.wait(1.5) + line1 = self.get_graph(lambda x : x, x_min=0,x_max=2,color=YELLOW) + self.play(ShowCreation(text6),ShowCreation(line1)) + self.wait(4) + \ No newline at end of file diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Linearity_of_Inner_Product.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Linearity_of_Inner_Product.py new file mode 100644 index 0000000..e1344f7 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Linearity_of_Inner_Product.py @@ -0,0 +1,28 @@ +from manimlib.imports import * +import numpy as np +class InnerProduct(Scene): + def construct(self): + big_box=Rectangle().scale(2.7) + box = Rectangle(height=2,width=2,color=DARK_GREY).set_fill(color=BLUE_B,opacity=350) + arrow1 = Arrow(color=RED).shift(1.8*LEFT+0.5*UP) + arrow2 = Arrow(color=RED).shift(1.8*LEFT+0.5*DOWN) + arrow3 = Arrow(color=GREEN).shift(1.8*RIGHT) + Inner = TextMobject("INNER",color=BLACK).scale(0.65).shift(0.2*UP) + Product = TextMobject("PRODUCT",color=BLACK).scale(0.65).shift(0.2*DOWN) + u = TextMobject(r"$\vec{u}$",color=YELLOW).scale(0.7).shift(2.8*LEFT+0.5*UP) + v = TextMobject(r"$\vec{v}$",color=YELLOW).scale(0.7).shift(2.8*LEFT+0.5*DOWN) + scalar = TextMobject("(Scalar)").scale(0.55).shift(3.3*RIGHT+0.4*DOWN) + u.v = TextMobject(r"$<\vec{u}, \vec{v}>$",color=YELLOW).scale(0.7).shift(3.3*RIGHT) + V = TextMobject("V").scale(0.7).shift(2*UP+3.8*RIGHT) + text = TextMobject(r"The Inner Product is an operation that takes $\vec{u}, \vec{v} \in$ V as inputs and gives a scalar as an output.").scale(0.55).shift(2*DOWN) + self.play(ShowCreation(big_box),ShowCreation(V)) + self.play(ShowCreation(box)) + self.play(ShowCreation(Product),ShowCreation(Inner)) + self.wait(2) + self.play(ShowCreation(arrow1),ShowCreation(u)) + self.play(ShowCreation(arrow2),ShowCreation(v)) + self.wait(1.5) + self.play(ShowCreation(arrow3),ShowCreation(scalar),ShowCreation(u.v)) + self.wait(1) + self.play(ShowCreation(text)) + self.wait(10) diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Vector_Projection.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Vector_Projection.py new file mode 100644 index 0000000..b1724c1 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Vector_Projection.py @@ -0,0 +1,43 @@ +from manimlib.imports import * +VECTORS = [[3,1], + [1,3], + [1.96,0.65]] +class Projection(LinearTransformationScene): + CONFIG = { + "include_background_plane": True, + "include_foreground_plane": False, + "show_coordinates": False, + "show_basis_vectors": False, + "basis_vector_stroke_width": 3, + } + def construct(self): + v1 = self.add_vector(VECTORS[0],color = YELLOW, stroke_width = 3.5) + u = TextMobject(r"$\vec{u}$",color=YELLOW).scale(0.65).shift(3.2*RIGHT,1*UP) + self.play(ShowCreation(u)) + self.wait(0.7) + v2 = self.add_vector(VECTORS[1],color = RED, stroke_width = 3.5) + v = TextMobject(r"$\vec{v}$",color=RED).scale(0.65).shift(1.2*RIGHT,3*UP) + self.play(ShowCreation(v)) + self.wait(0.7) + angle = Arc(radius=0.6).scale(0.5) + theta = TextMobject(r"$\theta$").scale(0.65).shift(0.5*UP+0.5*RIGHT).rotate(np.pi/6) + self.play(ShowCreation(angle),ShowCreation(theta)) + self.wait(1) + line1 = Line().scale(1.25).rotate(np.pi/(2)).shift(1.8*UP+1.47*RIGHT) + line1.rotate(np.pi/8) + self.play(ShowCreation(line1)) + self.wait(1.3) + v3 = self.add_vector(VECTORS[2],color = BLUE, stroke_width = 3.5) + text1 = TextMobject(r"$\vec{v}$cos$\theta$",color=BLUE).scale(0.55).shift(1.25*RIGHT+0.26*UP).rotate(np.pi/9) + self.play(ShowCreation(text1)) + self.wait(2) + text2 = TextMobject(r"\text{Projection on }",r"\text{$\vec{v}$}",r"\text{ onto }",r"\text{$\vec{u}$}",r"\text{ = }",r"\text{$ |\vec{v}|cos\theta$}").scale(0.6).shift(4*RIGHT+3*UP) + text2[1].set_color(RED) + text2[3].set_color(YELLOW) + text2[5].set_color(BLUE) + text2.add_background_rectangle() + self.play(ShowCreation(text2)) + self.wait(4) + + + \ No newline at end of file -- cgit From cd6b1e54d2aa5b00a1268f21ef27c9a9be2580c8 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sun, 21 Jun 2020 21:12:56 +0530 Subject: Add files via upload --- .../Vector-Spaces/Subspaces/Linear_Subspace.py | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py new file mode 100644 index 0000000..868c28b --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py @@ -0,0 +1,37 @@ +from manimlib.imports import * +class Subspace(ThreeDScene): + + + def construct(self): + axes = ThreeDAxes() + self.set_camera_orientation(phi = 80*DEGREES,theta =110*DEGREES) + self.begin_ambient_camera_rotation(rate=0.09) + cube = Cube(stroke_width=5,color=WHITE).shift([1.5,1.5,1.5]).scale(1.5) + cube.set_fill(TEAL) + + cube.set_opacity(0.4) + line = Line(color=MAROON,set_opacity=100).shift([1.5,1.5,1.5]).scale(1.5) + plane1 = Polygon([0,0,3],[3,0,3],[3,3,0],[0,3,0]) + plane1.set_opacity(0.8) + plane1.set_fill(YELLOW) + plane1.set_color(YELLOW) + + + plane2 = Polygon([0,3,3],[3,3,3],[3,0,0],[0,0,0]) + plane2.set_opacity(0.7) + plane2.set_fill(RED) + plane2.set_color(RED) + + vgroup = VGroup(plane1,plane2,line,cube) + vgroup.shift([-1,-1,-1]) + + + self.play(ShowCreation(cube)) + self.play(ShowCreation(plane1)) + self.play(ShowCreation(plane2)) + self.play(ShowCreation(line)) + self.wait(10) + + + + \ No newline at end of file -- cgit From d673d5990567fe5fdb535469d1a29395ef42a0b0 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sun, 21 Jun 2020 22:58:03 +0530 Subject: Delete Linear_Subspace.py --- .../Vector-Spaces/Subspaces/Linear_Subspace.py | 37 ---------------------- 1 file changed, 37 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py deleted file mode 100644 index 868c28b..0000000 --- a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py +++ /dev/null @@ -1,37 +0,0 @@ -from manimlib.imports import * -class Subspace(ThreeDScene): - - - def construct(self): - axes = ThreeDAxes() - self.set_camera_orientation(phi = 80*DEGREES,theta =110*DEGREES) - self.begin_ambient_camera_rotation(rate=0.09) - cube = Cube(stroke_width=5,color=WHITE).shift([1.5,1.5,1.5]).scale(1.5) - cube.set_fill(TEAL) - - cube.set_opacity(0.4) - line = Line(color=MAROON,set_opacity=100).shift([1.5,1.5,1.5]).scale(1.5) - plane1 = Polygon([0,0,3],[3,0,3],[3,3,0],[0,3,0]) - plane1.set_opacity(0.8) - plane1.set_fill(YELLOW) - plane1.set_color(YELLOW) - - - plane2 = Polygon([0,3,3],[3,3,3],[3,0,0],[0,0,0]) - plane2.set_opacity(0.7) - plane2.set_fill(RED) - plane2.set_color(RED) - - vgroup = VGroup(plane1,plane2,line,cube) - vgroup.shift([-1,-1,-1]) - - - self.play(ShowCreation(cube)) - self.play(ShowCreation(plane1)) - self.play(ShowCreation(plane2)) - self.play(ShowCreation(line)) - self.wait(10) - - - - \ No newline at end of file -- cgit From 7bdd0b8d51fbc7fb700b6d8d1a4e2cfa3a750f76 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Wed, 24 Jun 2020 13:14:22 +0530 Subject: Add files via upload --- .../Vector_Addition_and_Scalar_Multiplication.mp4 | Bin 0 -> 2830120 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/gifs/Vector_Addition_and_Scalar_Multiplication.mp4 (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/gifs/Vector_Addition_and_Scalar_Multiplication.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/gifs/Vector_Addition_and_Scalar_Multiplication.mp4 new file mode 100644 index 0000000..8acbb81 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/gifs/Vector_Addition_and_Scalar_Multiplication.mp4 differ -- cgit From f911f3d1f22f6e3d1cb3fbf37490d9803962ddbd Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Wed, 24 Jun 2020 13:15:31 +0530 Subject: Delete Vector_Addition_and_Scalar_Multiplication.gif --- .../Vector_Addition_and_Scalar_Multiplication.gif | Bin 4954730 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/gifs/Vector_Addition_and_Scalar_Multiplication.gif (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/gifs/Vector_Addition_and_Scalar_Multiplication.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/gifs/Vector_Addition_and_Scalar_Multiplication.gif deleted file mode 100644 index ed65f8a..0000000 Binary files a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/gifs/Vector_Addition_and_Scalar_Multiplication.gif and /dev/null differ -- cgit From 8d1887302b06ed1299a6eaff1492cab5ce4e7e59 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Wed, 24 Jun 2020 13:49:18 +0530 Subject: Add files via upload --- ...ugate_Symmetry_and_Positivity_of_Inner_Product.mp4 | Bin 0 -> 2989426 bytes .../Inner-Product_Spaces/gifs2/InnerProduct.gif | Bin 0 -> 219685 bytes .../gifs2/Inner_Product_Space_Example.mp4 | Bin 0 -> 3450822 bytes .../gifs2/Instances_of_Topological_Spaces.gif | Bin 0 -> 513000 bytes .../gifs2/Interpretation_of_norm_as_length.gif | Bin 0 -> 98767 bytes .../gifs2/Linerity_of_Inner_Product.mp4 | Bin 0 -> 3600375 bytes .../Inner-Product_Spaces/gifs2/Projection.gif | Bin 0 -> 1093343 bytes 7 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Conjugate_Symmetry_and_Positivity_of_Inner_Product.mp4 create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/InnerProduct.gif create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Instances_of_Topological_Spaces.gif create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Interpretation_of_norm_as_length.gif create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Linerity_of_Inner_Product.mp4 create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Projection.gif (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Conjugate_Symmetry_and_Positivity_of_Inner_Product.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Conjugate_Symmetry_and_Positivity_of_Inner_Product.mp4 new file mode 100644 index 0000000..6b44c55 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Conjugate_Symmetry_and_Positivity_of_Inner_Product.mp4 differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/InnerProduct.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/InnerProduct.gif new file mode 100644 index 0000000..55b6546 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/InnerProduct.gif differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 new file mode 100644 index 0000000..dee494f Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Instances_of_Topological_Spaces.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Instances_of_Topological_Spaces.gif new file mode 100644 index 0000000..82d5c75 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Instances_of_Topological_Spaces.gif differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Interpretation_of_norm_as_length.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Interpretation_of_norm_as_length.gif new file mode 100644 index 0000000..9eda7c5 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Interpretation_of_norm_as_length.gif differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Linerity_of_Inner_Product.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Linerity_of_Inner_Product.mp4 new file mode 100644 index 0000000..a1e7b29 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Linerity_of_Inner_Product.mp4 differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Projection.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Projection.gif new file mode 100644 index 0000000..c32fd6b Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Projection.gif differ -- cgit From 90b83827c8f46cd6705538c452a9872ebe2e7b2e Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Wed, 24 Jun 2020 14:27:13 +0530 Subject: Add files via upload --- .../Subspaces/gifs/Basis_of_a_Subspace.mp4 | Bin 0 -> 10735096 bytes .../Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif | Bin 0 -> 4458192 bytes .../Subspaces/gifs/Subspace_Example.gif | Bin 0 -> 716776 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Basis_of_a_Subspace.mp4 create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Basis_of_a_Subspace.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Basis_of_a_Subspace.mp4 new file mode 100644 index 0000000..d384f80 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Basis_of_a_Subspace.mp4 differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif new file mode 100644 index 0000000..bec7e5f Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif new file mode 100644 index 0000000..ffe71a8 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif differ -- cgit From 10641b7f85bb04b9e680b48881006bfadd67cbed Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Wed, 24 Jun 2020 14:44:01 +0530 Subject: Add files via upload --- .../Function_Scalar_Multiplication.py | 62 +++++++++++++++ .../Function_Space_Addition.py | 89 ++++++++++++++++++++++ .../Integral_Properties.py | 77 +++++++++++++++++++ 3 files changed, 228 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Function_Scalar_Multiplication.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Function_Space_Addition.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Integral_Properties.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Function_Scalar_Multiplication.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Function_Scalar_Multiplication.py new file mode 100644 index 0000000..ac74792 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Function_Scalar_Multiplication.py @@ -0,0 +1,62 @@ +from manimlib.imports import * +from scipy import exp +class FunctionScalarMultiplication(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color":LIGHT_GRAY, + "graph_origin": ORIGIN, + } + def construct(self): + self.setup_axes(animate = True) + curve1 = self.get_graph(lambda x : 1/3*(x**2)+1, x_min=-2,x_max=2.5,color=ORANGE) + curve2 = self.get_graph(lambda x : 2*(1/3*(x**2)+1), x_min=-2,x_max=2.5,color=GOLD) + fx= TextMobject("$f(x)$").scale(0.6).shift(1.25*UP + 2.2*LEFT) + gx= TextMobject("$2 \cdot f(x)$").scale(0.6).shift(0.5*UP + 2.1*LEFT) + f1 = self.get_vertical_line_to_graph(-2,curve1,color=YELLOW) + f2 = self.get_vertical_line_to_graph(-1.5,curve1,color=YELLOW) + f3 = self.get_vertical_line_to_graph(-1,curve1,color=YELLOW) + f4 = self.get_vertical_line_to_graph(-0.5,curve1,color=YELLOW) + f5 = self.get_vertical_line_to_graph(0,curve1,color=YELLOW) + f6 = self.get_vertical_line_to_graph(0.5,curve1,color=YELLOW) + f7 = self.get_vertical_line_to_graph(1,curve1,color=YELLOW) + f8 = self.get_vertical_line_to_graph(1.5,curve1,color=YELLOW) + f9 = self.get_vertical_line_to_graph(2,curve1,color=YELLOW) + f10 = self.get_vertical_line_to_graph(2.5,curve1,color=YELLOW) + self.play(ShowCreation(curve1),ShowCreation(fx)) + self.wait(1.5) + self.play(ShowCreation(f1),ShowCreation(f2),ShowCreation(f3),ShowCreation(f4),ShowCreation(f5),ShowCreation(f6),ShowCreation(f7),ShowCreation(f8),ShowCreation(f9),ShowCreation(f10)) + self.wait(1.7) + line1=Line(color=YELLOW).shift(5*LEFT+1.8*UP).scale(0.5) + line1.rotate(np.pi/2) + scalar = TextMobject("2 x").scale(0.65).shift(5.5*LEFT+1.9*UP) + equal = TextMobject("=").scale(0.65).shift(4.5*LEFT+1.9*UP) + line2=Line(color=BLUE).shift(4*LEFT+2.3*UP) + line2.rotate(np.pi/2) + self.play(ShowCreation(line1),ShowCreation(scalar),ShowCreation(equal),ShowCreation(line2)) + g1 = self.get_vertical_line_to_graph(-2,curve2,color=BLUE) + g2 = self.get_vertical_line_to_graph(-1.5,curve2,color=BLUE) + g3 = self.get_vertical_line_to_graph(-1,curve2,color=BLUE) + g4 = self.get_vertical_line_to_graph(-0.5,curve2,color=BLUE) + g5 = self.get_vertical_line_to_graph(0,curve2,color=BLUE) + g6 = self.get_vertical_line_to_graph(0.5,curve2,color=BLUE) + g7 = self.get_vertical_line_to_graph(1,curve2,color=BLUE) + g8 = self.get_vertical_line_to_graph(1.5,curve2,color=BLUE) + g9 = self.get_vertical_line_to_graph(2,curve2,color=BLUE) + g10 = self.get_vertical_line_to_graph(2.5,curve2,color=BLUE) + self.play(ShowCreation(g1),ShowCreation(g2),ShowCreation(g3),ShowCreation(g4),ShowCreation(g5),ShowCreation(g6),ShowCreation(g7),ShowCreation(g8),ShowCreation(g9),ShowCreation(g10)) + self.wait(2) + fx2=TextMobject("2$\cdot f(x)$").scale(0.6).shift(2.6*UP+2.3*LEFT) + self.play(ShowCreation(curve2),ShowCreation(fx2)) + self.wait(1.5) + self.play(FadeOut(curve1),FadeOut(fx)) + sc_mult=TextMobject("$(2 f(x)) = 2f(x)$",color=GOLD).scale(0.65).shift(0.65*UP + 5*LEFT) + rect = Rectangle(height=0.5,width=2) + rect.surround(sc_mult) + self.play(ShowCreation(sc_mult),ShowCreation(rect)) + self.wait(3) + diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Function_Space_Addition.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Function_Space_Addition.py new file mode 100644 index 0000000..5ce0e11 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Function_Space_Addition.py @@ -0,0 +1,89 @@ +from manimlib.imports import * +from scipy import sin,exp +class FunctionalVectorSpace(GraphScene): + CONFIG = { + "x_min" : -5, + "x_max" : 5, + "y_min" : -5, + "y_max" : 5, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color":LIGHT_GRAY, + "graph_origin": ORIGIN, + + + } + def construct(self): + self.setup_axes(animate = True) + curve1 = self.get_graph(lambda x : exp(x) + 0.5, x_min=-2,x_max=2.5,color=ORANGE) + curve2 = self.get_graph(lambda x : 1/3*(x**2)+1, x_min=-2,x_max=2.5,color=DARK_BLUE) + curve3 = self.get_graph(lambda x : 1/3*(x**2)+1 + exp(x) + 0.5, x_min=-2,x_max=2.5,color=BLACK) + fx= TextMobject("$f(x)$").scale(0.6).shift(1.25*UP + 2.1*LEFT) + gx= TextMobject("$g(x)$").scale(0.6).shift(0.5*UP + 2.1*LEFT) + f1 = self.get_vertical_line_to_graph(-2,curve1,color=YELLOW) + f2 = self.get_vertical_line_to_graph(-1.5,curve1,color=YELLOW) + f3 = self.get_vertical_line_to_graph(-1,curve1,color=YELLOW) + f4 = self.get_vertical_line_to_graph(-0.5,curve1,color=YELLOW) + f5 = self.get_vertical_line_to_graph(0,curve1,color=YELLOW) + f6 = self.get_vertical_line_to_graph(0.5,curve1,color=YELLOW) + f7 = self.get_vertical_line_to_graph(1,curve1,color=YELLOW) + f8 = self.get_vertical_line_to_graph(1.5,curve1,color=YELLOW) + f9 = self.get_vertical_line_to_graph(2,curve1,color=YELLOW) + f10 = self.get_vertical_line_to_graph(2.5,curve1,color=YELLOW) + + self.play(ShowCreation(curve1),ShowCreation(gx)) + self.wait(1.2) + self.play(ShowCreation(curve2),ShowCreation(fx)) + self.wait(1.2) + self.play(ShowCreation(f1),ShowCreation(f2),ShowCreation(f3),ShowCreation(f4),ShowCreation(f5),ShowCreation(f6),ShowCreation(f7),ShowCreation(f8),ShowCreation(f9),ShowCreation(f10)) + self.wait(1.7) + g1 = self.get_vertical_line_to_graph(-2,curve2,color=BLUE) + g2 = self.get_vertical_line_to_graph(-1.5,curve2,color=BLUE) + g3 = self.get_vertical_line_to_graph(-1,curve2,color=BLUE) + g4 = self.get_vertical_line_to_graph(-0.5,curve2,color=BLUE) + g5 = self.get_vertical_line_to_graph(0,curve2,color=BLUE) + g6 = self.get_vertical_line_to_graph(0.5,curve2,color=BLUE) + g7 = self.get_vertical_line_to_graph(1,curve2,color=BLUE) + g8 = self.get_vertical_line_to_graph(1.5,curve2,color=BLUE) + g9 = self.get_vertical_line_to_graph(2,curve2,color=BLUE) + g10 = self.get_vertical_line_to_graph(2.5,curve2,color=BLUE) + self.play(ShowCreation(g1),ShowCreation(g2),ShowCreation(g3),ShowCreation(g4),ShowCreation(g5),ShowCreation(g6),ShowCreation(g7),ShowCreation(g8),ShowCreation(g9),ShowCreation(g10)) + line1=Line(color=BLUE).shift(5*LEFT+2.3*UP).scale(0.25) + line1.rotate(np.pi/2) + line2=Line(color=YELLOW).shift(6*LEFT+2.5*UP).scale(0.5) + line2.rotate(np.pi/2) + line3=Line(color=PURPLE_B).shift(4*LEFT+2.7*UP).scale(0.75) + line3.rotate(np.pi/2) + add=TextMobject("+").shift(2.4*UP+5.5*LEFT).scale(0.7) + equal=TextMobject("=").shift(2.4*UP+4.5*LEFT).scale(0.7) + self.play(ShowCreation(line2),ShowCreation(line1),ShowCreation(add),ShowCreation(equal),ShowCreation(line3)) + self.wait(2) + self.play(FadeOut(curve1),FadeOut(curve2)) + self.wait(3) + h1 = self.get_vertical_line_to_graph(-2,curve3,color=PURPLE_B) + h2 = self.get_vertical_line_to_graph(-1.5,curve3,color=PURPLE_B) + h3 = self.get_vertical_line_to_graph(-1,curve3,color=PURPLE_B) + h4 = self.get_vertical_line_to_graph(-0.5,curve3,color=PURPLE_B) + h5 = self.get_vertical_line_to_graph(0,curve3,color=PURPLE_B) + h6 = self.get_vertical_line_to_graph(0.5,curve3,color=PURPLE_B) + h7 = self.get_vertical_line_to_graph(1,curve3,color=PURPLE_B) + h8 = self.get_vertical_line_to_graph(1.5,curve3,color=PURPLE_B) + h9 = self.get_vertical_line_to_graph(2,curve3,color=PURPLE_B) + h10 = self.get_vertical_line_to_graph(2.5,curve3,color=PURPLE_B) + + line1.shift(1*LEFT+0.9*UP) + equal.shift(0.3*LEFT+0.2*UP) + f=TextMobject("$f(x)$").scale(0.5).shift(5.6*LEFT+3.2*UP) + g=TextMobject("$g(x)$").scale(0.5).shift(5.6*LEFT+2.4*UP) + fg=TextMobject("$(f + g)(x)$").scale(0.5).shift(2.85*UP+3.3*LEFT) + self.play(FadeOut(add),ShowCreation(equal),ShowCreation(line1),ShowCreation(f),ShowCreation(g),ShowCreation(fg),FadeOut(fx),FadeOut(gx)) + self.wait(1.7) + self.play(ShowCreation(h1),ShowCreation(h2),ShowCreation(h3),ShowCreation(h4),ShowCreation(h5),ShowCreation(h6),ShowCreation(h7),ShowCreation(h8),ShowCreation(h9),ShowCreation(h10)) + curve3 = self.get_graph(lambda x : 1/3*(x**2)+1 + exp(x) + 0.5, x_min=-2,x_max=2.5,color=RED_A) + fgx=TextMobject("$(f + g)(x)$").scale(0.5).shift(1.65*UP+2.4*LEFT) + self.play(ShowCreation(curve3),ShowCreation(fgx)) + sum=TextMobject("$(f + g)(x) = f(x) + g(x)$",color=GOLD).scale(0.65).shift(0.8*UP + 5*LEFT) + rect = Rectangle(height=0.5,width=2) + rect.surround(sum) + self.play(ShowCreation(sum),ShowCreation(rect)) + self.wait(3) \ No newline at end of file diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Integral_Properties.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Integral_Properties.py new file mode 100644 index 0000000..97c0e09 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/Integral_Properties.py @@ -0,0 +1,77 @@ +from manimlib.imports import * +from scipy import sin +class Integral_Properties(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 5, + "y_min" : 0, + "y_max" : 6, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color":LIGHT_GRAY, + "x_labeled_nums" : list(range(6)), + "y_labeled_nums" : list(range(6)) + } + def construct(self): + self.setup_axes(animate=False) + curve1 = self.get_graph(lambda x : sin(x), x_min=0,x_max=2.5,color=RED) + curve2 = self.get_graph(lambda x : x, x_min=0,x_max=2.5,color=DARK_BLUE) + curve3 = self.get_graph(lambda x : sin(x) + x, x_min=0,x_max=2.5,color=GREEN) + fx = TextMobject(r"$f(x)$").scale(0.5).shift(1*RIGHT+1.8*DOWN) + gx = TextMobject(r"$g(x)$").scale(0.5).shift(1*RIGHT) + sum = TextMobject(r"$f(x) + g(x)$").scale(0.5).shift(1.3*RIGHT+0.6*UP) + area1 = self.get_area(curve1,0,2.5) + area2 = self.get_area(curve2,0,2.5) + area3 = self.get_area(curve3,0,2.5) + area2.set_fill(color=PURPLE) + area3.set_fill(color=ORANGE) + text1=TextMobject(r"$\int_{0}^{2.5}$ f(x) dx = Area under the curve f(x)",color=BLUE_C).scale(0.7).shift(2.7*RIGHT+3*UP) + text2=TextMobject(r"$\int_{0}^{2.5}$ g(x) dx = Area under the curve g(x)",color=PURPLE_B).scale(0.7).shift(2.7*RIGHT+2.4*UP) + text3=TextMobject(r"Area under the curve f(x) + g(x) = $\int_{0}^{2.5} (f(x) + g(x)) dx$",color=ORANGE).scale(0.7).shift(2.7*RIGHT+1.8*UP) + text4=TextMobject(r"\text{$\int_{0}^{2.5}$ (f(x) + g(x)) dx}",r"\text{ = }",r"\text{ $\int_{0}^{2.5}$ f(x) dx }",r"\text{+}",r"\text{$\int_{0}^{2.5}$ g(x) dx}").scale(0.62).shift(2.7*RIGHT+2.7*UP) + text4[0].set_color(ORANGE) + text4[2].set_color(BLUE_C) + text4[4].set_color(PURPLE_B) + self.play(ShowCreation(curve1), ShowCreation(fx)) + self.wait(1.2) + self.play(ShowCreation(curve2),ShowCreation(gx)) + self.wait(1.2) + self.play(ShowCreation(area1)) + self.play(ShowCreation(text1)) + self.wait(1.5) + self.play(ShowCreation(area2)) + self.play(ShowCreation(text2)) + self.wait(1.5) + self.play(ShowCreation(curve3),ShowCreation(sum)) + self.play(ShowCreation(area3)) + self.play(ShowCreation(text3)) + self.wait(2) + self.play(FadeOut(text1),FadeOut(text2),FadeOut(text3)) + self.wait(1) + self.play(ShowCreation(text4)) + self.wait(3) + self.play(FadeOut(curve1),FadeOut(curve2),FadeOut(area1),FadeOut(area2)) + self.wait(1.5) + self.play(FadeOut(text4),FadeOut(area2),FadeOut(curve2),FadeOut(gx),FadeOut(curve3),FadeOut(sum),FadeOut(area3),ShowCreation(curve1),ShowCreation(fx)) + self.wait(1.5) + self.play(ShowCreation(area1),ShowCreation(text1)) + self.wait(1.5) + curve4 = self.get_graph(lambda x : 2*sin(x), x_min=0,x_max=2.5,color=RED) + area4 = self.get_area(curve4,0,2.5) + area4.set_fill(color=YELLOW) + fx2 = TextMobject(r"$2f(x)$").scale(0.7).shift(1*RIGHT+1.2*DOWN) + scalar_mul=TextMobject(r"$\int_{0}^{2.5} ( 2f(x) ) dx$ = 2 $\times$ Area under the curve f(x)",color=YELLOW).scale(0.7).shift(2.7*RIGHT+2.4*UP) + self.play(ShowCreation(curve4),ShowCreation(fx2)) + self.wait(1) + self.play(ShowCreation(area4)) + self.wait(2) + self.play(ShowCreation(scalar_mul)) + self.wait(2) + text5=TextMobject(r"\text{$\int_{0}^{2.5}$ (2 f(x)) dx}",r"\text{ = }",r"\text{2 $\int_{0}^{2.5}$ f(x) dx }").scale(0.67).shift(2.7*RIGHT+2.7*UP) + text5[0].set_color(YELLOW) + text5[2].set_color(BLUE_C) + self.play(FadeOut(text1),FadeOut(scalar_mul)) + self.wait(1) + self.play(ShowCreation(text5)) + self.wait(3) + -- cgit From 2051cc23cb4ecf1a66215cae77048e3e47358de5 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Wed, 24 Jun 2020 14:45:28 +0530 Subject: Add files via upload --- .../gifs3/Addition_of_Functions.gif | Bin 0 -> 510988 bytes .../gifs3/Function_Space_Example.gif | Bin 0 -> 1783321 bytes .../gifs3/Scalar_Multiplicaton_of_Functions.gif | Bin 0 -> 350289 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Addition_of_Functions.gif create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Function_Space_Example.gif create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Scalar_Multiplicaton_of_Functions.gif (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Addition_of_Functions.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Addition_of_Functions.gif new file mode 100644 index 0000000..6c42b74 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Addition_of_Functions.gif differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Function_Space_Example.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Function_Space_Example.gif new file mode 100644 index 0000000..996a9de Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Function_Space_Example.gif differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Scalar_Multiplicaton_of_Functions.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Scalar_Multiplicaton_of_Functions.gif new file mode 100644 index 0000000..8fff2c8 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Function-and-Polynomial-Spaces/gifs3/Scalar_Multiplicaton_of_Functions.gif differ -- cgit From 2a87b8f5f12478e1894eafc8926383186a65f11c Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Wed, 24 Jun 2020 15:43:06 +0530 Subject: Add files via upload --- .../vector-spaces/Vector-Spaces/Subspaces/Basis.py | 174 +++++++++++++++++++++ .../Vector-Spaces/Subspaces/Linear_Subspace.py | 42 +++++ 2 files changed, 216 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Basis.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Basis.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Basis.py new file mode 100644 index 0000000..6d2edc8 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Basis.py @@ -0,0 +1,174 @@ +from manimlib.imports import * + + +VECTORS = [[1, 2], + [-4, 2], + [-3, -3], + [3,-2], + [3,3], + [-2,1], + [-1,-3]] + +class Scene1(LinearTransformationScene): + + CONFIG = { + "include_background_plane": True, + "include_foreground_plane": False, + "show_coordinates": False, + "show_basis_vectors": True, + "basis_vector_stroke_width": 3, + + } + def construct(self): + self.setup() + ihat, jhat = self.get_basis_vectors() + labels = self.get_basis_vector_labels() + self.add(ihat, jhat) + self.add(*labels) + + self.show_vector_as_basis_sum() + self.wait(2) + + def show_vector_as_basis_sum(self): + text1 = TextMobject(r"Vector Space $\mathbb{R}^2$}").scale(0.8).shift(3*UP) + text1.add_background_rectangle() + self.play(ShowCreation(text1)) + text2 = TextMobject(r"$\mathbb{R}^2$",color=BLUE_E).scale(0.8).shift(6.5*LEFT+3.5*UP) + text3 = TextMobject(r"\text{Basis Vectors:}",r"\text{$\hat{i}$}",r"\text{,}",r"\text{$\hat{j}$}").scale(0.7).shift(2*UP+2.5*RIGHT) + text3[1].set_color(GREEN_C) + text3[3].set_color(RED_C) + + self.wait(2) + self.play(Transform(text1,text2)) + self.wait(1) + self.play(ShowCreation(text3)) + self.wait(1.7) + self.play(FadeOut(text3)) + + for i in range(len(VECTORS)): + v = self.add_vector(VECTORS[i], stroke_width = 3,color=YELLOW_D) + + linei = Line(start = ORIGIN, end = VECTORS[i][0]*RIGHT) + linei.set_color(GREEN_C) + linej = Line(start = linei.get_end(), + end = linei.get_end() + VECTORS[i][1]*UP) + linej.set_color(RED_C) + self.play(ShowCreation(linei)) + self.play(ShowCreation(linej)) + vlabel = self.get_vector_label(v, str(VECTORS[i][0]) + + r"\imath" + "+" + + str(VECTORS[i][1]) + + r"\jmath", at_tip = True) + self.play(ShowCreation(vlabel)) + + self.play(FadeOut(linei),FadeOut(linej)) + self.wait(1) + dot = Dot(v.get_end(), fill_color = v.get_stroke_color()) + self.play(ShowCreation(dot),FadeOut(v),FadeOut(vlabel)) + self.wait(0.3) + +class Scene2(LinearTransformationScene): + CONFIG = { + "num_vectors" : 16, + "start_color" : GREY, + "end_color" : YELLOW_D, + "include_background_plane": True, + "include_foreground_plane": False, + } + + def get_vectors(self): + return [ + Vector([x, y], stroke_width = 3.5) + for x in np.arange(-int(FRAME_X_RADIUS), int(FRAME_X_RADIUS)+0.5, 0.5) + for y in np.arange(-int(FRAME_Y_RADIUS), int(FRAME_Y_RADIUS)+0.5, 0.5) + ] + + def lock_in_faded_grid(self, dimness=0.7, axes_dimness=0.5): + plane = self.add_plane() + axes = plane.get_axes() + plane.fade(dimness) + axes.set_color(WHITE) + axes.fade(axes_dimness) + self.add(axes) + + def construct(self): + self.lock_in_faded_grid() + + vectors = self.get_vectors() + colors = Color(self.start_color).range_to( + self.end_color, len(vectors) + ) + for vect, color in zip(vectors, colors): + vect.set_color(color) + + vector_group = VGroup(*vectors) + self.play( + ShowCreation( + vector_group, + run_time = 3 + ) + ) + + self.wait(1) + + vectors.sort(key=lambda v: v.get_length()) + def v_to_dot(vector): + return Dot(vector.get_end(), fill_color = vector.get_stroke_color()) + self.wait() + rate_functions = [ + squish_rate_func(smooth, float(x)/(len(vectors)+2), 1) + for x in range(len(vectors)) + ] + self.play(*[ + Transform(v, v_to_dot(v), rate_func = rf, run_time = 3) + for v, rf in zip(vectors, rate_functions) + ]) + self.wait(2) + self.play_final_animation(vectors, rate_functions) + self.wait(2) + + text1 = TextMobject(" Basis is the minimum information required to ").shift(3.1*UP).scale(0.8) + text2 = TextMobject("generate the whole space.").scale(0.8).shift(2.6*UP) + + text1.add_background_rectangle() + text2.add_background_rectangle() + + + + self.play(ShowCreation(text1),ShowCreation(text2)) + + self.play(ShowCreation(self.get_basis_vectors())) + self.wait(3) + + def play_final_animation(self, vectors, rate_functions): + + h_line = Line( + FRAME_X_RADIUS*RIGHT, FRAME_X_RADIUS*LEFT, + stroke_width = 0.5, + color = BLUE_E + ) + v_line = Line( + FRAME_Y_RADIUS*UP, FRAME_Y_RADIUS*DOWN, + stroke_width = 0.5, + color = BLUE_E + ) + line_pairs = [ + VGroup(h_line.copy().shift(y), v_line.copy().shift(x)) + for v in vectors + for x, y, z in [v.get_center()] + ] + plane = NumberPlane() + + self.play( + ShowCreation(plane), + *[ + Transform(v, p, rate_func = rf) + for v, p, rf in zip(vectors, line_pairs, rate_functions) + ] + ) + self.remove(*vectors) + + + + + \ No newline at end of file diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py new file mode 100644 index 0000000..9062b30 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py @@ -0,0 +1,42 @@ +from manimlib.imports import * +class Subspace(ThreeDScene): + + + def construct(self): + axes = ThreeDAxes() + self.set_camera_orientation(phi = 80*DEGREES,theta =110*DEGREES) + self.begin_ambient_camera_rotation(rate=0.09) + cube = Cube(stroke_width=5,color=WHITE).shift([1.5,1.5,1.5]).scale(1.5) + cube.set_fill(TEAL) + + cube.set_opacity(0.4) + line = Line(color=MAROON,set_opacity=100).shift([1.5,1.5,1.5]).scale(1.5) + plane1 = Polygon([0,0,3],[3,0,3],[3,3,0],[0,3,0]) + plane1.set_opacity(0.8) + plane1.set_fill(YELLOW) + plane1.set_color(YELLOW) + + + plane2 = Polygon([0,3,3],[3,3,3],[3,0,0],[0,0,0]) + plane2.set_opacity(0.7) + plane2.set_fill(RED) + plane2.set_color(RED) + + vgroup = VGroup(plane1,plane2,line,cube) + vgroup.shift([-2,-2,-2]) + + text = TextMobject(r"\text{The}",r"\text{line}",r"\text{representing the intersection of the two planes is a Subspace.}",opacity = 0.6).scale(0.7).shift(3*UP) + text[1].set_color(MAROON) + self.add_fixed_in_frame_mobjects(text) + self.play(ShowCreation(text)) + + + self.play(ShowCreation(cube)) + self.play(ShowCreation(plane1)) + self.play(ShowCreation(plane2)) + self.play(ShowCreation(line)) + self.wait(10) + + + + \ No newline at end of file -- cgit From 5c947bf68465241eee3abcec931ae53054ae4eef Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 00:59:15 +0530 Subject: Add files via upload --- .../Dual-Spaces/Basis_of_a_dual_vector_space.py | 126 +++++++++++++++++++++ .../Dual-Spaces/Dual_Basis_Example.py | 97 ++++++++++++++++ .../Vector-Spaces/Dual-Spaces/Dual_of_a_Cube.py | 38 +++++++ .../Vector-Spaces/Dual-Spaces/Duality_in_Sets.py | 25 ++++ .../Vector-Spaces/Dual-Spaces/Linear_Functional.py | 29 +++++ 5 files changed, 315 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Basis_of_a_dual_vector_space.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Dual_Basis_Example.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Dual_of_a_Cube.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Duality_in_Sets.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Linear_Functional.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Basis_of_a_dual_vector_space.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Basis_of_a_dual_vector_space.py new file mode 100644 index 0000000..630670e --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Basis_of_a_dual_vector_space.py @@ -0,0 +1,126 @@ +from manimlib.imports import * +class DualVectorSpace(ZoomedScene): + + def construct(self): + c1 = Ellipse(radius = 2,color=BLUE) + c2 = Ellipse(radius = 2,color=YELLOW) + c1.rotate(np.pi/2) + c2.rotate(np.pi/2) + c1.shift(2*LEFT+0.6*UP) + c2.shift(2*RIGHT+0.6*UP) + c1.scale(2) + c2.scale(2) + self.play(ShowCreation(c1)) + self.play(ShowCreation(c2)) + dot1 = SmallDot(color=BLUE).shift(2*LEFT+2*UP) + dot2 = SmallDot(color=BLUE).shift(2*LEFT+1.5*UP) + dot3 = SmallDot(color=BLUE).shift(2*LEFT+1*UP) + dot4 = SmallDot(color=BLUE).shift(2*LEFT+0.5*UP) + dot5 = SmallDot(color=BLUE).shift(2*LEFT) + dot6 = SmallDot(color=BLUE).shift(2*LEFT+0.5*DOWN) + dot7 = SmallDot(color=BLUE).shift(2*LEFT+1*DOWN) + text1 = TextMobject(r"$V$").scale(0.6).shift(3*UP+2*LEFT) + text2 = TextMobject(r"$V^* = \{T:V\rightarrow F\}$").scale(0.6).shift(3*UP+2.5*RIGHT) + self.play(ShowCreation(dot1),ShowCreation(dot2),ShowCreation(dot3),ShowCreation(dot4),ShowCreation(dot5),ShowCreation(dot6),ShowCreation(dot7)) + v1 = TextMobject(r"$v_1$").scale(0.5).shift(2.2*LEFT+2*UP) + v2 = TextMobject(r"$v_2$").scale(0.5).shift(2.2*LEFT+1.5*UP) + v3 = TextMobject(r"$v_3$").scale(0.5).shift(2.2*LEFT+1*UP) + v4 = TextMobject(r"$v_4$").scale(0.5).shift(2.2*LEFT+0.5*UP) + v5 = TextMobject(r"$v_5$").scale(0.5).shift(2.2*LEFT) + v6 = TextMobject(r"$v_6$").scale(0.5).shift(2.2*LEFT+0.5*DOWN) + v7 = TextMobject(r"$v_7$").scale(0.5).shift(2.2*LEFT+1*DOWN) + self.play(ShowCreation(v1),ShowCreation(v2),ShowCreation(v3),ShowCreation(v4),ShowCreation(v5),ShowCreation(v6),ShowCreation(v7)) + self.play(ShowCreation(text1)) + dot9 = SmallDot(color=YELLOW).shift(2*RIGHT+2*UP) + dot10 = SmallDot(color=YELLOW).shift(2*RIGHT+1.5*UP) + dot11 = SmallDot(color=YELLOW).shift(2*RIGHT+1*UP) + dot12 = SmallDot(color=YELLOW).shift(2*RIGHT+0.5*UP) + dot13 = SmallDot(color=YELLOW).shift(2*RIGHT) + dot14 = SmallDot(color=YELLOW).shift(2*RIGHT+0.5*DOWN) + dot15 = SmallDot(color=YELLOW).shift(2*RIGHT+1*DOWN) + self.play(ShowCreation(dot9),ShowCreation(dot10),ShowCreation(dot11),ShowCreation(dot12),ShowCreation(dot13),ShowCreation(dot14),ShowCreation(dot15)) + v9 = TextMobject(r"${T_1}$").scale(0.5).shift(2.2*RIGHT+2*UP) + v10 = TextMobject(r"${T_2}$").scale(0.5).shift(2.2*RIGHT+1.5*UP) + v11 = TextMobject(r"${T_3}$").scale(0.5).shift(2.2*RIGHT+1*UP) + v12 = TextMobject(r"${T_4}$").scale(0.5).shift(2.2*RIGHT+0.5*UP) + v13 = TextMobject(r"${T_5}$").scale(0.5).shift(2.2*RIGHT) + v14 = TextMobject(r"${T_6}$").scale(0.5).shift(2.2*RIGHT+0.5*DOWN) + v15 = TextMobject(r"${T_7}$").scale(0.5).shift(2.2*RIGHT+1*DOWN) + self.play(ShowCreation(v9),ShowCreation(v10),ShowCreation(v11),ShowCreation(v12),ShowCreation(v13),ShowCreation(v14),ShowCreation(v15)) + self.play(ShowCreation(text2)) + line1 = Line(start=dot1,end=dot9,stroke_width=0.95) + line2 = Line(start=dot2,end=dot10,stroke_width=0.95) + line3 = Line(start=dot3,end=dot11,stroke_width=0.95) + line4 = Line(start=dot4,end=dot12,stroke_width=0.95) + line5 = Line(start=dot5,end=dot13,stroke_width=0.95) + line6 = Line(start=dot6,end=dot14,stroke_width=0.95) + line7 = Line(start=dot7,end=dot15,stroke_width=0.95) + self.play(ShowCreation(line1),ShowCreation(line2),ShowCreation(line3),ShowCreation(line4),ShowCreation(line5),ShowCreation(line6),ShowCreation(line7)) + self.wait(1.5) + rect1 = Rectangle(stroke_width=0.5,width=1,height=1.9).set_fill(color=BLUE,opacity=0.3) + vgroup1 = VGroup(dot3,dot4,v3,v4) + rect1.surround(vgroup1) + self.play(ShowCreation(rect1)) + text3 = TextMobject(r"Basis of $V$ = $\{v_3, v_4\}$").shift(4.6*LEFT+1*UP).scale(0.5) + self.play(ShowCreation(text3)) + self.wait(1.5) + rect2 = Rectangle(stroke_width=0.5,width=1,height=1.7).set_fill(color=YELLOW,opacity=0.3) + vgroup2 = VGroup(dot11,dot12,v11,v12) + rect2.surround(vgroup2) + self.play(ShowCreation(rect2)) + text4 = TextMobject(r"Basis of $V^*$ = $\{{T_3},{T_4} \}$").shift(4.6*RIGHT+1*UP).scale(0.5) + self.play(ShowCreation(text4)) + self.wait(2.5) + v9.move_to(3*LEFT+3*UP).scale(1.2).set_color(YELLOW) + colon = TextMobject(":").shift(3*UP+2.6*LEFT) + vgroup3 = VGroup(line1,line2,line3,line4,line5,line6,line7) + vgroup4 = VGroup(v10,v11,v12,v13,v14,v15,rect1,rect2,text3,text4,c2) + vgroup5 = VGroup(dot9,dot10,dot11,dot12,dot13,dot14,dot15) + text5 = TextMobject(r"$F$").scale(0.6).shift(3*UP+2*RIGHT) + dot9 = SmallDot(color=GREEN).shift(2*RIGHT+2*UP) + dot10 = SmallDot(color=GREEN).shift(2*RIGHT+1.5*UP) + dot11 = SmallDot(color=GREEN).shift(2*RIGHT+1*UP) + dot12 = SmallDot(color=GREEN).shift(2*RIGHT+0.5*UP) + dot13 = SmallDot(color=GREEN).shift(2*RIGHT) + dot14 = SmallDot(color=GREEN).shift(2*RIGHT+0.5*DOWN) + dot15 = SmallDot(color=GREEN).shift(2*RIGHT+1*DOWN) + f1 = TextMobject(r"${f_1}$").scale(0.5).shift(2.2*RIGHT+2*UP) + f2 = TextMobject(r"${f_2}$").scale(0.5).shift(2.2*RIGHT+1.5*UP) + f3 = TextMobject(r"${f_3}$").scale(0.5).shift(2.2*RIGHT+1*UP) + f4 = TextMobject(r"${f_4}$").scale(0.5).shift(2.2*RIGHT+0.5*UP) + f5 = TextMobject(r"${f_5}$").scale(0.5).shift(2.2*RIGHT) + f6 = TextMobject(r"${f_6}$").scale(0.5).shift(2.2*RIGHT+0.5*DOWN) + f7 = TextMobject(r"${f_7}$").scale(0.5).shift(2.2*RIGHT+1*DOWN) + vgroup6 = VGroup(f1,f2,f3,f4,f5,f6,f7) + arrow = Arrow(stroke_width=1.6).scale(1.5).shift(3*UP) + c3 = Ellipse(radius = 2,color=GREEN) + c3.rotate(np.pi/2) + c3.shift(2*RIGHT+0.6*UP) + c3.scale(2) + self.play(ShowCreation(v9)) + self.wait(1.5) + self.play(ShowCreation(arrow),ShowCreation(colon),Transform(text2,text5),FadeOut(vgroup3),FadeOut(vgroup4),FadeOut(vgroup5)) + self.play(ShowCreation(vgroup5),ShowCreation(vgroup6),ShowCreation(c3)) + self.wait(0.7) + self.play(ShowCreation(vgroup3)) + self.wait(3) + + + + + + + + + + + + + + + + + + + + diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Dual_Basis_Example.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Dual_Basis_Example.py new file mode 100644 index 0000000..d79ec3e --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Dual_Basis_Example.py @@ -0,0 +1,97 @@ +from manimlib.imports import * +import numpy as np + +class Dual_Basis(GraphScene): + CONFIG={ + "x_min": -7, + "x_max": 7, + "y_min": -7, + "y_max": 7, + "graph_origin": ORIGIN, + "x_axis_label":"$X$", + "y_axis_label":"$Y$", + "x_labeled_nums": list(np.arange(-7, 8,1)), + "y_labeled_nums": list(np.arange(-7, 8,1)), + "x_axis_width": 10, + "y_axis_height": 10, + "x_tick_frequency":1, + "axes_color": GREY, + "area_opacity": 3, + "num_rects": 10, + } + def construct(self): + self.setup_axes(animate = True) + XD = self.x_axis_width/(self.x_max- self.x_min) + YD = self.y_axis_height/(self.y_max- self.y_min) + a1=2*XD*RIGHT+1*YD*UP + a2=3*XD*RIGHT+1*YD*UP + vec1=Vector(direction=a1,stroke_width=2).set_color(RED_E) + vec1.shift(self.graph_origin) + v1_label=TextMobject(r"$v_1$") + v1_label=(v1_label.shift(self.graph_origin+a1+0.1)).scale(.6) + self.play(ShowCreation(vec1),ShowCreation(v1_label)) + text1=TextMobject(r"\text{$v_1$}",r"\text{$= (2,1)$}").scale(.6) + text1[0].set_color(RED_E) + text1.shift(5*LEFT+3.5*UP) + self.play(ShowCreation(text1)) + self.wait(1.5) + vec2=Vector(direction=a2,stroke_width=2).set_color(YELLOW_E) + vec2.shift(self.graph_origin) + v2_label=TextMobject(r"$v_2$") + v2_label=(v2_label.shift(self.graph_origin+a2+0.1)).scale(.6) + self.play(ShowCreation(vec2),ShowCreation(v2_label)) + text2=TextMobject(r"\text{$v_2$}",r"\text{$= (3,1)$}").scale(.6) + text2[0].set_color(YELLOW_E) + text2.shift(5*LEFT+3*UP) + self.play(ShowCreation(text2)) + self.wait(1.5) + text3=TextMobject(r"\text{${T_2}$}",r"\text{$(v_1)$}",r"\text{$= 0$}").scale(.6) + text3[0].set_color(BLUE) + text3[1].set_color(RED_E) + text3.shift(4.94*LEFT+2.5*UP) + self.play(ShowCreation(text3)) + self.wait(1.5) + text4=TextMobject(r"\text{${T_2}$}",r"\text{$= x - 2y$}").scale(.6) + text4[0].set_color(BLUE) + text4.shift(4.9*LEFT+2*UP) + self.play(ShowCreation(text4)) + self.wait(1.5) + line1 = self.get_graph(lambda x : x/2, x_min = -5,x_max=5,color=BLUE) + v1_dual_label = TextMobject(r"${T_2}$").scale(.6).shift(3.9*RIGHT+1.85*UP) + self.play(ShowCreation(line1),ShowCreation(v1_dual_label)) + self.wait(1.5) + text5=TextMobject(r"\text{${T_1}$}",r"\text{$(v_2)$}",r"\text{$= 0$}").scale(.6) + text5[1].set_color(YELLOW_E) + text5[0].set_color(PINK) + text5.shift(4.94*LEFT+1.5*UP) + self.play(ShowCreation(text5)) + self.wait(1.5) + line2 = self.get_graph(lambda x : x/3, x_min = -5,x_max=5,color=PINK) + v2_dual_label = TextMobject(r"${T_1}$").scale(.6).shift(3.9*RIGHT+1.3*UP) + self.play(ShowCreation(line2),ShowCreation(v2_dual_label)) + self.wait(1.5) + text6=TextMobject(r"\text{${T_1}$}",r"\text{$= - x + 3y$}").scale(.6) + text6[0].set_color(PINK) + text6.shift(4.76*LEFT+1*UP) + self.play(ShowCreation(text6)) + self.wait(3) + text7 = TextMobject(r"\text{B =}",r"\text{$[$}",r"\text{$v_1,$}",r"\text{$v_2$}",r"\text{$]$}",r"\text{=}",r"\text{$[(2,1), (3,1)]$}").scale(0.6).shift(3*UP+4.5*LEFT) + text7[2].set_color(RED_E) + text7[3].set_color(YELLOW_E) + self.play(FadeOut(text1),FadeOut(text2),FadeOut(text3),FadeOut(text4),FadeOut(text5),FadeOut(text6)) + self.play(ShowCreation(text7)) + self.wait(0.7) + text8 = TextMobject(r"\text{B$^* =$}",r"\text{$[$}",r"\text{${T_1}$,}",r"\text{${T_2} $}",r"\text{$]$}",r"\text{=}",r"\text{$[-x + 3y, x - 2y]$}").scale(0.6).shift(2.3*UP+4.1*LEFT) + text8[3].set_color(BLUE) + text8[2].set_color(PINK) + self.play(ShowCreation(text8)) + self.wait(3) + + + + + + + + + diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Dual_of_a_Cube.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Dual_of_a_Cube.py new file mode 100644 index 0000000..a6f501e --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Dual_of_a_Cube.py @@ -0,0 +1,38 @@ +from manimlib.imports import * +class Duality(ThreeDScene): + + + def construct(self): + axes = ThreeDAxes() + self.set_camera_orientation(phi = 65*DEGREES,theta =80*DEGREES) + self.begin_ambient_camera_rotation(rate=0.09) + cube = Cube(stroke_width=5,color=WHITE).scale(2) + cube.set_opacity(0.2) + self.play(ShowCreation(cube)) + dot1= Dot(color=RED).scale(0.85).shift([2,0,0]) + self.play(ShowCreation(dot1)) + dot2= Dot(color=YELLOW).scale(0.85).shift([-2,0,0]) + self.play(ShowCreation(dot2)) + dot3= Dot(color=BLUE).scale(0.85).shift([0,-2,0]) + self.play(ShowCreation(dot3)) + dot4= Dot(color=GREEN).scale(0.85).shift([0,2,0]) + self.play(ShowCreation(dot4)) + dot5= Dot(color=ORANGE).scale(0.85).shift([0,0,2]) + self.play(ShowCreation(dot5)) + dot6= Dot(color=PINK).scale(0.85).shift([0,0,-2]) + self.play(ShowCreation(dot6)) + line1 = Line(start=[0,0,2],end=[2,0,0],stroke_width=2.5,color=BLACK) + line2 = Line(start=[0,0,2],end=[-2,0,0],stroke_width=2.5,color=BLACK) + line3 = Line(start=[0,0,2],end=[0,-2,0],stroke_width=2.5,color=BLACK) + line4 = Line(start=[0,0,2],end=[0,2,0],stroke_width=2.5,color=BLACK) + line5 = Line(start=[2,0,0],end=[0,0,-2],stroke_width=2.5,color=BLACK) + line6 = Line(start=[-2,0,0],end=[0,0,-2],stroke_width=2.5,color=BLACK) + line7 = Line(start=[0,-2,0],end=[0,0,-2],stroke_width=2.5,color=BLACK) + line8 = Line(start=[0,2,0],end=[0,0,-2],stroke_width=2.5,color=BLACK) + line9 = Line(start=[0,2,0],end=[-2,0,0],stroke_width=2.5,color=BLACK) + line10 = Line(start=[-2,0,0],end=[0,-2,0],stroke_width=2.5,color=BLACK) + line11 = Line(start=[0,-2,0],end=[2,0,0],stroke_width=2.5,color=BLACK) + line12 = Line(start=[2,0,0],end=[0,2,0],stroke_width=2.5,color=BLACK) + self.play(ShowCreation(line1),ShowCreation(line2),ShowCreation(line3),ShowCreation(line4),ShowCreation(line5),ShowCreation(line6),ShowCreation(line7),ShowCreation(line8),ShowCreation(line9),ShowCreation(line10),ShowCreation(line11),ShowCreation(line12)) + self.wait(10) + diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Duality_in_Sets.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Duality_in_Sets.py new file mode 100644 index 0000000..693017e --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Duality_in_Sets.py @@ -0,0 +1,25 @@ +from manimlib.imports import * +import numpy as np +class Duality_in_sets(Scene): + def construct(self): + circle1 = Circle(radius=0.4,color=BLACK).shift(2.3*LEFT) + circle1.set_fill(color=RED,opacity=200) + rect1=Rectangle(height=2,width=2,color=GREY).shift(2*LEFT) + rect1.set_fill(color=DARK_BLUE,opacity=1) + text1 = TextMobject("S").scale(0.7).shift(0.9*UP+0.7*LEFT) + text2 = TextMobject("X",color=BLACK,stroke_width=0.5).scale(0.5).shift(2.3*LEFT) + self.play(ShowCreation(rect1),ShowCreation(text1),ShowCreation(circle1),ShowCreation(text2)) + circle2 = Circle(radius=0.4,color=BLACK).shift(1.7*RIGHT) + circle2.set_fill(color=BLACK,opacity=200) + rect2=Rectangle(height=2,width=2,color=GREY).shift(2*RIGHT) + rect2.set_fill(color=DARK_BLUE,opacity=1) + text3 = TextMobject("S").scale(0.7).shift(0.9*UP+3.3*RIGHT) + text4 = TextMobject(r"X$^c$",color=BLACK,stroke_width=0.2).scale(0.5).shift(2.55*RIGHT+0.6*UP) + text5 = TextMobject(r"\text{The subset}",r"\text{X$^c$}",r"\text{is the dual of subset}",r"\text{X}").scale(0.6).shift(2.7*UP+0.5*LEFT) + text5[1].set_color(GREY) + text5[3].set_color(GREY) + self.play(ShowCreation(rect2),ShowCreation(circle2),ShowCreation(text3),ShowCreation(text4)) + self.wait(2) + self.play(ShowCreation(text5)) + self.wait(3) + diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Linear_Functional.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Linear_Functional.py new file mode 100644 index 0000000..6edc918 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/Linear_Functional.py @@ -0,0 +1,29 @@ +from manimlib.imports import * +import numpy as np +class LinearFunctional(Scene): + def construct(self): + big_box=Rectangle().scale(2.7) + box = Rectangle(height=2,width=2,color=DARK_GREY).set_fill(color=PURPLE,opacity=350) + arrow1 = Arrow(color=RED).shift(1.8*LEFT+0.5*UP) + arrow2 = Arrow(color=RED).shift(1.8*LEFT+0.5*DOWN) + arrow3 = Arrow(color=GREEN).shift(0.5*UP+1.8*RIGHT) + arrow4 = Arrow(color=GREEN).shift(0.5*DOWN+1.8*RIGHT) + Linear = TextMobject("LINEAR",color=BLACK).scale(0.5).shift(0.2*UP) + Functional = TextMobject("FUNCTIONAL",color=BLACK).scale(0.5).shift(0.2*DOWN) + u = TextMobject(r"$\vec{u}$",color=YELLOW).scale(0.7).shift(2.8*LEFT+0.5*UP) + v = TextMobject(r"$\vec{v}$",color=YELLOW).scale(0.7).shift(2.8*LEFT+0.5*DOWN) + f1 = TextMobject(r"$f_1$",color=YELLOW).scale(0.7).shift(2.8*RIGHT+0.5*UP) + f2 = TextMobject(r"$f_2$",color=YELLOW).scale(0.7).shift(2.8*RIGHT+0.5*DOWN) + text = TextMobject(r"The Linear Functional is a function that takes $\vec{u}, \vec{v} \in$ V as inputs and gives the output $f_1, f_2\in$ F.").scale(0.55).shift(2*DOWN) + self.play(ShowCreation(big_box)) + self.play(ShowCreation(box)) + self.play(ShowCreation(Linear),ShowCreation(Functional)) + self.wait(2) + self.play(ShowCreation(arrow1),ShowCreation(u)) + self.play(ShowCreation(arrow3),ShowCreation(f1)) + self.wait(0.7) + self.play(ShowCreation(arrow2),ShowCreation(v)) + self.play(ShowCreation(arrow4),ShowCreation(f2)) + self.wait(1) + self.play(ShowCreation(text)) + self.wait(4) -- cgit From 6f87e58ddc696f7a4408d83610829735885677cd Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:04:13 +0530 Subject: Add files via upload --- .../gifs4/Basis_of_a_dual_vector_space.mp4 | Bin 0 -> 1001766 bytes .../Dual-Spaces/gifs4/Dual_Basis_Example.mp4 | Bin 0 -> 1075193 bytes .../Dual-Spaces/gifs4/Dual_of_a_Cube.mp4 | Bin 0 -> 1425728 bytes .../Dual-Spaces/gifs4/Duality_in_Sets.mp4 | Bin 0 -> 126824 bytes .../Dual-Spaces/gifs4/Linear_functional.mp4 | Bin 0 -> 261541 bytes 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Basis_of_a_dual_vector_space.mp4 create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Dual_Basis_Example.mp4 create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Dual_of_a_Cube.mp4 create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Duality_in_Sets.mp4 create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Linear_functional.mp4 (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Basis_of_a_dual_vector_space.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Basis_of_a_dual_vector_space.mp4 new file mode 100644 index 0000000..b96f541 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Basis_of_a_dual_vector_space.mp4 differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Dual_Basis_Example.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Dual_Basis_Example.mp4 new file mode 100644 index 0000000..c93be25 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Dual_Basis_Example.mp4 differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Dual_of_a_Cube.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Dual_of_a_Cube.mp4 new file mode 100644 index 0000000..ebfb564 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Dual_of_a_Cube.mp4 differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Duality_in_Sets.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Duality_in_Sets.mp4 new file mode 100644 index 0000000..86cc693 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Duality_in_Sets.mp4 differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Linear_functional.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Linear_functional.mp4 new file mode 100644 index 0000000..d41fada Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Dual-Spaces/gifs4/Linear_functional.mp4 differ -- cgit From 5d0ee230f358aa05695af89d55f1a1c28617945b Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:23:07 +0530 Subject: Delete Vector_Addition_and_Scaling.py --- .../Vector-Spaces/Vector_Addition_and_Scaling.py | 137 --------------------- 1 file changed, 137 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/Vector_Addition_and_Scaling.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/Vector_Addition_and_Scaling.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/Vector_Addition_and_Scaling.py deleted file mode 100644 index 70af123..0000000 --- a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/Vector_Addition_and_Scaling.py +++ /dev/null @@ -1,137 +0,0 @@ -from manimlib.imports import * -import numpy as np - -class vectorspace(GraphScene): - CONFIG={ - "x_min": -7, - "x_max": 7, - "y_min": -7, - "y_max": 7, - "graph_origin": ORIGIN, - "x_axis_label":"$X$", - "y_axis_label":"$Y$", - "x_labeled_nums": list(np.arange(-7, 8,1)), - "y_labeled_nums": list(np.arange(-7, 8,1)), - "x_axis_width": 8, - "y_axis_height": 7, - "x_tick_frequency":1, - "axes_color": GREY, - "area_opacity": 3, - "num_rects": 10, - } - 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) - a1=1*XD*RIGHT+2*YD*UP - a2=1*XD*RIGHT+1*YD*UP - vec1=Vector(direction=a1).set_color(RED_E) - vec1.shift(self.graph_origin) - vec2=Vector(direction=a2).set_color(YELLOW_E) - vec2.shift(self.graph_origin) - vec1_text=TextMobject(r"$\vec{a}$") - vec2_text=TextMobject(r"$\vec{b}$") - vec1_text=(vec1_text.shift(self.graph_origin+a1+0.2)).scale(.7) - vec2_text=(vec2_text.shift(self.graph_origin+a2+0.2)).scale(.7) - self.setup_axes(animate=True) - self.wait(2) - self.play(ShowCreation(vec1)) - self.play(ShowCreation(vec1_text)) - self.wait(.7) - self.play(ShowCreation(vec2)) - self.play(ShowCreation(vec2_text)) - self.wait(.7) - a=TextMobject(r"$\vec{a} = (1,2)$",color=RED_B).scale(.6) - a.shift(3*LEFT+2.7*UP) - b=TextMobject(r"$\vec{b} = (1,1)$",color=YELLOW_E).scale(.6) - b.shift(3*LEFT+2*UP) - self.play(ShowCreation(a)) - self.play(ShowCreation(b)) - self.wait(.5) - c=TextMobject(r"$2\cdot\vec{a} = 2\cdot(1,2) = (2,4)$",color=RED_B) - c.shift(3*LEFT+2.7*UP) - c.scale(.6) - self.play(Transform(a,c)) - scaling1=TextMobject(r"Scaling vector $\vec{a}$ by 2 units",color=GOLD).scale(.5) - scaling1.shift(3.4*RIGHT+2.4*UP) - self.play(ShowCreation(scaling1)) - a1=2*XD*RIGHT+4*YD*UP - self.play(FadeOut(vec1_text)) - vec1_scaled=Vector(direction=a1).set_color(RED_E) - vec1_scaled.shift(self.graph_origin) - self.play(ShowCreation(vec1_scaled)) - self.play(FadeOut(vec1)) - vec1_scaled_text=TextMobject(r"$2\vec{a}$").scale(.7) - vec1_scaled_text.shift(self.graph_origin+a1+0.2) - self.play(ShowCreation(vec1_scaled_text)) - self.play(FadeOut(scaling1)) - d=TextMobject(r"$3\cdot\vec{b} = 3\cdot(1,1) = (3,3)$",color=YELLOW_E).scale(.6) - d.shift(3*LEFT+2*UP) - self.play(Transform(b,d)) - scaling2=TextMobject(r"Scaling vector $\vec{b}$ by 3 units",color=GOLD).scale(.5) - scaling2.shift(3.4*RIGHT+2.4*UP) - self.play(ShowCreation(scaling2)) - a2=3*XD*RIGHT+3*YD*UP - self.play(FadeOut(vec2_text)) - vec2_2=Vector - vec2_scaled=Vector(direction=a2).set_color(YELLOW_E) - vec2_scaled.shift(self.graph_origin) - self.play(ShowCreation(vec2_scaled)) - self.play(FadeOut(vec2)) - vec2_scaled_text=TextMobject(r"$3\vec{b}$").scale(.7) - vec2_scaled_text.shift(self.graph_origin+a2+0.2) - self.play(ShowCreation(vec2_scaled_text)) - self.wait(.7) - self.play(FadeOut(scaling2)) - add = TextMobject("+").scale(.7) - add.shift(4.8*LEFT+2*UP) - self.play(ShowCreation(add)) - self.wait(.5) - line = Line() - line.shift(3*LEFT+1.6*UP) - line.scale(1.8) - self.play(ShowCreation(line)) - self.wait(1) - e = TextMobject(r"$\vec{c} = 2\cdot\vec{a} + 3\cdot\vec{b} = (5,7)$",color=GREEN_D).scale(.6) - e.shift(3*LEFT+1.3*UP) - self.play(ShowCreation(e)) - self.wait(.5) - add1=TextMobject("Addition of the scaled vectors",color=GOLD).scale(.5) - add1.shift(4.1*RIGHT+2.4*UP) - self.play(ShowCreation(add1)) - self.wait(.5) - self.play(FadeOut(vec1_scaled_text)) - self.play(FadeOut(vec2_scaled_text)) - self.play(FadeOut(vec1_scaled)) - vec1_scaled2=Vector(direction=a1).set_color(RED_E) - vec1_scaled2.shift(self.graph_origin+3*RIGHT*XD+3*UP*YD) - self.play(ShowCreation(vec1_scaled2)) - a3=5*XD*RIGHT+7*YD*UP - vec3=Vector(direction=a3).set_color(GREEN_C) - vec3.shift(self.graph_origin) - vec3_text=TextMobject(r"$\vec{c}$").scale(.7) - vec3_text.shift(self.graph_origin+a3+0.2) - self.play(ShowCreation(vec3)) - self.wait(.5) - self.play(ShowCreation(vec3_text)) - self.wait(1) - - - - - - - - - - - - - - - - - - - - - -- cgit From 35157fabe0495dc8320cc4693cbc85db4a256871 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:24:46 +0530 Subject: Add files via upload --- .../Vector_Addition_and_Scalar_Multiplication.py | 177 +++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/Vector_Addition_and_Scalar_Multiplication.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/Vector_Addition_and_Scalar_Multiplication.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/Vector_Addition_and_Scalar_Multiplication.py new file mode 100644 index 0000000..12c9bce --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Vector-Spaces/Vector_Addition_and_Scalar_Multiplication.py @@ -0,0 +1,177 @@ +from manimlib.imports import * +VECTORS = [[1, 2], + [1, 1], + [2, 2], + [3, 4]] +class Scene1(LinearTransformationScene): + CONFIG = { + "include_background_plane": True, + "include_foreground_plane": False, + "show_coordinates": True, + "show_basis_vectors": False, + "basis_vector_stroke_width": 3, + } + def construct(self): + self.write_stuff() + v1 = self.add_vector(VECTORS[0],color = YELLOW, stroke_width = 3.5) + line1 = Line(start = ORIGIN, end = VECTORS[0][0]*RIGHT) + line1.set_color(RED_B) + line2 = Line(start = line1.get_end(), end = line1.get_end() + VECTORS[0][1]*UP) + line2.set_color(GREEN_D) + self.play(ShowCreation(line1)) + self.play(ShowCreation(line2)) + self.wait(0.5) + text1 = TextMobject("(1, 2)",color=YELLOW).scale(0.6).shift(2*UP + 1.5*RIGHT) + self.play(ShowCreation(text1)) + text2 = TextMobject(r"$\vec{a}$",color = YELLOW).scale(0.8).shift(2*UP + 1.2*RIGHT) + text3 = TextMobject(r"\text{$\vec{a}$}",r"\text{=}",r"\text{(1, 2)}").scale(0.7).shift(5.1*LEFT + 2.5*UP) + text3[0].set_color(YELLOW) + text3[2].set_color(YELLOW) + self.wait(1) + self.play(Transform(text1,text2),FadeOut(line1),FadeOut(line2)) + self.wait(0.5) + self.play(ShowCreation(text3)) + self.wait(1) + + + v2 = self.add_vector(VECTORS[1],color = BLUE, stroke_width = 3.5) + line3 = Line(start = ORIGIN, end = VECTORS[1][0]*RIGHT) + line3.set_color(RED_B) + line4 = Line(start = line3.get_end(), end = line3.get_end() + VECTORS[1][1]*UP) + line4.set_color(GREEN_D) + self.play(ShowCreation(line3)) + self.play(ShowCreation(line4)) + self.wait(0.5) + text4 = TextMobject("(2, 2)",color=BLUE).scale(0.6).shift(1*UP + 1.5*RIGHT) + self.play(ShowCreation(text4)) + text5 = TextMobject(r"$\vec{b}$",color = BLUE).scale(0.8).shift(1*UP + 1.2*RIGHT) + text6 = TextMobject(r"\text{$\vec{b}$}",r"\text{=}",r"\text{(1, 1)}").scale(0.7).shift(5.1*LEFT + 1.8*UP) + text6[0].set_color(BLUE) + text6[2].set_color(BLUE) + self.wait(1) + self.play(Transform(text4,text5),FadeOut(line3),FadeOut(line4)) + self.wait(0.5) + self.play(ShowCreation(text6)) + self.wait(2) + + + + text7 = TextMobject(r"\text{Scaling}",r"\text{ $\vec{b}$ }",r"\text{by 2 units}",color = GOLD).scale(0.7).shift(2.8*UP+4*RIGHT) + text7[1].set_color(BLUE) + self.play(ShowCreation(text7)) + self.play(FadeOut(text4)) + v3 = self.add_vector(VECTORS[2],color = BLUE, stroke_width = 3.5) + line7 = Line(start = ORIGIN, end = VECTORS[2][0]*RIGHT) + line7.set_color(RED_B) + line8 = Line(start = line7.get_end(), end = line7.get_end() + VECTORS[2][1]*UP) + line8.set_color(GREEN_D) + self.play(FadeOut(v2)) + self.play(ShowCreation(line7)) + self.play(ShowCreation(line8)) + + + self.wait(0.5) + + text8 = TextMobject("(2, 2)",color=BLUE).scale(0.6).shift(2.5*RIGHT + 2*UP) + text9 = TextMobject(r"$2\vec{b}$",color = BLUE).scale(0.8).shift(2*UP + 2.3*RIGHT) + self.play(ShowCreation(text8)) + self.wait(1) + self.play(Transform(text8,text9),FadeOut(line7),FadeOut(line8)) + self.wait(1) + text10 = TextMobject(r"\text{$2\vec{b}$}",r"\text{=}",r"\text{(2, 2)}").scale(0.7).shift(5.1*LEFT + 1.8*UP) + text10[0].set_color(BLUE) + text10[2].set_color(BLUE) + self.play(Transform(text6,text10)) + self.wait(1) + self.play(FadeOut(text7)) + self.wait(1.5) + + + + text11 = TextMobject(r"Addition of vectors",color = GOLD).scale(0.7).shift(2.8*UP+5*RIGHT) + self.play(ShowCreation(text11)) + v1.move_to(3*UP+2.5*RIGHT) + self.play(ShowCreation(v1),FadeOut(text8),FadeOut(text1)) + v4 = self.add_vector(VECTORS[3],color = ORANGE, stroke_width = 3.5) + line7 = Line(start = ORIGIN, end = VECTORS[3][0]*RIGHT) + line7.set_color(RED_B) + line8 = Line(start = line7.get_end(), end = line7.get_end() + VECTORS[3][1]*UP) + line8.set_color(GREEN_D) + self.play(ShowCreation(line7)) + self.play(ShowCreation(line8)) + text12 = TextMobject("(3, 4)",color=ORANGE).scale(0.6).shift(3.5*RIGHT + 3.8*UP) + text13 = TextMobject(r"$\vec{c}$",color = ORANGE).scale(0.8).shift(3.7*UP + 3.3*RIGHT) + self.play(ShowCreation(text12)) + self.wait(1) + self.play(Transform(text12,text13),FadeOut(line7),FadeOut(line8)) + self.wait(1) + add = TextMobject("+").scale(0.8).shift(6.2*LEFT + 1.8*UP) + line_1= Line().shift(1.5*UP+5.1*LEFT).scale(1.5) + line_2= Line().shift(0.8*UP+5.1*LEFT).scale(1.5) + + text14=TextMobject(r"\text{$\vec{c}$}",r"\text{=}",r"\text{$\vec{a}$}",r"\text{+}",r"\text{$2\vec{b}$}",r"\text{=}",r"\text{(3, 4)}").scale(0.7).shift(1.2*UP+5.1*LEFT) + text14[0].set_color(ORANGE) + text14[2].set_color(YELLOW) + text14[4].set_color(BLUE) + text14[6].set_color(ORANGE) + + + self.play(ShowCreation(add),ShowCreation(line_1)) + self.play(ShowCreation(text14),ShowCreation(line_2)) + self.wait(3) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + def write_stuff(self): + self.text = [] + text = self.text + + text.append(TexMobject(r"\text{Consider the Vector Space }", + r"{\mathbb{R}^2}")) + self.add_title(text[0], 0.7, animate = True) + text.append(TexMobject(r"{\mathbb{R}^2}", + tex_to_color_map = {r"{\mathbb{R}^2}": BLUE_E})) + text[1].shift(6.5*LEFT+3.5*UP) + self.wait(0.5) + self.play(Transform(text[0], text[1])) + + + + + + + + + + + + + + + -- cgit From 623a886ee128c7919e3c6b521812a538a3f17603 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:27:40 +0530 Subject: Add files via upload --- .../gifs2/Projection_of_vectors_in-3D_plane.mp4 | Bin 0 -> 361410 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Projection_of_vectors_in-3D_plane.mp4 (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Projection_of_vectors_in-3D_plane.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Projection_of_vectors_in-3D_plane.mp4 new file mode 100644 index 0000000..bdca5f9 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Projection_of_vectors_in-3D_plane.mp4 differ -- cgit From b54198b0db47c50f6584eb5e0b9ec54d2c1608b6 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:29:57 +0530 Subject: Add files via upload --- .../Inner-Product_Spaces/Projection-in-3D-space.py | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Projection-in-3D-space.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Projection-in-3D-space.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Projection-in-3D-space.py new file mode 100644 index 0000000..e99202f --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Projection-in-3D-space.py @@ -0,0 +1,31 @@ +from manimlib.imports import * +class ThreeDSpace(ThreeDScene): + + def construct(self): + axes = ThreeDAxes() + axes.set_stroke(width=1,color=GOLD) + self.add(axes) + self.set_camera_orientation(phi = 70*DEGREES,theta =110*DEGREES) + line1 = Line(color = YELLOW,opacity=350,start = ORIGIN,end = [0.5,2,2]) + self.play(ShowCreation(line1)) + self.wait(1) + line2 = Line(color = BLUE,opacity=350,start = ORIGIN,end = [2,2,-1]) + self.play(ShowCreation(line2)) + self.wait(1) + line3 = Line(opacity=350,start=axes.c2p(0.5,2,2) ,end=axes.c2p(0.5,1.14,-0.17)) + self.play(ShowCreation(line3)) + self.wait(1) + line4 = Line(color=RED,opacity=350,start = ORIGIN,end=[0.5,1.14,-0.145]) + self.play(ShowCreation(line4)) + self.wait(2) + text1 = TextMobject(r"\text{Projection on }",r"\text{$\vec{v}$}",r"\text{ onto }",r"\text{$\vec{u}$}",r"\text{ = }",r"\text{$ |\vec{v}|cos\theta$,}").scale(0.6).shift(4*LEFT+3.5*UP) + text1[1].set_color(YELLOW) + text1[3].set_color(BLUE) + text1[5].set_color(RED) + text2 = TextMobject(r"\text{where $\theta$ is the angle between the vectors.}").scale(0.6).shift(4*LEFT+3*UP) + self.add_fixed_in_frame_mobjects(text1) + self.add_fixed_in_frame_mobjects(text2) + self.play(ShowCreation(text1),ShowCreation(text2)) + self.wait(3) + + -- cgit From 8cc58b1a6fc3f705759cf789f4dbc6fc247c21a1 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:30:40 +0530 Subject: Delete Inner_Product_Space_Example.py --- .../Inner_Product_Space_Example.py | 175 --------------------- 1 file changed, 175 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Space_Example.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Space_Example.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Space_Example.py deleted file mode 100644 index 1f98bad..0000000 --- a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Space_Example.py +++ /dev/null @@ -1,175 +0,0 @@ -from manimlib.imports import * -from scipy import sin,cos -class Inner_Product_Space_Example(GraphScene): - CONFIG = { - "x_min" : 0, - "x_max" : 5, - "y_min" : 0, - "y_max" : 6, - "y_tick_frequency" : 1, - "x_tick_frequency" : 1, - "axes_color":LIGHT_GRAY, - "x_labeled_nums" : list(range(6)), - "y_labeled_nums" : list(range(6)) - } - def construct(self): - self.setup_axes(animate=True) - curve1 = self.get_graph(lambda x : sin(x), x_min=0,x_max=2.3,color=RED) - curve2 = self.get_graph(lambda x : x, x_min=0,x_max=2.3,color=DARK_BLUE) - curve3 = self.get_graph(lambda x : 1.4, x_min=0,x_max=2.3,color=GREEN) - text1 = TextMobject(r"$f(x)$").scale(0.5).shift(1.77*DOWN+0.55*RIGHT) - - text2 = TextMobject(r"$g(x)$").scale(0.5).shift(0.15*DOWN+0.55*RIGHT) - text3 = TextMobject(r"$h(x)$").scale(0.5).shift(1.03*DOWN+0.55*RIGHT) - - self.play(ShowCreation(curve1),ShowCreation(text1)) - self.wait(1) - self.play(ShowCreation(curve2),ShowCreation(text2)) - self.wait(1) - self.play(ShowCreation(curve3),ShowCreation(text3)) - self.wait(2) - curve4 = self.get_graph(lambda x : sin(x) + x, x_min=0,x_max=2.3,color=YELLOW) - text4 = TextMobject(r"$f(x) + g(x)$").scale(0.5).shift(0.6*UP+1*RIGHT) - self.wait(1.5) - - self.play(ShowCreation(curve4),ShowCreation(text4),FadeOut(curve2),FadeOut(text2),FadeOut(curve1),FadeOut(text1)) - self.wait(1.5) - text5 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} (f(x) + g(x))h(x)$ $dx$}").scale(0.57).shift(4*RIGHT+3.5*UP) - text5[1].set_color(ORANGE) - self.play(ShowCreation(text5)) - - curve5 = self.get_graph(lambda x : (sin(x) + x)*1.6, x_min=0,x_max=2.3,color=ORANGE) - text6 = TextMobject(r"$(f(x) + g(x))\cdot h(x)$").scale(0.5).shift(2.2*UP+1.4*RIGHT) - area1 = self.get_area(curve5,0,2.3) - area1.set_color(ORANGE) - self.wait(1) - self.play(FadeOut(curve4),FadeOut(text4),FadeOut(curve3),FadeOut(text3),ShowCreation(curve5),ShowCreation(text6),ShowCreation(area1)) - self.wait(2) - text7 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} (f(x)h(x)$ $dx$}").scale(0.57).shift(5*RIGHT+3*UP) - text7[1].set_color(BLUE) - self.play(ShowCreation(text7)) - self.wait(1.5) - curve6 = self.get_graph(lambda x : (sin(x))*1.6, x_min=0,x_max=2.3,color=BLUE) - text8 = TextMobject(r"$f(x)\cdot h(x)$").scale(0.5).shift(1.4*DOWN+0.8*RIGHT) - area2 = self.get_area(curve6,0,2.3) - self.play(ShowCreation(curve6),ShowCreation(text8),ShowCreation(area2)) - self.wait(1.5) - text9 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} (g(x)h(x)$ $dx$}").scale(0.57).shift(5*RIGHT+2.5*UP) - text9[1].set_color(MAROON_B) - self.play(ShowCreation(text9)) - self.wait(1.5) - curve7 = self.get_graph(lambda x : x*1.6, x_min=0,x_max=2.3,color=MAROON_B) - text10 = TextMobject(r"$g(x)\cdot h(x)$").scale(0.5).shift(0.8*RIGHT+1*UP) - area3 = self.get_area(curve7,0,2.3) - area3.set_color(MAROON_B) - self.play(ShowCreation(curve7),ShowCreation(text10),ShowCreation(area3)) - self.wait(2.6) - curve8 = self.get_graph(lambda x : (sin(x))*1.6 + x*1.6, x_min=0,x_max=2.3,color=RED_C) - area4 = self.get_area(curve8,0,2.3) - area4.set_color(RED_C) - text11 = TextMobject(r"$f(x)h(x) + g(x)h(x)$").scale(0.5).shift(2.2*UP + 1.4*RIGHT) - self.play(FadeOut(curve6),FadeOut(text8),FadeOut(curve7),FadeOut(text10),FadeOut(area2),FadeOut(area3),ShowCreation(curve8),ShowCreation(area4)) - self.wait(1) - self.play(Transform(text6,text11)) - self.wait(1.7) - text12 = TextMobject(r"$$ = $$ + $$").scale(0.465).shift(0.7*UP+4*RIGHT) - rect1 = Rectangle(height=0.5) - rect1.surround(text12) - self.play(ShowCreation(text12),ShowCreation(rect1)) - self.wait(3) - self.play(FadeOut(text6),FadeOut(text5),FadeOut(text7),FadeOut(text9),FadeOut(text12),FadeOut(rect1),FadeOut(curve8),FadeOut(area4),FadeOut(text11),FadeOut(curve5),FadeOut(area1)) - - curve2.set_color(ORANGE) - self.play(ShowCreation(curve1),ShowCreation(text1)) - self.wait(1) - self.play(ShowCreation(curve2),ShowCreation(text2)) - self.wait(2) - curve9 = self.get_graph(lambda x : 2*sin(x), x_min=0,x_max=2.3,color=GREEN) - text13 = TextMobject(r"$2f(x)$").scale(0.5).shift(1.1*DOWN+0.55*RIGHT) - self.play(Transform(curve1,curve9),Transform(text1,text13)) - self.wait(1.5) - - text14 = TextMobject(r"\text{$<2f(x), g(x)>$ = ",r"\text{$\int_{a}^{b} (2f(x))g(x)$ $dx$}").scale(0.57).shift(4*RIGHT+3.5*UP) - text14[1].set_color(YELLOW) - self.play(ShowCreation(text14)) - self.wait(2.2) - curve10 = self.get_graph(lambda x : 2*sin(x)*x, x_min=0,x_max=2.3,color=YELLOW) - text15 = TextMobject(r"$2f(x)\cdot g(x)$").scale(0.5).shift(1*RIGHT+0.97*UP) - area5 = self.get_area(curve10,0,2.3) - area5.set_color(YELLOW) - self.play(ShowCreation(area5),ShowCreation(curve10),ShowCreation(text15),FadeOut(curve1),FadeOut(text1),FadeOut(curve2),FadeOut(text2)) - self.wait(2) - text16 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} f(x)g(x)$ $dx$}").scale(0.57).shift(3.8*RIGHT+2.9*UP) - text16[1].set_color(TEAL) - self.play(ShowCreation(text16)) - self.wait(1.7) - curve11 = self.get_graph(lambda x : sin(x)*x, x_min=0,x_max=2.3,color=TEAL) - area6 = self.get_area(curve11,0,2.3) - area6.set_color(TEAL) - text17 = TextMobject(r"$f(x)\cdot g(x)$").scale(0.5).shift(0.9*RIGHT+0.7*DOWN) - self.play(ShowCreation(curve11),ShowCreation(text17),ShowCreation(area6)) - self.wait(2) - - text18 = TextMobject(r"\text{$2 $ = ",r"\text{$2 \int_{a}^{b} f(x)g(x)$ $dx$}").scale(0.57).shift(4*RIGHT+2.3*UP) - text18[1].set_color(DARK_BLUE) - self.play(ShowCreation(text18)) - self.wait(2) - curve12 = self.get_graph(lambda x : 2*sin(x)*x, x_min=0,x_max=2.3,color=DARK_BLUE) - area7 = self.get_area(curve12,0,2.3) - area7.set_color(DARK_BLUE) - text19 = TextMobject(r"= $2( f(x)\cdot g(x) )$").scale(0.5).shift(2.5*RIGHT+0.97*UP) - self.play(ShowCreation(curve12),ShowCreation(area7),ShowCreation(text19),FadeOut(text17),FadeOut(area6),FadeOut(curve11)) - - self.wait(2.5) - text20 = TextMobject(r"$<2f(x), g(x)>$ = $2$").scale(0.57).shift(0.6*DOWN+4*RIGHT) - rect2 = Rectangle(height=0.5) - rect2.surround(text20) - self.play(ShowCreation(text20),ShowCreation(rect2)) - self.wait(3) - - self.play(FadeOut(text14),FadeOut(text15),FadeOut(text19),FadeOut(text16),FadeOut(text18),FadeOut(rect2),FadeOut(curve10),FadeOut(area5),FadeOut(curve12),FadeOut(area7),FadeOut(text20)) - curve1 = self.get_graph(lambda x : sin(x), x_min=0,x_max=2.3,color=YELLOW) - text1 = TextMobject(r"$f(x)$").scale(0.5).shift(1.77*DOWN+0.55*RIGHT) - self.play(ShowCreation(curve1),ShowCreation(text1)) - self.wait(1.5) - self.play(ShowCreation(curve2),ShowCreation(text2)) - self.wait(1.7) - text21 = TextMobject(r"\text{$$ = ",r"\text{$\int_{a}^{b} f(x)g(x)$ $dx$}").scale(0.57).shift(3.5*RIGHT+3*UP) - text21[1].set_color(GREEN) - self.play(ShowCreation(text21)) - self.wait(2) - curve13 = self.get_graph(lambda x : sin(x)*x, x_min=0,x_max=2.3,color=GREEN) - area8 = self.get_area(curve13,0,2.3) - area8.set_color(GREEN) - text22 = TextMobject(r"$f(x)\cdot g(x)$").scale(0.5).shift(0.8*RIGHT+0.7*DOWN) - self.play(ShowCreation(curve13),ShowCreation(area8),ShowCreation(text22),FadeOut(curve1),FadeOut(text1),FadeOut(curve2),FadeOut(text2)) - self.wait(2.2) - curve14 = self.get_graph(lambda x : sin(x)*x, x_min=0,x_max=2.3,color=RED) - area9 = self.get_area(curve14,0,2.3) - area9.set_color(RED) - self.play(ShowCreation(curve14),ShowCreation(area9)) - text23 = TextMobject(r"= $\overline{f(x)\cdot g(x)}$").scale(0.5).shift(0.7*DOWN+2.1*RIGHT) - self.play(ShowCreation(text23)) - self.wait(2) - text24 = TextMobject(r"For all the real functions").scale(0.5).shift(2*RIGHT+2*UP) - text25 = TextMobject(r"$<\overline{f(x), g(x)}>$ = $$").scale(0.5).shift(2*RIGHT+1.4*UP) - rect3 = Rectangle(height=0.7) - rect3.surround(text25) - self.play(ShowCreation(text24),ShowCreation(text25),ShowCreation(rect3)) - self.wait(3) - - - - - - - - - - - - - - - - -- cgit From 88f9fd8860d8bcfa5794a30d00f21c119b266eea Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:31:53 +0530 Subject: Add files via upload --- .../Inner-Product_Spaces/Inner_Product_Example.py | 182 +++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Example.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Example.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Example.py new file mode 100644 index 0000000..97b9696 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/Inner_Product_Example.py @@ -0,0 +1,182 @@ +from manimlib.imports import * +from scipy import sin,cos +class Inner_Product_Space_Example(GraphScene): + CONFIG = { + "x_min" : 0, + "x_max" : 5, + "y_min" : 0, + "y_max" : 6, + "y_tick_frequency" : 1, + "x_tick_frequency" : 1, + "axes_color":LIGHT_GRAY, + "x_labeled_nums" : list(range(6)), + "y_labeled_nums" : list(range(6)) + } + def construct(self): + self.setup_axes(animate=True) + text = TextMobject(r"$f(x), g(x), h(x) \in C[0, 2]$",color=GOLD).scale(0.5).shift(3.5*UP+5.5*LEFT) + fx = TextMobject(r"$f(x)$ = sin(x)",color=GOLD).scale(0.5).shift(3*UP+6*LEFT) + gx = TextMobject(r"$g(x)$ = x",color=GOLD).scale(0.5).shift(2.5*UP+6.25*LEFT) + hx = TextMobject(r"$h(x)$ = 1.4",color=GOLD).scale(0.5).shift(2*UP+6.2*LEFT) + + curve1 = self.get_graph(lambda x : sin(x), x_min=0,x_max=2,color=RED) + curve2 = self.get_graph(lambda x : x, x_min=0,x_max=2,color=DARK_BLUE) + curve3 = self.get_graph(lambda x : 1.4, x_min=0,x_max=2,color=GREEN) + text1 = TextMobject(r"$f(x)$").scale(0.5).shift(1.7*DOWN) + + text2 = TextMobject(r"$g(x)$").scale(0.5).shift(0.34*DOWN) + text3 = TextMobject(r"$h(x)$").scale(0.5).shift(1.1*DOWN) + + + self.play(ShowCreation(text)) + self.play(ShowCreation(curve1),ShowCreation(text1),ShowCreation(fx)) + self.wait(1) + self.play(ShowCreation(curve2),ShowCreation(text2),ShowCreation(gx)) + self.wait(1) + self.play(ShowCreation(curve3),ShowCreation(text3),ShowCreation(hx)) + self.wait(2) + curve4 = self.get_graph(lambda x : sin(x) + x, x_min=0,x_max=2,color=YELLOW) + text4 = TextMobject(r"$f(x) + g(x)$").scale(0.5).shift(0.5*UP+0.5*RIGHT) + self.wait(1.5) + + self.play(ShowCreation(curve4),ShowCreation(text4),FadeOut(curve2),FadeOut(text2),FadeOut(curve1),FadeOut(text1)) + self.wait(1.5) + text5 = TextMobject(r"\text{$$ = ",r"\text{$\int_{0}^{2} (f(x) + g(x))h(x)$ $dx$}",r"\text{= 4.78}").scale(0.57).shift(3.3*RIGHT+3.5*UP) + text5[1].set_color(ORANGE) + self.play(ShowCreation(text5)) + + curve5 = self.get_graph(lambda x : (sin(x) + x)*1.6, x_min=0,x_max=2,color=ORANGE) + text6 = TextMobject(r"$(f(x) + g(x))\cdot h(x)$").scale(0.5).shift(2.2*UP+0.72*RIGHT) + area1 = self.get_area(curve5,0,2) + area1.set_color(ORANGE) + self.wait(1) + self.play(FadeOut(curve4),FadeOut(text4),FadeOut(curve3),FadeOut(text3),ShowCreation(curve5),ShowCreation(text6),ShowCreation(area1)) + self.wait(2) + text7 = TextMobject(r"\text{$$ = ",r"\text{$\int_{0}^{2} (f(x)h(x)$ $dx$}",r"\text{= 1.98}").scale(0.57).shift(4.5*RIGHT+3*UP) + text7[1].set_color(BLUE) + self.play(ShowCreation(text7)) + self.wait(1.5) + curve6 = self.get_graph(lambda x : (sin(x))*1.6, x_min=0,x_max=2,color=BLUE) + text8 = TextMobject(r"$f(x)\cdot h(x)$").scale(0.5).shift(0.9*DOWN+0.3*RIGHT) + area2 = self.get_area(curve6,0,2) + self.play(ShowCreation(curve6),ShowCreation(text8),ShowCreation(area2)) + self.wait(1.5) + text9 = TextMobject(r"\text{$$ = ",r"\text{$\int_{0}^{2} (g(x)h(x)$ $dx$}",r"\text{= 2.8}").scale(0.57).shift(4.5*RIGHT+2.5*UP) + text9[1].set_color(MAROON_B) + self.play(ShowCreation(text9)) + self.wait(1.5) + curve7 = self.get_graph(lambda x : x*1.6, x_min=0,x_max=2,color=MAROON_B) + text10 = TextMobject(r"$g(x)\cdot h(x)$").scale(0.5).shift(0.3*RIGHT+0.78*UP) + area3 = self.get_area(curve7,0,2) + area3.set_color(MAROON_B) + self.play(ShowCreation(curve7),ShowCreation(text10),ShowCreation(area3)) + self.wait(2.6) + curve8 = self.get_graph(lambda x : (sin(x))*1.6 + x*1.6, x_min=0,x_max=2,color=RED_C) + area4 = self.get_area(curve8,0,2) + area4.set_color(RED_C) + text11 = TextMobject(r"$f(x)h(x) + g(x)h(x)$").scale(0.5).shift(2.2*UP + 0.76*RIGHT) + self.play(FadeOut(curve6),FadeOut(text8),FadeOut(curve7),FadeOut(text10),FadeOut(area2),FadeOut(area3),ShowCreation(curve8),ShowCreation(area4)) + self.wait(1) + self.play(Transform(text6,text11)) + self.wait(1.7) + text12 = TextMobject(r"$$ = $$ + $$").scale(0.465).shift(0.7*UP+4*RIGHT) + rect1 = Rectangle(height=0.5) + rect1.surround(text12) + self.play(ShowCreation(text12),ShowCreation(rect1)) + self.wait(3) + self.play(FadeOut(text6),FadeOut(text5),FadeOut(text7),FadeOut(text9),FadeOut(text12),FadeOut(rect1),FadeOut(curve8),FadeOut(area4),FadeOut(text11),FadeOut(curve5),FadeOut(area1)) + + curve2.set_color(ORANGE) + self.play(ShowCreation(curve1),ShowCreation(text1)) + self.wait(1) + self.play(ShowCreation(curve2),ShowCreation(text2)) + self.wait(2) + curve9 = self.get_graph(lambda x : 2*sin(x), x_min=0,x_max=2,color=GREEN) + text13 = TextMobject(r"$2f(x)$").scale(0.5).shift(0.75*DOWN) + self.play(Transform(curve1,curve9),Transform(text1,text13)) + self.wait(1.5) + + text14 = TextMobject(r"\text{$<2f(x), g(x)>$ = ",r"\text{$\int_{0}^{2} (2f(x))g(x)$ $dx$}",r"\text{= 3.48}").scale(0.57).shift(4*RIGHT+3.5*UP) + text14[1].set_color(YELLOW) + self.play(ShowCreation(text14)) + self.wait(2.2) + curve10 = self.get_graph(lambda x : 2*sin(x)*x, x_min=0,x_max=2,color=YELLOW) + text15 = TextMobject(r"$2f(x)\cdot g(x)$").scale(0.5).shift(0.35*RIGHT+1.03*UP) + area5 = self.get_area(curve10,0,2) + area5.set_color(YELLOW) + self.play(ShowCreation(area5),ShowCreation(curve10),ShowCreation(text15),FadeOut(curve1),FadeOut(text1),FadeOut(curve2),FadeOut(text2)) + self.wait(2) + text16 = TextMobject(r"\text{$$ = ",r"\text{$\int_{0}^{2} f(x)g(x)$ $dx$}",r"\text{= 1.74}").scale(0.57).shift(3.8*RIGHT+2.9*UP) + text16[1].set_color(TEAL) + self.play(ShowCreation(text16)) + self.wait(1.7) + curve11 = self.get_graph(lambda x : sin(x)*x, x_min=0,x_max=2,color=TEAL) + area6 = self.get_area(curve11,0,2) + area6.set_color(TEAL) + text17 = TextMobject(r"$f(x)\cdot g(x)$").scale(0.5).shift(0.4*RIGHT+0.7*DOWN) + self.play(ShowCreation(curve11),ShowCreation(text17),ShowCreation(area6)) + self.wait(2) + + text18 = TextMobject(r"\text{$2 $ = ",r"\text{$2 \int_{0}^{2} f(x)g(x)$ $dx$}",r"\text{= 3.48}").scale(0.57).shift(4*RIGHT+2.3*UP) + text18[1].set_color(DARK_BLUE) + self.play(ShowCreation(text18)) + self.wait(2) + curve12 = self.get_graph(lambda x : 2*sin(x)*x, x_min=0,x_max=2,color=DARK_BLUE) + area7 = self.get_area(curve12,0,2) + area7.set_color(DARK_BLUE) + text19 = TextMobject(r"= $2( f(x)\cdot g(x) )$").scale(0.5).shift(1.89*RIGHT+1.03*UP) + self.play(ShowCreation(curve12),ShowCreation(area7),ShowCreation(text19),FadeOut(text17),FadeOut(area6),FadeOut(curve11)) + + self.wait(2.5) + text20 = TextMobject(r"$<2f(x), g(x)>$ = $2$").scale(0.57).shift(0.6*DOWN+4*RIGHT) + rect2 = Rectangle(height=0.5) + rect2.surround(text20) + self.play(ShowCreation(text20),ShowCreation(rect2)) + self.wait(3) + + self.play(FadeOut(text14),FadeOut(text15),FadeOut(text19),FadeOut(text16),FadeOut(text18),FadeOut(rect2),FadeOut(curve10),FadeOut(area5),FadeOut(curve12),FadeOut(area7),FadeOut(text20)) + curve1 = self.get_graph(lambda x : sin(x), x_min=0,x_max=2,color=YELLOW) + text1 = TextMobject(r"$f(x)$").scale(0.5).shift(1.77*DOWN) + self.play(ShowCreation(curve1),ShowCreation(text1)) + self.wait(1.5) + self.play(ShowCreation(curve2),ShowCreation(text2)) + self.wait(1.7) + text21 = TextMobject(r"\text{$$ = ",r"\text{$\int_{0}^{2} f(x)g(x)$ $dx$}",r"\text{= 1.74}").scale(0.57).shift(3.5*RIGHT+3*UP) + text21[1].set_color(GREEN) + self.play(ShowCreation(text21)) + self.wait(2) + curve13 = self.get_graph(lambda x : sin(x)*x, x_min=0,x_max=2,color=GREEN) + area8 = self.get_area(curve13,0,2) + area8.set_color(GREEN) + text22 = TextMobject(r"$f(x)\cdot g(x)$").scale(0.5).shift(0.32*RIGHT+0.7*DOWN) + self.play(ShowCreation(curve13),ShowCreation(area8),ShowCreation(text22),FadeOut(curve1),FadeOut(text1),FadeOut(curve2),FadeOut(text2)) + self.wait(2.2) + curve14 = self.get_graph(lambda x : sin(x)*x, x_min=0,x_max=2,color=RED) + area9 = self.get_area(curve14,0,2) + area9.set_color(RED) + self.play(ShowCreation(curve14),ShowCreation(area9)) + text23 = TextMobject(r"= $\overline{f(x)\cdot g(x)}$").scale(0.5).shift(0.7*DOWN+1.7*RIGHT) + self.play(ShowCreation(text23)) + self.wait(2) + text24 = TextMobject(r"For all the real functions").scale(0.5).shift(2*RIGHT+2*UP) + text25 = TextMobject(r"$<\overline{f(x), g(x)}>$ = $$").scale(0.5).shift(2*RIGHT+1.4*UP) + rect3 = Rectangle(height=0.7) + rect3.surround(text25) + self.play(ShowCreation(text24),ShowCreation(text25),ShowCreation(rect3)) + self.wait(3) + + + + + + + + + + + + + + + + -- cgit From 5a45e266c3484c6bb2ff46cf68ce67bbfe566ee5 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:32:40 +0530 Subject: Delete Linear_Subspace.py --- .../Vector-Spaces/Subspaces/Linear_Subspace.py | 42 ---------------------- 1 file changed, 42 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py deleted file mode 100644 index 9062b30..0000000 --- a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Linear_Subspace.py +++ /dev/null @@ -1,42 +0,0 @@ -from manimlib.imports import * -class Subspace(ThreeDScene): - - - def construct(self): - axes = ThreeDAxes() - self.set_camera_orientation(phi = 80*DEGREES,theta =110*DEGREES) - self.begin_ambient_camera_rotation(rate=0.09) - cube = Cube(stroke_width=5,color=WHITE).shift([1.5,1.5,1.5]).scale(1.5) - cube.set_fill(TEAL) - - cube.set_opacity(0.4) - line = Line(color=MAROON,set_opacity=100).shift([1.5,1.5,1.5]).scale(1.5) - plane1 = Polygon([0,0,3],[3,0,3],[3,3,0],[0,3,0]) - plane1.set_opacity(0.8) - plane1.set_fill(YELLOW) - plane1.set_color(YELLOW) - - - plane2 = Polygon([0,3,3],[3,3,3],[3,0,0],[0,0,0]) - plane2.set_opacity(0.7) - plane2.set_fill(RED) - plane2.set_color(RED) - - vgroup = VGroup(plane1,plane2,line,cube) - vgroup.shift([-2,-2,-2]) - - text = TextMobject(r"\text{The}",r"\text{line}",r"\text{representing the intersection of the two planes is a Subspace.}",opacity = 0.6).scale(0.7).shift(3*UP) - text[1].set_color(MAROON) - self.add_fixed_in_frame_mobjects(text) - self.play(ShowCreation(text)) - - - self.play(ShowCreation(cube)) - self.play(ShowCreation(plane1)) - self.play(ShowCreation(plane2)) - self.play(ShowCreation(line)) - self.wait(10) - - - - \ No newline at end of file -- cgit From 0ddf557bde12f37d6053403e5f4ff16ff863296e Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:33:08 +0530 Subject: Delete Subspace_Example.py --- .../Vector-Spaces/Subspaces/Subspace_Example.py | 86 ---------------------- 1 file changed, 86 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py deleted file mode 100644 index d87cd89..0000000 --- a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Example.py +++ /dev/null @@ -1,86 +0,0 @@ -from manimlib.imports import * -class Subspace_Example(Scene): - def construct(self): - sq = Square(side = 2, color=BLACK).shift(2*LEFT) - sq.set_fill(color=RED,opacity=350) - line1=Line(color=BLACK).shift(2*LEFT) - line1.rotate(np.pi/2) - line2=Line(color=BLACK).shift(2.5*LEFT+0.5*UP) - line2.scale(0.5) - line3=Line(color=BLACK).shift(+1.5*LEFT) - line3.scale(0.5) - a1=TextMobject(r"$a_1$",color=BLACK).scale(0.5).shift(3.4*LEFT+0.7*UP) - a2=TextMobject(r"$a_2$",color=BLACK).scale(0.5).shift(3.4*LEFT+0.3*DOWN) - a3=TextMobject(r"$a_3$",color=BLACK).scale(0.5).shift(0.7*LEFT+0.5*DOWN) - a4=TextMobject(r"$a_4$",color=BLACK).scale(0.5).shift(0.7*LEFT+0.5*UP) - big_rect1 = Rectangle().scale(3.3).shift(0.3*DOWN) - big_rect1.set_fill(color=GOLD,opacity=350) - - - big_rect2=Rectangle().scale(2.7).shift(0.5*DOWN) - big_rect2.set_fill(color=GREY,opacity=350) - vec_space=TextMobject("$Vector Space$",color=BLACK).scale(0.73).shift(4.65*RIGHT+2.6*UP) - sub=TextMobject(r"$Subspace$",color=BLACK).scale(0.73).shift(3.8*RIGHT+1.7*UP) - self.play(ShowCreation(big_rect1),ShowCreation(vec_space)) - self.play(ShowCreation(big_rect2),ShowCreation(sub)) - self.play(ShowCreation(sq),ShowCreation(line1),ShowCreation(line2),ShowCreation(line3),ShowCreation(a1),ShowCreation(a2),ShowCreation(a3),ShowCreation(a4)) - rec = Rectangle(color=BLACK).scale(0.5).shift(1*RIGHT) - rec.rotate(np.pi/2) - rec.set_fill(color=BLUE,opacity=350) - line4=Line(color=BLACK).shift(1*RIGHT).rotate(np.pi/2) - line5=Line(color=BLACK).scale(0.25).shift(0.75*RIGHT) - line6=Line(color=BLACK).scale(0.25).shift(0.5*DOWN+1.25*RIGHT) - b1=TextMobject(r"$b_1$",color=BLACK).scale(0.5).shift(0.3*RIGHT+0.5*UP) - b2=TextMobject(r"$b_2$",color=BLACK).scale(0.5).shift(0.3*RIGHT+0.5*DOWN) - b3=TextMobject(r"$b_3$",color=BLACK).scale(0.5).shift(1.67*RIGHT+0.8*DOWN) - b4=TextMobject(r"$b_4$",color=BLACK).scale(0.5).shift(1.67*RIGHT+0.5*UP) - self.play(ShowCreation(rec),ShowCreation(line4),ShowCreation(line5),ShowCreation(line6),ShowCreation(b1),ShowCreation(b2),ShowCreation(b3),ShowCreation(b4)) - self.wait(1) - text1=TextMobject(r"$a_1 + a_2 = a_3 + a_4$",color=BLACK).scale(0.5).shift(2*LEFT+1.5*DOWN) - text2=TextMobject(r"$b_1 + b_2 = b_3 + b_4$",color=BLACK).scale(0.5).shift(1.5*RIGHT+1.5*DOWN) - self.play(ShowCreation(text1),ShowCreation(text2)) - self.wait(3) - self.play(FadeOut(text1),FadeOut(text2)) - rec.shift(3*LEFT+2.01*DOWN) - line4.shift(3*LEFT+2*DOWN) - line5.shift(3*LEFT+2*DOWN) - line6.shift(3*LEFT+2*DOWN) - b1.shift(3.1*LEFT+2.1*DOWN) - b2.shift(3.1*LEFT+2.1*DOWN) - b3.shift(2.9*LEFT+2*DOWN) - b4.shift(2.9*LEFT+2.3*DOWN) - self.play(ShowCreation(rec),ShowCreation(line4),ShowCreation(line5),ShowCreation(line6),ShowCreation(b1),ShowCreation(b2),ShowCreation(b3),ShowCreation(b4)) - self.wait(2) - - text3=TextMobject(r"$(a_1 + a_2) + (b_1 + b_2) = (a_3 + a_4) + (b_3 + b_4)$",color=BLACK).scale(0.5).shift(2.5*RIGHT+0.5*DOWN) - text3=TextMobject(r"$(a_1 + a_2) + (b_1 + b_2) = (a_3 + a_4) + (b_3 + b_4)$",color=BLACK).scale(0.5).shift(2.5*RIGHT+0.5*DOWN) - text4=TextMobject("Vector Addition",color=BLACK).scale(0.8).shift(2.5*RIGHT+0.5*UP) - self.play(ShowCreation(text3),ShowCreation(text4)) - self.wait(3) - rec.set_fill(color=GREY,opacity=350) - self.play(FadeOut(text3),FadeOut(text4),FadeOut(line4),FadeOut(line5),FadeOut(line6),FadeOut(rec),FadeOut(b4),FadeOut(b3),FadeOut(b2),FadeOut(b1)) - sq1=Square(color=BLACK).scale(0.5).shift(1.5*LEFT+1.5*UP) - sq1.set_fill(color=RED,opacity=350) - sq2=Square(color=BLACK).scale(0.5).shift(1.5*LEFT+1.5*DOWN) - sq2.set_fill(color=RED,opacity=350) - rec1=Rectangle(height=0.5,width=1,color=BLACK).shift(2.5*LEFT+1.2*UP) - rec1.set_fill(color=RED,opacity=350) - rec2=Rectangle(height=1.5,width=1,color=BLACK) - rec2.set_fill(color=RED,opacity=350).shift(2.5*LEFT+1.5*DOWN) - self.play(ShowCreation(sq1),ShowCreation(sq2),ShowCreation(rec1),ShowCreation(rec2)) - a=TextMobject(r"$a_1$",color=BLACK).scale(0.5).shift(3.4*LEFT+1.2*UP) - b=TextMobject(r"$a_2$",color=BLACK).scale(0.5).shift(3.4*LEFT+1.4*DOWN) - c=TextMobject(r"$a_3$",color=BLACK).scale(0.5).shift(0.7*LEFT+1.4*DOWN) - d=TextMobject(r"$a_4$",color=BLACK).scale(0.5).shift(0.7*LEFT+1.4*UP) - self.play(ShowCreation(a),ShowCreation(b),ShowCreation(c),ShowCreation(d)) - self.wait(2.3) - text4=TextMobject("Scalar Multiplication",color=BLACK).scale(0.8).shift(2.5*RIGHT+0.5*UP) - text5=TextMobject(r"$\implies 2(a_1 + a_2) = 2(a_3 + a_4)$",color=BLACK).scale(0.5).shift(2*RIGHT+0.5*DOWN) - text6=TextMobject(r"$(a_1 + a_1) + (a_2 + a_2) = (a_3 + a_3) + (a_4 +a_4)$",color=BLACK).scale(0.5).shift(2.5*RIGHT) - self.play(ShowCreation(text4),ShowCreation(text5),ShowCreation(text6)) - self.wait(3) - - - - - -- cgit From 9451877998a75f4044459365531d6b05f776c35a Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:40:32 +0530 Subject: Add files via upload --- .../Subspaces/Intersection_of_Subspaces.py | 52 ++++++++++++++++++++++ .../Subspaces/Subspace_Non_Example.py | 25 +++++++++++ 2 files changed, 77 insertions(+) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Intersection_of_Subspaces.py create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Non_Example.py (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Intersection_of_Subspaces.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Intersection_of_Subspaces.py new file mode 100644 index 0000000..ec82daa --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Intersection_of_Subspaces.py @@ -0,0 +1,52 @@ +from manimlib.imports import * +class ThreeDSpace(ThreeDScene): + + + def construct(self): + axes = ThreeDAxes() + self.set_camera_orientation(phi = 80*DEGREES,theta =110*DEGREES) + self.begin_ambient_camera_rotation(rate=0.09) + + + + + cube = Cube(stroke_width=5,color=WHITE).shift([1.5,1.5,1.5]).scale(1.5) + cube.set_fill(TEAL) + + cube.set_opacity(0.4) + + + plane1 = Polygon([0,0,3],[3,0,3],[3,3,0],[0,3,0]) + plane1.set_opacity(0.65) + plane1.set_fill(PURPLE) + plane1.set_color(PURPLE) + + + plane2 = Polygon([0,3,3],[3,3,3],[3,0,0],[0,0,0]) + plane2.set_opacity(0.7) + plane2.set_fill(RED) + plane2.set_color(RED) + line = Line(color=YELLOW,set_opacity=100).shift([1.5,1.5,1.5]).scale(1.5) + + vgroup = VGroup(plane1,plane2,line,cube) + vgroup.shift([-1,-1,-1]) + + dot = Dot(color=BLACK).shift([0.5,0.5,0.5]).scale(1) + text = TextMobject(r"\text{The}",r"\text{line}",r"\text{representing the intersection of the two planes is a Subspace.}",opacity = 0.6).scale(0.7).shift(3*UP) + text[1].set_color(YELLOW) + self.add_fixed_in_frame_mobjects(text) + self.play(ShowCreation(text)) + + + self.play(ShowCreation(cube)) + self.play(ShowCreation(plane1)) + self.play(ShowCreation(plane2)) + + self.play(ShowCreation(line),ShowCreation(dot)) + + + self.wait(15) + + + + \ No newline at end of file diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Non_Example.py b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Non_Example.py new file mode 100644 index 0000000..115a722 --- /dev/null +++ b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/Subspace_Non_Example.py @@ -0,0 +1,25 @@ +from manimlib.imports import * +class ThreeDSpace(ThreeDScene): + + + def construct(self): + axes = ThreeDAxes() + self.add(axes) + self.set_camera_orientation(phi = 80*DEGREES,theta =110*DEGREES) + self.begin_ambient_camera_rotation(rate=0.09) + plane1 = Polygon([-1.5,1.5,-1.5],[1.5,1.5,-1.5],[1.5,-1.5,1.5],[-1.5,-1.5,1.5]) + plane1.set_opacity(0.65) + plane1.set_fill(GREEN) + plane1.set_color(GREEN) + + + plane2 = Polygon([-1.5,1.5,1.5],[1.5,1.5,1.5],[1.5,-1.5,-1.5],[-1.5,-1.5,-1.5]) + plane2.set_opacity(0.7) + plane2.set_fill(MAROON_A) + plane2.set_color(MAROON_A) + line = Line(color=YELLOW,set_opacity=100,start=[1.5,1.2,1.2],end=[-1.5,1.2,1.2]) + + + self.play(ShowCreation(plane1),ShowCreation(plane2),ShowCreation(line)) + self.wait(10) + -- cgit From f424f33f1885a9e8a5d909e454a90287f0490697 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:41:24 +0530 Subject: Delete Subspace_Example.mp4 --- .../Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 | Bin 608079 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 deleted file mode 100644 index 46e1f3b..0000000 Binary files a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.mp4 and /dev/null differ -- cgit From fcd089b5665ab38cb60a6d4ffc3970985a01e6bf Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:41:40 +0530 Subject: Delete Linear_Subspace.gif --- .../Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif | Bin 4458192 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif deleted file mode 100644 index bec7e5f..0000000 Binary files a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Linear_Subspace.gif and /dev/null differ -- cgit From 0ceeedf13e05696108640c764bd9d33608fce3c0 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:41:55 +0530 Subject: Delete Subspace_Example.gif --- .../Vector-Spaces/Subspaces/gifs/Subspace_Example.gif | Bin 716776 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif deleted file mode 100644 index ffe71a8..0000000 Binary files a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Example.gif and /dev/null differ -- cgit From ca44f005584b966faaadda1a46f7d4cd7d7180cd Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:44:53 +0530 Subject: Add files via upload --- .../Subspaces/gifs/Intersection_of_Subspaces.mp4 | Bin 0 -> 1112086 bytes .../Subspaces/gifs/Subspace_Non_Example.mp4 | Bin 0 -> 818876 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Intersection_of_Subspaces.mp4 create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Non_Example.mp4 (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Intersection_of_Subspaces.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Intersection_of_Subspaces.mp4 new file mode 100644 index 0000000..d43bfbe Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Intersection_of_Subspaces.mp4 differ diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Non_Example.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Non_Example.mp4 new file mode 100644 index 0000000..390f4cf Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Subspaces/gifs/Subspace_Non_Example.mp4 differ -- cgit From 46adc3cf03a9198bcd26cbff4344ccca8c7c6c0d Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:46:12 +0530 Subject: Delete Inner_Product_Space_Example.mp4 --- .../gifs2/Inner_Product_Space_Example.mp4 | Bin 3450822 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 deleted file mode 100644 index dee494f..0000000 Binary files a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 and /dev/null differ -- cgit From eadaf1b3e4245b4b5f3b932334400c0f3a0dcd22 Mon Sep 17 00:00:00 2001 From: simranchhattani Date: Sat, 11 Jul 2020 23:48:16 +0530 Subject: Add files via upload --- .../gifs2/Inner_Product_Space_Example.mp4 | Bin 0 -> 3881235 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 (limited to 'FSF-2020/linear-algebra/vector-spaces') diff --git a/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 new file mode 100644 index 0000000..edecd88 Binary files /dev/null and b/FSF-2020/linear-algebra/vector-spaces/Vector-Spaces/Inner-Product_Spaces/gifs2/Inner_Product_Space_Example.mp4 differ -- cgit