summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_respresentation.py
diff options
context:
space:
mode:
Diffstat (limited to 'FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_respresentation.py')
-rw-r--r--FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_respresentation.py82
1 files changed, 66 insertions, 16 deletions
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_respresentation.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_respresentation.py
index d10ff0a..e413e02 100644
--- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_respresentation.py
+++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file2_multivariable_func_respresentation.py
@@ -12,9 +12,6 @@ class MultivariableFunc(Scene):
self.play(FadeOut(topic))
- #circle = Circle()
- #circle.scale(3)
-
scalar_function = TextMobject("Scalar Valued Function")
scalar_function.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
scalar_function.scale(1.5)
@@ -69,16 +66,10 @@ class MultivariableFunc(Scene):
number2.set_color(ORANGE)
output2 = TextMobject(r"$ \begin{bmatrix} 4 \\ 6 \end{bmatrix}$")
- #output2.scale(1.5)
output2.set_color(BLUE_C)
output2.move_to(3*RIGHT)
- #eqn2_1 = TextMobject(r"f(2,1,3) = $2^2(1) + 2(1)(3)$")
- #eqn2_1.set_color(YELLOW)
-
- #eqn2_2 = TextMobject(r"f(2,1,3) = $2 + 6$")
- #eqn2_2.set_color(YELLOW)
-
+
self.play(Write(eqn2))
@@ -86,13 +77,72 @@ class MultivariableFunc(Scene):
self.play(ApplyMethod(number2.move_to, 3*LEFT))
self.play(FadeOut(number2))
- #self.play(Transform(eqn2, eqn2_1))
- #self.wait(1)
- #self.play(Transform(eqn2, eqn2_2))
- #self.wait(1)
-
self.play(ApplyMethod(output2.move_to, 2.5*DOWN+4*RIGHT))
self.wait()
self.play(Write(vector_function))
self.play(FadeOut(output2),FadeOut(eqn2), FadeOut(vector_function), FadeOut(rectangle))
- self.wait() \ No newline at end of file
+ self.wait()
+
+
+
+class VectorValuedFunc(Scene):
+ def construct(self):
+ numberplane = NumberPlane()
+
+ rectangle = Rectangle(height = 1, width = 2, color = PURPLE).move_to(2.5*UP+5*RIGHT)
+
+ eqn = TextMobject(r"f(x,y) = $ \begin{bmatrix} xy \\ \frac{y}{x} \end{bmatrix}$").scale(0.6).move_to(2.5*UP+5*RIGHT).set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+
+ dot1 = Dot().set_color(PINK).move_to(np.array([2,2,0]))
+
+ number1 = TextMobject("(2,2)").scale(0.6).next_to(dot1, RIGHT).set_color(PINK)
+
+ output1 = TextMobject(r"$ \begin{bmatrix} 4 \\ 1 \end{bmatrix}$").scale(0.6).set_color(YELLOW_C).move_to(2.5*UP+6.5*RIGHT)
+
+ vector1 = Arrow(np.array([2,2,0]), np.array([4,1,0]), color = RED_C, buff = 0.01, tip_length = 0.25)
+
+ dot2 = Dot().set_color(PINK).move_to(np.array([-1,2,0]))
+
+ number2 = TextMobject("(-1,2)").scale(0.6).next_to(dot2, RIGHT).set_color(PINK)
+
+ output2 = TextMobject(r"$ \begin{bmatrix} -2 \\ -2 \end{bmatrix}$").scale(0.6).set_color(YELLOW_C).move_to(2.5*UP+6.5*RIGHT)
+
+ vector2 = Arrow(np.array([-1,2,0]), np.array([-2,-2,0]), color = RED_C, buff = 0.01, tip_length = 0.25)
+
+
+ vector_valued_function = TextMobject("Vector Valued Function").move_to(2.5*UP+3*LEFT).set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+
+
+ self.play(ShowCreation(numberplane))
+ self.wait()
+ self.play(ShowCreation(rectangle), ShowCreation(eqn))
+ self.wait()
+ self.play(ShowCreation(dot1), ShowCreation(number1))
+ self.wait(0.5)
+ self.play(ApplyMethod(number1.move_to, 2.5*UP+ 3.5*RIGHT))
+ self.wait(0.5)
+ self.play(FadeOut(number1))
+ self.wait(0.5)
+ self.play(ShowCreation(output1))
+ self.wait(0.5)
+ self.play(ShowCreation(vector1))
+ self.wait(0.5)
+ self.play(ApplyMethod(output1.move_to, 1*UP+ 4.5*RIGHT))
+ self.wait()
+
+
+ self.play(ShowCreation(dot2), ShowCreation(number2))
+ self.wait(0.5)
+ self.play(ApplyMethod(number2.move_to, 2.5*UP+ 3.5*RIGHT))
+ self.wait(0.5)
+ self.play(FadeOut(number2))
+ self.wait(0.5)
+ self.play(ShowCreation(output2))
+ self.wait(0.5)
+ self.play(ShowCreation(vector2))
+ self.wait(0.5)
+ self.play(ApplyMethod(output2.move_to, 2*DOWN+ 2.5*LEFT))
+ self.wait()
+ self.play(Write(vector_valued_function))
+ self.wait(2)
+