diff options
Diffstat (limited to 'FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions')
11 files changed, 215 insertions, 186 deletions
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/Multivariable_Functions_Quiz.pdf b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/Multivariable_Functions_Quiz.pdf Binary files differindex 7895843..1155206 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/Multivariable_Functions_Quiz.pdf +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/Multivariable_Functions_Quiz.pdf diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivar_func_examples.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivar_func_examples.py index 55b2b7e..c15cdfb 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivar_func_examples.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file1_multivar_func_examples.py @@ -17,45 +17,35 @@ class Examples1(GraphScene): rectangle_area[2].set_color(YELLOW_C)
rectangle_area[4].set_color(BLUE_C)
+
+ triangle = Polygon(np.array([-3,-1.5,0]), np.array([2,-1.5,0]), np.array([2,1.5,0]), np.array([-3,-1.5,0]), color = PURPLE)
- square = Square(side_length = 5, color = PURPLE)
- square_area_func = TexMobject("Area", "=", "f(", "Length", ")")
- square_area_func[0].set_color(GREEN_C)
- square_area_func[2].set_color(ORANGE)
- square_area_func[3].set_color(BLUE_C)
- square_area_func[4].set_color(ORANGE)
-
- square_area = TexMobject("Area", "=", "Length^2")
- square_area[0].set_color(GREEN_C)
- square_area[2].set_color(BLUE_C)
-
+ triangle_area_func = TexMobject("Area", "=", "f(", "Base", ",", "Height", ")").scale(0.6).move_to(1*DOWN)
+ triangle_area_func[0].set_color(RED_C)
+ triangle_area_func[2].set_color(ORANGE)
+ triangle_area_func[3].set_color(YELLOW_C)
+ triangle_area_func[5].set_color(BLUE_C)
+ triangle_area_func[6].set_color(ORANGE)
- circle = Circle(radius = 2, color = PINK)
- circle_area_func = TexMobject("Area", "=", "f(", "r", ")")
- circle_area_func[0].set_color(YELLOW_C)
- circle_area_func[2].set_color(ORANGE)
- circle_area_func[3].set_color(GREEN_C)
- circle_area_func[4].set_color(ORANGE)
+ triangle_area = TexMobject("Area", "=", "\\frac{1}{2}", "\\times", "Base", "\\times", "Height").scale(0.6).move_to(1*DOWN)
+ triangle_area[0].set_color(RED_C)
+ triangle_area[2].set_color(GREEN_C)
+ triangle_area[4].set_color(YELLOW_C)
+ triangle_area[6].set_color(BLUE_C)
- circle_area = TexMobject("Area", "=", "\\pi", "r^2")
- circle_area[0].set_color(YELLOW_C)
- circle_area[2].set_color(BLUE_C)
- circle_area[3].set_color(GREEN_C)
-
- radius = Line(ORIGIN,2*RIGHT, color = RED_C)
-
braces_rect1 = Brace(rectangle, LEFT)
eq_text1 = braces_rect1.get_text("Length").set_color(YELLOW_C)
braces_rect2 = Brace(rectangle, UP)
eq_text2 = braces_rect2.get_text("Breadth").set_color(BLUE_C)
-
- braces_square = Brace(square, LEFT)
- braces_square_text = braces_square.get_text("Length").set_color(BLUE_C)
-
- radius_text = TexMobject("r", color = GREEN_C).next_to(radius,UP)
+
+ braces_triangle_height = Brace(triangle, RIGHT)
+ braces_triangle_height_text = braces_triangle_height.get_text("Height").set_color(BLUE_C)
+
+ braces_triangle_base = Brace(triangle, DOWN)
+ braces_triangle_base_text = braces_triangle_base.get_text("Base").set_color(YELLOW_C)
self.play(ShowCreation(rectangle))
@@ -69,28 +59,19 @@ class Examples1(GraphScene): self.play(FadeOut(braces_rect1),FadeOut(eq_text1),FadeOut(braces_rect2),FadeOut(eq_text2),FadeOut(rectangle_area_func))
- self.play(Transform(rectangle, square))
- self.wait(1)
- self.play(GrowFromCenter(braces_square),Write(braces_square_text))
+ self.play(Transform(rectangle, triangle))
self.wait(1)
- self.play(Write(square_area_func))
+ self.play(GrowFromCenter(braces_triangle_height),Write(braces_triangle_height_text))
self.wait(1)
- self.play(Transform(square_area_func, square_area))
+ self.play(GrowFromCenter(braces_triangle_base),Write(braces_triangle_base_text))
self.wait(1)
- self.play(FadeOut(braces_square),FadeOut(braces_square_text),FadeOut(square_area_func))
-
-
- self.play(Transform(rectangle, circle))
+ self.play(Write(triangle_area_func))
self.wait(1)
- self.play(ShowCreation(radius),Write(radius_text))
+ self.play(Transform(triangle_area_func, triangle_area))
self.wait(1)
- self.play(FadeOut(radius_text),FadeOut(radius))
+ self.play(FadeOut(braces_triangle_height),FadeOut(braces_triangle_height_text),FadeOut(braces_triangle_base),FadeOut(braces_triangle_base_text),FadeOut(triangle_area_func))
self.wait(1)
- self.play(Write(circle_area_func))
- self.wait(1)
- self.play(Transform(circle_area_func, circle_area))
- self.wait(1)
- self.play(FadeOut(circle_area_func))
+
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)
+
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_sphere.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_sphere.py index 86239ae..fcbc410 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_sphere.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file3_sphere.py @@ -4,28 +4,24 @@ class Sphere(ThreeDScene): def construct(self):
axes = ThreeDAxes() # creates a 3D Axis
- text3d = TextMobject(r"$f(x,y) \rightarrow Point(x,y,z)$")
- text3d1 = TextMobject(r"$f(x,y) \rightarrow Point(x,y, \sqrt{r^2 - x^2 - y^2})$")
- self.add_fixed_in_frame_mobjects(text3d)
- text3d.scale(0.7)
+ text3d1 = TextMobject(r"$z = f(x,y) = \sqrt{r^2 - x^2 - y^2}$")
+
text3d1.scale(0.7)
- text3d.to_corner(UL)
+
text3d1.to_corner(UL)
- text3d.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+
text3d1.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
- self.play(Write(text3d))
+ self.play(Write(text3d1))
self.wait(1)
- self.play(Transform(text3d,text3d1))
self.add_fixed_in_frame_mobjects(text3d1)
- self.play(FadeOut(text3d))
sphere = ParametricSurface(
lambda u, v: np.array([
2*np.sin(u)*np.cos(v),
2*np.sin(u)*np.sin(v),
2*np.cos(u)
- ]),u_min=0,u_max=PI,v_min=0,v_max=2*PI,checkerboard_colors=[RED_D, RED_E],
+ ]),u_min=0,u_max=PI/2,v_min=0,v_max=2*PI,checkerboard_colors=[RED_D, RED_E],
resolution=(15, 32)).scale(1)
@@ -53,8 +49,8 @@ class Sphere(ThreeDScene): dot_x_y1 = Dot().scale(0.75).set_fill(RED_C).move_to(np.array([-1,1,0]))
dot_x_y_z1 = Dot().scale(0.75).set_fill(RED_C).move_to(np.array([-1,1,1.414]))
- dot_x_y_z_1 = Dot().scale(0.75).set_fill(RED_C).move_to(np.array([-1,1,-1.414]))
- line1 = DashedLine(np.array([-1,1,-1.414]), np.array([-1,1,1.414]), color = YELLOW_C)
+
+ line1 = DashedLine(np.array([-1,1,0]), np.array([-1,1,1.414]), color = YELLOW_C)
point_x_y1 = TexMobject("(-1,1,0)").set_color(BLUE_C).move_to(np.array([-1.5,1.5,0])).scale(0.5)
point_x_y_z1 = TexMobject("(-1,1,\\sqrt{r^2 - x^2 - y^2})").set_color(BLUE_C).move_to(np.array([-1.5,1.5,1.414])).scale(0.5)
@@ -62,38 +58,32 @@ class Sphere(ThreeDScene): point_x_y_z1_3 = TexMobject("(-1,1,\\sqrt{4 - 1 - 1})").set_color(BLUE_C).move_to(np.array([-1.5,1.5,1.414])).scale(0.5)
point_x_y_z1_4 = TexMobject("(-1,1,\\sqrt{2})").set_color(BLUE_C).move_to(np.array([-1.5,1.5,1.414])).scale(0.5)
point_x_y_z1_5 = TexMobject("(-1,1,1.414)").set_color(BLUE_C).move_to(np.array([-1.5,1.5,1.414])).scale(0.5)
-
- point_x_y_z_1 = TexMobject("(-1,1,\\sqrt{r^2 - x^2 - y^2})").set_color(BLUE_C).move_to(np.array([-1.5,1.5,-1.414])).scale(0.5)
- point_x_y_z_1_2 = TexMobject("(-1,1,\\sqrt{4 - x^2 - y^2})").set_color(BLUE_C).move_to(np.array([-1.5,1.5,-1.414])).scale(0.5)
- point_x_y_z_1_3 = TexMobject("(-1,1,\\sqrt{4 - 1 - 1})").set_color(BLUE_C).move_to(np.array([-1.5,1.5,-1.414])).scale(0.5)
- point_x_y_z_1_4 = TexMobject("(-1,1,\\sqrt{2})").set_color(BLUE_C).move_to(np.array([-1.5,1.5,-1.414])).scale(0.5)
- point_x_y_z_1_5 = TexMobject("(-1,1,-1.414)").set_color(BLUE_C).move_to(np.array([-1.5,1.5,-1.414])).scale(0.5)
-
+
self.play(ShowCreation(dot_x_y1))
self.add_fixed_orientation_mobjects(point_x_y1)
- self.play(ShowCreation(dot_x_y_z1), ShowCreation(dot_x_y_z_1), ShowCreation(line1))
- self.add_fixed_orientation_mobjects(point_x_y_z1, point_x_y_z_1)
+ self.play(ShowCreation(dot_x_y_z1), ShowCreation(line1))
+ self.add_fixed_orientation_mobjects(point_x_y_z1)
self.wait(0.5)
- self.play(ReplacementTransform(point_x_y_z1,point_x_y_z1_2), ReplacementTransform(point_x_y_z_1,point_x_y_z_1_2))
- self.add_fixed_orientation_mobjects(point_x_y_z1_2, point_x_y_z_1_2)
+ self.play(ReplacementTransform(point_x_y_z1,point_x_y_z1_2))
+ self.add_fixed_orientation_mobjects(point_x_y_z1_2)
self.wait(0.5)
- self.play(ReplacementTransform(point_x_y_z1_2,point_x_y_z1_3), ReplacementTransform(point_x_y_z_1_2,point_x_y_z_1_3))
- self.add_fixed_orientation_mobjects(point_x_y_z1_3, point_x_y_z_1_3)
+ self.play(ReplacementTransform(point_x_y_z1_2,point_x_y_z1_3))
+ self.add_fixed_orientation_mobjects(point_x_y_z1_3)
self.wait(0.5)
- self.play(ReplacementTransform(point_x_y_z1_3,point_x_y_z1_4), ReplacementTransform(point_x_y_z_1_3,point_x_y_z_1_4))
- self.add_fixed_orientation_mobjects(point_x_y_z1_4, point_x_y_z_1_4)
+ self.play(ReplacementTransform(point_x_y_z1_3,point_x_y_z1_4))
+ self.add_fixed_orientation_mobjects(point_x_y_z1_4)
self.wait(0.5)
- self.play(ReplacementTransform(point_x_y_z1_4,point_x_y_z1_5), ReplacementTransform(point_x_y_z_1_4,point_x_y_z_1_5))
- self.add_fixed_orientation_mobjects(point_x_y_z1_5, point_x_y_z_1_5)
+ self.play(ReplacementTransform(point_x_y_z1_4,point_x_y_z1_5))
+ self.add_fixed_orientation_mobjects(point_x_y_z1_5)
dot_x_y2 = Dot().scale(0.75).set_fill(RED_C).move_to(np.array([0.5,-0.5,0]))
dot_x_y_z2 = Dot().scale(0.75).set_fill(RED_C).move_to(np.array([0.5,-0.5,1.87]))
- dot_x_y_z_2 = Dot().scale(0.75).set_fill(RED_C).move_to(np.array([0.5,-0.5,-1.87]))
- line2 = DashedLine(np.array([0.5,-0.5,-1.87]), np.array([0.5,-0.5,1.87]), color = YELLOW_C)
+
+ line2 = DashedLine(np.array([0.5,-0.5,0]), np.array([0.5,-0.5,1.87]), color = YELLOW_C)
point_x_y2 = TexMobject("(0.5,-0.5,0)").set_color(BLUE_C).move_to(np.array([1.5,-1.5,0])).scale(0.5)
point_x_y_z2 = TexMobject("(0.5,-0.5,\\sqrt{r^2 - x^2 - y^2})").set_color(BLUE_C).move_to(np.array([1.5,-1.5,1.87])).scale(0.5)
@@ -101,41 +91,35 @@ class Sphere(ThreeDScene): point_x_y_z2_3 = TexMobject("(0.5,-0.5,\\sqrt{4 - 0.25 - 0.25})").set_color(BLUE_C).move_to(np.array([1.5,-1.5,1.87])).scale(0.5)
point_x_y_z2_4 = TexMobject("(0.5,-0.5,\\sqrt{3.5})").set_color(BLUE_C).move_to(np.array([1.5,-1.5,1.87])).scale(0.5)
point_x_y_z2_5 = TexMobject("(0.5,-0.5,1.87)").set_color(BLUE_C).move_to(np.array([1.5,-1.5,1.87])).scale(0.5)
-
- point_x_y_z_2 = TexMobject("(0.5,-0.5,\\sqrt{r^2 - x^2 - y^2})").set_color(BLUE_C).move_to(np.array([1.5,-1.5,-1.87])).scale(0.5)
- point_x_y_z_2_2 = TexMobject("(0.5,-0.5,\\sqrt{4 - x^2 - y^2})").set_color(BLUE_C).move_to(np.array([1.5,-1.5,-1.87])).scale(0.5)
- point_x_y_z_2_3 = TexMobject("(0.5,-0.5,\\sqrt{4 - 0.25 - 0.25})").set_color(BLUE_C).move_to(np.array([1.5,-1.5,-1.87])).scale(0.5)
- point_x_y_z_2_4 = TexMobject("(0.5,-0.5,\\sqrt{3.5})").set_color(BLUE_C).move_to(np.array([1.5,-1.5,-1.87])).scale(0.5)
- point_x_y_z_2_5 = TexMobject("(0.5,-0.5,-1.87)").set_color(BLUE_C).move_to(np.array([1.5,-1.5,-1.87])).scale(0.5)
-
+
self.play(ShowCreation(dot_x_y2))
self.add_fixed_orientation_mobjects(point_x_y2)
- self.play(ShowCreation(dot_x_y_z2), ShowCreation(dot_x_y_z_2), ShowCreation(line2))
- self.add_fixed_orientation_mobjects(point_x_y_z2, point_x_y_z_2)
+ self.play(ShowCreation(dot_x_y_z2), ShowCreation(line2))
+ self.add_fixed_orientation_mobjects(point_x_y_z2)
self.wait(0.5)
- self.play(ReplacementTransform(point_x_y_z2,point_x_y_z2_2), ReplacementTransform(point_x_y_z_2,point_x_y_z_2_2))
- self.add_fixed_orientation_mobjects(point_x_y_z2_2, point_x_y_z_2_2)
+ self.play(ReplacementTransform(point_x_y_z2,point_x_y_z2_2))
+ self.add_fixed_orientation_mobjects(point_x_y_z2_2)
self.wait(0.5)
- self.play(ReplacementTransform(point_x_y_z2_2,point_x_y_z2_3), ReplacementTransform(point_x_y_z_2_2,point_x_y_z_2_3))
- self.add_fixed_orientation_mobjects(point_x_y_z2_3, point_x_y_z_2_3)
+ self.play(ReplacementTransform(point_x_y_z2_2,point_x_y_z2_3))
+ self.add_fixed_orientation_mobjects(point_x_y_z2_3)
self.wait(0.5)
- self.play(ReplacementTransform(point_x_y_z2_3,point_x_y_z2_4), ReplacementTransform(point_x_y_z_2_3,point_x_y_z_2_4))
- self.add_fixed_orientation_mobjects(point_x_y_z2_4, point_x_y_z_2_4)
+ self.play(ReplacementTransform(point_x_y_z2_3,point_x_y_z2_4))
+ self.add_fixed_orientation_mobjects(point_x_y_z2_4)
self.wait(0.5)
- self.play(ReplacementTransform(point_x_y_z2_4,point_x_y_z2_5), ReplacementTransform(point_x_y_z_2_4,point_x_y_z_2_5))
- self.add_fixed_orientation_mobjects(point_x_y_z2_5, point_x_y_z_2_5)
+ self.play(ReplacementTransform(point_x_y_z2_4,point_x_y_z2_5))
+ self.add_fixed_orientation_mobjects(point_x_y_z2_5)
- self.play(FadeOut(point_x_y1), FadeOut(point_x_y_z1_5), FadeOut(point_x_y_z_1_5), FadeOut(dot_x_y1), FadeOut(dot_x_y_z1), FadeOut(dot_x_y_z_1), FadeOut(line1))
- self.play(FadeOut(point_x_y2), FadeOut(point_x_y_z2_5), FadeOut(point_x_y_z_2_5), FadeOut(dot_x_y2), FadeOut(dot_x_y_z2), FadeOut(dot_x_y_z_2), FadeOut(line2))
+ self.play(FadeOut(point_x_y1), FadeOut(point_x_y_z1_5))
+ self.play(FadeOut(point_x_y2), FadeOut(point_x_y_z2_5))
sphere_final = []
- for u in range(0, 180, 15):
+ for u in range(0, 90, 15):
sphere_points1 = [np.array([2*np.sin(u*DEGREES)*np.cos(v*DEGREES), 2*np.sin(u*DEGREES)*np.sin(v*DEGREES), 2*np.cos(u*DEGREES)]) for v in range(0, 370, 10)]
sphere_dots1 = [Dot().scale(0.75).set_fill(RED_C).move_to(pts) for pts in sphere_points1]
@@ -158,20 +142,4 @@ class Sphere(ThreeDScene): self.begin_ambient_camera_rotation(rate=0.5)
self.wait(3)
self.play(ReplacementTransform(sphere_final_with_dots, sphere))
- self.wait(5)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ self.wait(5)
\ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py index 06e225e..3c5bb25 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file4_vectorvf_sine.py @@ -4,16 +4,14 @@ class SineVectors(GraphScene): CONFIG = {
"x_min": 0,
"x_max": 10,
- "y_min": -1,
- "y_max": 1,
+ "y_min": -5,
+ "y_max": 5,
"graph_origin": ORIGIN+4*LEFT,
- #"x_labeled_nums": list(range(-5, 6)),
- #"y_labeled_nums": list(range(0, 5)),
+ "x_axis_width": 7,
+ "y_axis_height": 7,
}
def construct(self):
-
-
XTD = self.x_axis_width/(self.x_max - self.x_min)
@@ -21,17 +19,40 @@ class SineVectors(GraphScene): self.setup_axes(animate = True)
+ sine = self.get_graph(lambda x : np.pi*np.sin(x), x_min = 0, x_max = 6.3, color = GREEN)
+
+
+ dot1 = Dot().rotate(PI/2).set_color(RED_C)
+ alpha1 = ValueTracker(0)
+ vector1 = self.get_vector(alpha1.get_value(),sine)
+ dot1.add_updater(lambda m: m.move_to(vector1.get_end()))
+ self.play(
+ ShowCreation(sine),
+ GrowFromCenter(dot1),
+ GrowArrow(vector1)
+ )
+ vector1.add_updater(
+ lambda m: m.become(
+ self.get_vector(alpha1.get_value()%1,sine)
+ )
+ )
+ self.add(vector1,dot1)
+ self.play(alpha1.increment_value, 1, run_time=5, rate_func=linear)
+
+
+ self.play(FadeOut(vector1), FadeOut(dot1), FadeOut(sine))
+
+ self.wait()
+
- sine1 = self.get_graph(lambda x : np.sin(x), x_min = 0, x_max = 1.575, color = GREEN)
+ sine1 = self.get_graph(lambda x : np.pi*np.sin(x), x_min = 0, x_max = 1.575, color = GREEN_C)
- point1 = Dot().shift(self.graph_origin+1*YTD*UP + 1.575*XTD*RIGHT)
- point1_lab = TextMobject(r"$t = (\frac{\pi}{2})$")
- point1_lab.scale(0.7)
- point1_lab.next_to(point1, UP)
+ point1 = Dot().shift(self.graph_origin+np.pi*YTD*UP + 1.575*XTD*RIGHT)
+ point1_lab = TextMobject(r"$t = (\frac{\pi}{2})$", color = GREY).scale(0.6).next_to(point1, 0.5*UP)
- vector1 = Arrow(self.graph_origin, self.graph_origin+1*YTD*UP + 1.575*XTD*RIGHT, buff=0.1, color = RED)
- vector1_lab = TextMobject(r"$r(\frac{\pi}{2})$", color = RED)
- vector1_lab.move_to(self.graph_origin+1.5*XTD*RIGHT+ 0.5*YTD*UP)
+
+ vector1 = Arrow(self.graph_origin, self.graph_origin+np.pi*YTD*UP + 1.575*XTD*RIGHT, buff=0, color = RED_C, tip_length = 0.25)
+ vector1_lab = TextMobject(r"$r(\frac{\pi}{2})$", color = RED).scale(0.7).move_to(self.graph_origin+1.5*XTD*RIGHT+ 1.5*YTD*UP)
self.play(GrowArrow(vector1),Write(vector1_lab))
self.play(ShowCreation(point1), Write(point1_lab))
@@ -39,16 +60,13 @@ class SineVectors(GraphScene): self.wait(1)
- sine2 = self.get_graph(lambda x : np.sin(x), x_min = 1.575, x_max = 3.15, color = GREEN)
+ sine2 = self.get_graph(lambda x : np.pi*np.sin(x), x_min = 1.575, x_max = 3.15, color = GREEN_C)
point2 = Dot().shift(self.graph_origin+3.15*XTD*RIGHT)
- point2_lab = TextMobject(r"$t = (\pi)$")
- point2_lab.scale(0.7)
- point2_lab.next_to(point2, UP+RIGHT)
+ point2_lab = TextMobject(r"$t = (\pi)$", color = GREY).scale(0.6).next_to(point2, 0.5*UP+0.5*RIGHT)
- vector2 = Arrow(self.graph_origin, self.graph_origin+3.15*XTD*RIGHT, buff=0.1, color = BLUE)
- vector2_lab = TextMobject(r"$r(\pi)$", color = BLUE)
- vector2_lab.move_to(self.graph_origin+1.5*XTD*RIGHT+ 0.15*YTD*UP)
+ vector2 = Arrow(self.graph_origin, self.graph_origin+3.15*XTD*RIGHT, buff=0, color = BLUE, tip_length = 0.25)
+ vector2_lab = TextMobject(r"$r(\pi)$", color = BLUE).scale(0.7).move_to(self.graph_origin+1.5*XTD*RIGHT+ 0.4*YTD*UP)
self.play(GrowArrow(vector2),Write(vector2_lab))
self.play(ShowCreation(point2), Write(point2_lab))
@@ -56,16 +74,13 @@ class SineVectors(GraphScene): self.wait(1)
- sine3 = self.get_graph(lambda x : np.sin(x), x_min = 3.15, x_max = 4.725, color = GREEN)
+ sine3 = self.get_graph(lambda x : np.pi*np.sin(x), x_min = 3.15, x_max = 4.725, color = GREEN_C)
- point3 = Dot().shift(self.graph_origin+1*YTD*DOWN + 4.725*XTD*RIGHT)
- point3_lab = TextMobject(r"$t = (\frac{3\pi}{2})$")
- point3_lab.scale(0.7)
- point3_lab.next_to(point3, DOWN)
+ point3 = Dot().shift(self.graph_origin+np.pi*YTD*DOWN + 4.725*XTD*RIGHT)
+ point3_lab = TextMobject(r"$t = (\frac{3\pi}{2})$", color = GREY).scale(0.6).next_to(point3, 0.5*DOWN)
- vector3 = Arrow(self.graph_origin, self.graph_origin+1*YTD*DOWN + 4.725*XTD*RIGHT, buff=0.1, color = YELLOW_C)
- vector3_lab = TextMobject(r"$r(\frac{3\pi}{2})$", color = YELLOW_C)
- vector3_lab.move_to(self.graph_origin+2*XTD*RIGHT+ 0.7*YTD*DOWN)
+ vector3 = Arrow(self.graph_origin, self.graph_origin+np.pi*YTD*DOWN + 4.725*XTD*RIGHT, buff=0, color = YELLOW_C, tip_length = 0.25)
+ vector3_lab = TextMobject(r"$r(\frac{3\pi}{2})$", color = YELLOW_C).scale(0.7).move_to(self.graph_origin+2.5*XTD*RIGHT+ 1*YTD*DOWN)
self.play(GrowArrow(vector3),Write(vector3_lab))
self.play(ShowCreation(point3), Write(point3_lab))
@@ -73,19 +88,27 @@ class SineVectors(GraphScene): self.wait(1)
- sine4 = self.get_graph(lambda x : np.sin(x), x_min = 4.725, x_max = 6.3, color = GREEN)
+ sine4 = self.get_graph(lambda x : np.pi*np.sin(x), x_min = 4.725, x_max = 6.3, color = GREEN_C)
point4 = Dot().shift(self.graph_origin+6.3*XTD*RIGHT)
- point4_lab = TextMobject(r"$t = (2\pi)$")
- point4_lab.scale(0.7)
- point4_lab.next_to(point4, UP+RIGHT)
+ point4_lab = TextMobject(r"$t = (2\pi)$", color = GREY).scale(0.6).next_to(point4, 0.5*UP+0.5*RIGHT)
- vector4 = Arrow(self.graph_origin, self.graph_origin+6.3*XTD*RIGHT, buff=0.1, color = PURPLE)
- vector4_lab = TextMobject(r"$r(2\pi)$", color = PURPLE)
- vector4_lab.move_to(self.graph_origin+4.5*XTD*RIGHT+ 0.15*YTD*DOWN)
+ vector4 = Arrow(self.graph_origin, self.graph_origin+6.3*XTD*RIGHT, buff=0, color = PURPLE, tip_length = 0.25)
+ vector4_lab = TextMobject(r"$r(2\pi)$", color = PURPLE).scale(0.7).move_to(self.graph_origin+4.5*XTD*RIGHT+ 0.4*YTD*DOWN)
self.play(GrowArrow(vector4),Write(vector4_lab))
self.play(ShowCreation(point4), Write(point4_lab))
self.play(ShowCreation(sine4))
self.wait(3)
+ self.play(FadeOut(sine1), FadeOut(point1), FadeOut(point1_lab), FadeOut(vector1), FadeOut(vector1_lab),
+ FadeOut(sine2), FadeOut(point2), FadeOut(point2_lab), FadeOut(vector2), FadeOut(vector2_lab),
+ FadeOut(sine3), FadeOut(point3), FadeOut(point3_lab), FadeOut(vector3), FadeOut(vector3_lab),
+ FadeOut(sine4), FadeOut(point4), FadeOut(point4_lab), FadeOut(vector4), FadeOut(vector4_lab))
+
+
+
+ def get_vector(self, proportion, curve):
+ vector = Arrow(np.array([-4,0,0]), curve.point_from_proportion(proportion), color = ORANGE, buff=0, tip_length = 0.25)
+ return vector
+
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_vectorvf_helix.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_vectorvf_helix.py index fc151ac..c02f540 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_vectorvf_helix.py +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/file5_vectorvf_helix.py @@ -20,7 +20,9 @@ class Helix(ThreeDScene): ]),color=GREEN_C,t_min=-TAU,t_max=TAU,
)
- function = TexMobject("f(", "r", ",", "\\theta", ")", "=", "[", "r", "\\cos", "\\theta", ",", "r", "\\sin" ,"\\theta", ",", "h" ,"\\theta", "]" ).scale(0.6).to_corner(UL)
+
+ function = TexMobject("f(", "r", ",", "\\theta", ")", "=", "{ \\begin{bmatrix} r \\cos\\theta \\\ r \\sin \\theta \\\ h \\theta \\end{bmatrix}}" ).scale(0.6).to_corner(UL)
+
function.set_color_by_tex(r"\theta", BLUE_C)
function.set_color_by_tex(r"r", RED_C)
function.set_color_by_tex(r"\cos", GREEN_C)
@@ -28,8 +30,13 @@ class Helix(ThreeDScene): function[0].set_color(ORANGE)
function[4].set_color(ORANGE)
+
+
+ slope_text = TextMobject(r"$\theta = $").move_to(3*UP+3*RIGHT)
+ number = DecimalNumber(0,unit=r" rad", color=RED_C).next_to(slope_text, RIGHT)
+
- self.add_fixed_in_frame_mobjects(function)
+ self.add_fixed_in_frame_mobjects(function,slope_text, number)
self.set_camera_orientation(phi=60*DEGREES, theta = 45*DEGREES)
@@ -49,41 +56,41 @@ class Helix(ThreeDScene): alpha1 = ValueTracker(0)
vector1 = self.get_vector(alpha1.get_value(),helix1)
dot1.add_updater(lambda m: m.move_to(vector1.get_end()))
+ number.add_updater(lambda m: m.set_value(alpha1.get_value()*4*np.pi))
+ number.add_updater(lambda m: self.add_fixed_in_frame_mobjects(m))
+
+
self.play(
ShowCreation(helix1),
GrowFromCenter(dot1),
GrowArrow(vector1)
+
)
+
vector1.add_updater(
lambda m: m.become(
self.get_vector(alpha1.get_value()%1,helix1)
)
)
+
+
+
self.add(vector1,dot1)
+
+
self.play(alpha1.increment_value, 1, run_time=10, rate_func=linear)
- self.play(FadeOut(vector1), FadeOut(dot1))
- self.play(ReplacementTransform(helix1, helix2))
+ self.play(FadeOut(vector1), FadeOut(dot1), FadeOut(number))
+ self.move_camera(phi=0* DEGREES,theta=90*DEGREES)
- dot2 = Dot().rotate(PI/2).set_color(RED_C)
- alpha2 = ValueTracker(0)
- vector2 = self.get_vector(alpha2.get_value(),helix2)
- dot2.add_updater(lambda m: m.move_to(vector2.get_end()))
- self.play(
- ShowCreation(helix2),
- GrowFromCenter(dot2),
- GrowArrow(vector2)
- )
- vector2.add_updater(
- lambda m: m.become(
- self.get_vector(alpha2.get_value()%1,helix2)
- )
- )
- self.add(vector2,dot2)
- self.play(alpha2.increment_value, 1, run_time=10, rate_func=linear)
- self.wait()
+ alpha1 = ValueTracker(0)
+
+ self.add(vector1,dot1)
+
+
+ self.play(alpha1.increment_value, 1, run_time=10, rate_func=linear)
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivar_func_examples.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivar_func_examples.gif Binary files differindex 43c3a42..d078fb9 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivar_func_examples.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file1_multivar_func_examples.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_respresentation.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_respresentation.gif Binary files differindex 8c4506c..83faaa6 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_respresentation.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file2_multivariable_func_respresentation.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_sphere.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_sphere.gif Binary files differindex 3e35ec8..86fa8fe 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_sphere.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file3_sphere.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif Binary files differindex 215459e..b6a266f 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file4_vectorvf_sine.gif diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_vectorvf_helix.gif b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_vectorvf_helix.gif Binary files differindex c3d37f6..bee019c 100644 --- a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_vectorvf_helix.gif +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/multivariable-functions/gifs/file5_vectorvf_helix.gif |