summaryrefslogtreecommitdiff
path: root/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces
diff options
context:
space:
mode:
authorPurusharth Saxena2020-07-05 16:34:34 +0530
committerGitHub2020-07-05 16:34:34 +0530
commit6540bd6042448d196bc0c80cc531182e7e3d9fd5 (patch)
tree95ce13b0f2154c80e5eb7151eb2693683c3d8a9c /FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces
parentdec73d83e46d8fab1f43e87d5602eac0f8241431 (diff)
parent747f68c91279c9915382f0013ddc80fa67bd6d09 (diff)
downloadFSF-mathematics-python-code-archive-6540bd6042448d196bc0c80cc531182e7e3d9fd5.tar.gz
FSF-mathematics-python-code-archive-6540bd6042448d196bc0c80cc531182e7e3d9fd5.tar.bz2
FSF-mathematics-python-code-archive-6540bd6042448d196bc0c80cc531182e7e3d9fd5.zip
Merge pull request #49 from architsangal/master
Code for Orthonormal basis added
Diffstat (limited to 'FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces')
-rwxr-xr-xFSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Axb.py77
-rw-r--r--FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/solution.py75
2 files changed, 152 insertions, 0 deletions
diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Axb.py b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Axb.py
new file mode 100755
index 0000000..95d1021
--- /dev/null
+++ b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/Axb.py
@@ -0,0 +1,77 @@
+from manimlib.imports import *
+
+class Axb(Scene):
+
+ def construct(self):
+
+ text0 = TextMobject("Linear System Of Equations")
+ text1 = TextMobject(r"$x_{1}+x_{2}+x_{3} =b_{1}$")
+ text2 = TextMobject(r"$x_{1}+2x_{2}+x_{3} =b_{2}$")
+ text3 = TextMobject(r"$x_{1}+x_{2}+3x_{3} =b_{3}$")
+ text0.move_to(UP*2+LEFT*2)
+ text0.set_color(DARK_BLUE)
+ text1.move_to(UP)
+ text2.move_to(ORIGIN)
+ text3.move_to(DOWN)
+
+ text0.scale(0.75)
+ text1.scale(0.75)
+ text2.scale(0.75)
+ text3.scale(0.75)
+ self.play(Write(text0))
+ self.play(Write(text1))
+ self.play(Write(text2))
+ self.play(Write(text3))
+ self.play(ApplyMethod(text0.move_to,3*UP+LEFT*2), ApplyMethod(text1.move_to,2.5*UP), ApplyMethod(text2.move_to,2*UP), ApplyMethod(text3.move_to,1.5*UP))
+
+ A = TextMobject(r"$\left( \begin{array}{c c c} 1 & 1 & 1 \\ 1 & 2 & 1 \\ 1 & 1 & 3 \end{array}\right) \left[ \begin{array} {c} x_{1} \\ x_{2} \\ x_{3} \end{array}\right] =$", r"$\left[ \begin{array}{c} x_{1}+x_{2}+x_{3} \\ x_{1}+2x_{2}+x_{3} \\ x_{1}+x_{2}+3x_{3} \end{array}\right]$")
+ A.scale(0.75)
+ self.play(FadeIn(A))
+
+ textA = TextMobject("A")
+ textx = TextMobject("x")
+ textb = TextMobject("Ax")
+
+ textA.move_to(DOWN+3*LEFT)
+ textx.move_to(1.1*DOWN+0.5*LEFT)
+ textb.move_to(DOWN-2*LEFT)
+
+ self.play(Write(textA), Write(textx), Write(textb))
+
+ circle1 = Circle(radius = 0.24)
+ circle2 = Circle(radius = 0.24)
+ square = Square(side_length = 0.6)
+
+ circle1.move_to(UP*0.5+LEFT*3.05)
+ circle2.move_to(UP*0.4+LEFT*0.5)
+ square.move_to(UP*0.4+RIGHT*1.3)
+
+ self.play(FadeIn(circle1), FadeIn(circle2),FadeIn(square))
+
+ self.play(ApplyMethod(circle1.move_to,UP*0.5+LEFT*2.45), ApplyMethod(circle2.move_to,LEFT*0.5), ApplyMethod(square.move_to,UP*0.4+RIGHT*2.2))
+ self.play(ApplyMethod(circle1.move_to,UP*0.5+LEFT*1.85), ApplyMethod(circle2.move_to,DOWN*0.5+LEFT*0.5), ApplyMethod(square.move_to,UP*0.4+RIGHT*3.1))
+
+ self.play(ApplyMethod(circle1.move_to,LEFT*3.05), ApplyMethod(circle2.move_to,UP*0.4+LEFT*0.5), ApplyMethod(square.move_to,RIGHT*1.3))
+ self.play(ApplyMethod(circle1.move_to,LEFT*2.45), ApplyMethod(circle2.move_to,LEFT*0.5), ApplyMethod(square.move_to,RIGHT*2.2))
+ self.play(ApplyMethod(circle1.move_to,LEFT*1.85), ApplyMethod(circle2.move_to,DOWN*0.5+LEFT*0.5), ApplyMethod(square.move_to,RIGHT*3.1))
+
+ self.play(ApplyMethod(circle1.move_to,0.4*DOWN+LEFT*3.05), ApplyMethod(circle2.move_to,UP*0.4+LEFT*0.5), ApplyMethod(square.move_to,0.4*DOWN+RIGHT*1.3))
+ self.play(ApplyMethod(circle1.move_to,0.4*DOWN+LEFT*2.45), ApplyMethod(circle2.move_to,LEFT*0.5), ApplyMethod(square.move_to,0.4*DOWN+RIGHT*2.2))
+ self.play(ApplyMethod(circle1.move_to,0.4*DOWN+LEFT*1.85), ApplyMethod(circle2.move_to,DOWN*0.5+LEFT*0.5), ApplyMethod(square.move_to,0.4*DOWN+RIGHT*3.1))
+
+ self.play(FadeOut(circle1), FadeOut(circle2), FadeOut(square))
+ self.play(FadeOut(A[0]), ApplyMethod(A[1].move_to,2*LEFT),ApplyMethod(textb.move_to,DOWN+1.7*LEFT), FadeOut(textx), FadeOut(textA))
+ b = TextMobject(r"$=\left[ \begin{array}{c} b_{1} \\ b_{2} \\ b_{3} \end{array}\right]$")
+ b.move_to(RIGHT)
+ textB = TextMobject("b")
+ textB.move_to(1.2*DOWN+1.1*RIGHT)
+ self.play(FadeIn(b),FadeIn(textB))
+
+ self.wait()
+
+ self.play(FadeOut(text0), FadeOut(text1), FadeOut(text2), FadeOut(text3))
+
+ axb = TextMobject("Ax = b")
+ self.play(FadeIn(axb), FadeOut(textb), FadeOut(textB), FadeOut(b), FadeOut(A[1]))
+
+ self.wait() \ No newline at end of file
diff --git a/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/solution.py b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/solution.py
new file mode 100644
index 0000000..fb31881
--- /dev/null
+++ b/FSF-2020/linear-algebra/linear-transformations/The-Four-Fundamental-Subspaces/solution.py
@@ -0,0 +1,75 @@
+from manimlib.imports import *
+class solution(LinearTransformationScene):
+ def construct(self):
+
+ self.setup()
+ self.wait()
+
+ o = TextMobject(r"This is the original $2D$ vector space(before Linear Transformation)")
+ o.move_to(DOWN)
+ o.scale(0.75)
+ o.add_background_rectangle()
+ self.play(Write(o))
+ self.wait()
+ self.play(FadeOut(o))
+
+ A = TextMobject("Let $A$ denote the matrix the of this linear transformation.")
+ A.move_to(DOWN)
+ A.scale(0.75)
+ A.add_background_rectangle()
+ self.play(Write(A))
+ matrix = [[1,-1],[1,-1]]
+ self.apply_matrix(matrix)
+ self.wait()
+ self.play(FadeOut(A))
+
+ o = TextMobject(r"This is the transformed vector space i.e. a line ($1D$)")
+ o.move_to(DOWN)
+ o.scale(0.75)
+ o.add_background_rectangle()
+ self.play(Write(o))
+ self.wait()
+ self.play(FadeOut(o))
+
+ arrow2 = Arrow(start = ORIGIN, end = 2*DOWN+2*LEFT)
+ arrow2.set_color(DARK_BLUE)
+ arrow2.scale(1.2)
+ self.play(ShowCreation(arrow2))
+ self.wait()
+
+ o1 = TextMobject("If the vector lies in the transformed vector space")
+ o2 = TextMobject("(the line) then the solution exist")
+ o1.move_to(2*DOWN+2*RIGHT)
+ o2.move_to(2.5*DOWN+2*RIGHT)
+ o1.scale(0.75)
+ o2.scale(0.75)
+ o1.add_background_rectangle()
+ o2.add_background_rectangle()
+ self.play(Write(o1))
+ self.play(Write(o2))
+ self.wait()
+ self.play(FadeOut(o1), FadeOut(o2))
+
+ self.play(FadeOut(arrow2))
+
+ arrow1 = Arrow(start = ORIGIN, end = 2*UP+RIGHT)
+ arrow1.set_color(DARK_BLUE)
+ arrow1.scale(1.3)
+ self.play(ShowCreation(arrow1))
+ self.wait()
+
+ o1 = TextMobject("If the vector does lies in the transformed")
+ o2 = TextMobject("vector space then the does not solution exist")
+ o1.move_to(2*DOWN+2*RIGHT)
+ o2.move_to(2.5*DOWN+2*RIGHT)
+ o1.scale(0.75)
+ o2.scale(0.75)
+ o1.add_background_rectangle()
+ o2.add_background_rectangle()
+ self.play(Write(o1))
+ self.play(Write(o2))
+ self.wait()
+ self.play(FadeOut(o1), FadeOut(o2))
+
+ self.play(FadeOut(arrow1))
+ \ No newline at end of file