summaryrefslogtreecommitdiff
path: root/FSF-2020/linear-algebra
diff options
context:
space:
mode:
authorArchit Sangal2020-07-16 17:10:30 +0530
committerArchit Sangal2020-07-16 17:10:30 +0530
commit3fd2d95a0e3c5f15cb3c9103f715a7f51055db28 (patch)
treefb7d56e65f8b5af353e847a2ed4c040f8f165148 /FSF-2020/linear-algebra
parent14540874f312685e9c739a070894a13912ada507 (diff)
downloadFSF-mathematics-python-code-archive-3fd2d95a0e3c5f15cb3c9103f715a7f51055db28.tar.gz
FSF-mathematics-python-code-archive-3fd2d95a0e3c5f15cb3c9103f715a7f51055db28.tar.bz2
FSF-mathematics-python-code-archive-3fd2d95a0e3c5f15cb3c9103f715a7f51055db28.zip
Archit Sangal
Diffstat (limited to 'FSF-2020/linear-algebra')
-rw-r--r--FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_transformations.py29
-rwxr-xr-xFSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_before_matrix.py15
2 files changed, 36 insertions, 8 deletions
diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_transformations.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_transformations.py
index 97dbcde..cdcab07 100644
--- a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_transformations.py
+++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file1_transformations.py
@@ -6,12 +6,16 @@ class text(Scene):
text1.scale(0.9)
text2 = TextMobject("must either remain straight lines or sends to a point in the grid formed")
text2.scale(0.9)
+ text3 = TextMobject("Origin must remains where it was before transformation.")
+ text3.scale(0.9)
text1.move_to(ORIGIN+UP)
text2.move_to(ORIGIN)
+ text3.move_to(ORIGIN+DOWN)
self.play(Write(text1))
self.play(Write(text2))
+ self.play(Write(text3))
self.wait()
- self.play(FadeOut(text1),FadeOut(text2))
+ self.play(FadeOut(text1),FadeOut(text2),FadeOut(text3))
class LinearTransformation(LinearTransformationScene):
CONFIG = {
@@ -44,3 +48,26 @@ class NonLinearTransformation(Scene):
text.add_background_rectangle()
self.play(Write(text))
self.wait()
+
+class MoveOrigin(LinearTransformationScene):
+
+ CONFIG = {
+ "show_basis_vectors": False,
+ }
+ def construct(self):
+ self.wait()
+
+ dot = Dot(ORIGIN, color = YELLOW)
+ self.add_transformable_mobject(dot)
+ self.apply_nonlinear_transformation(self.func)
+ text = TextMobject("This is also not a linear transformation as the origin moves from its original position")
+ text.move_to(2*DOWN)
+ text.scale(0.5)
+ text.set_color(YELLOW)
+ text.add_background_rectangle()
+ self.play(Write(text))
+ self.wait()
+
+ def func(self, point):
+ matrix_transform = self.get_matrix_transformation([[1, -1], [1, 1]])
+ return matrix_transform(point) + UP+ RIGHT
diff --git a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_before_matrix.py b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_before_matrix.py
index 96e456d..1f6badd 100755
--- a/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_before_matrix.py
+++ b/FSF-2020/linear-algebra/linear-transformations/Linear-Transformations-(Linear-Maps)/file2_before_matrix.py
@@ -69,7 +69,7 @@ class Linear(GraphScene):
class withgrid(LinearTransformationScene):
def construct(self):
- heading = TextMobject(r"Now, Imagine this happening for all the vectors")
+ heading = TextMobject(r"Now, imagine this happening for all the points")
heading.scale(0.5)
heading.move_to(UP*2.5+LEFT*4)
self.play(Write(heading))
@@ -141,6 +141,7 @@ class ThreeDExplanation(ThreeDScene):
text = TextMobject(r"$T(x,y) = (x+y,x-y,x+2y)$")
text.scale(0.75)
text.move_to(UP*2.5+LEFT*4)
+ text.move_to(-UP*3+LEFT*4)
self.add_fixed_in_frame_mobjects(text)
self.play(Write(text))
self.wait()
@@ -218,15 +219,15 @@ class ThreeDExplanation(ThreeDScene):
self.wait(3)
self.stop_ambient_camera_rotation()
- ending = TextMobject(r"$T(\left[\begin{array}{c}x \\ y\end{array}\right]) = \left[\begin{array}{c} x+y \\ x-y \\ x+2y \end{array}\right]$")
+ ending = TextMobject(r"$T(\left[\begin{array}{c}x \\ y\end{array}\right])$ = ",r"$\left[\begin{array}{c} x+y \\ x-y\\ x+2y \end{array}\right]$") #\begin{array}{c} x+y \\ x-y -- \\ x+2y -- \end{array}\right]$")
ending.scale(0.75)
- ending.move_to(-UP*2+LEFT*4)
- self.play(Transform(text,ending))
+ ending.move_to(-UP*3+LEFT*4)
self.add_fixed_in_frame_mobjects(ending)
+ self.play(FadeOut(text),Write(ending))
self.play(FadeOut(plane))
- self.wait(3)
+ self.wait(2)
- self.begin_ambient_camera_rotation(rate=0.5)
- self.wait(5)
+ self.begin_ambient_camera_rotation(rate=0.3)
+ self.wait(8)
self.stop_ambient_camera_rotation()