summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables
diff options
context:
space:
mode:
authorVaishnavi2020-06-24 07:24:17 +0530
committerGitHub2020-06-24 07:24:17 +0530
commit2100c05f63318542f26cbbe7fb3786635504be32 (patch)
tree982863191d3881624c07097df59940973a70c7f8 /FSF-2020/calculus-of-several-variables
parenta423cd75c192f771764e95da3ec562dd06bb1779 (diff)
downloadFSF-mathematics-python-code-archive-2100c05f63318542f26cbbe7fb3786635504be32.tar.gz
FSF-mathematics-python-code-archive-2100c05f63318542f26cbbe7fb3786635504be32.tar.bz2
FSF-mathematics-python-code-archive-2100c05f63318542f26cbbe7fb3786635504be32.zip
Create file5_Total_differential_approximation.py
Diffstat (limited to 'FSF-2020/calculus-of-several-variables')
-rw-r--r--FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.py
new file mode 100644
index 0000000..83017ed
--- /dev/null
+++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Total-Differential/file5_Total_differential_approximation.py
@@ -0,0 +1,48 @@
+from manimlib.imports import*
+
+
+class firstScene(ThreeDScene):
+
+ def construct(self):
+
+ axes = ThreeDAxes().rotate(1.571)
+ surface = ParametricSurface(
+ lambda u, v: np.array([
+ np.sin(u),
+ v,
+ -u**2-v
+ ]),u_min=-1,u_max=1, v_min=-1,v_max=1).set_color("#00008B").scale(2).shift(3.8*UP+2*LEFT)
+
+ d = Dot([1.4,1.75,1],color = '#00FFFF').rotate(1.571,UP)
+ d2 = Dot([2,2,1],color = '#00FFFF').rotate(1.571,UP)
+
+ l = DashedLine(color = '#800000').rotate(1.571,UP).scale(1).shift(1.7*UP+1.6*RIGHT)
+ l2 = DashedLine(color = '#800000').rotate(1.571,UP).scale(0.8).shift(2.26*UP+1.2*RIGHT)
+
+ l_text = TextMobject("$(x_1,y_1)$",color = '#ADFF2F').scale(0.6).shift(2*RIGHT+1.6*DOWN)
+ l2_text = TextMobject("$(x_2,y_2)$",color = '#ADFF2F').scale(0.6).shift(2.7*RIGHT+1.2*DOWN)
+
+ plane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(3).shift(1*RIGHT+3*UP).fade(0.9)
+
+ tangentplane = Rectangle(color = '#E6E6FA',fill_opacity = 1).scale(1.1).shift(2*LEFT+3.4*UP).fade(0.5).rotate(0.8,RIGHT)
+ tangentplane_text = TextMobject("Tangent Plane").scale(0.4).shift(3*RIGHT+1*UP)
+
+ label = TextMobject("$z = f(x,y)$").scale(0.6).shift(4*RIGHT+3*UP)
+
+
+ self.add(axes)
+ self.set_camera_orientation(phi=75*DEGREES,theta=-10*DEGREES)
+ self.wait(1)
+ self.play(Write(plane))
+ self.wait(1)
+ self.play(Write(surface))
+ self.add_fixed_in_frame_mobjects(label)
+ self.wait(1.5)
+ self.play(ShowCreation(l),ShowCreation(l2),Write(d),Write(d2))
+ self.wait(1)
+ self.add_fixed_in_frame_mobjects(l_text)
+ self.add_fixed_in_frame_mobjects(l2_text)
+ self.wait(1)
+ self.play(Write(tangentplane))
+ self.add_fixed_in_frame_mobjects(tangentplane_text)
+ self.wait(2)