diff options
author | Vaishnavi | 2020-06-24 04:51:58 +0530 |
---|---|---|
committer | GitHub | 2020-06-24 04:51:58 +0530 |
commit | a79446a128f65df2de58229ee5b48a12fe29cdd4 (patch) | |
tree | 897b944dd8bee79a705af6dec124d2cc54f5dc10 /FSF-2020/approximations-and-optimizations | |
parent | 9c6d394101ad89681ef497cd0667fa23e6f3d168 (diff) | |
download | FSF-mathematics-python-code-archive-a79446a128f65df2de58229ee5b48a12fe29cdd4.tar.gz FSF-mathematics-python-code-archive-a79446a128f65df2de58229ee5b48a12fe29cdd4.tar.bz2 FSF-mathematics-python-code-archive-a79446a128f65df2de58229ee5b48a12fe29cdd4.zip |
Rename FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py to FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py
Diffstat (limited to 'FSF-2020/approximations-and-optimizations')
-rw-r--r-- | FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py deleted file mode 100644 index 4b020e1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py +++ /dev/null @@ -1,88 +0,0 @@ -from manimlib.imports import* -import math as m - -#---- tangent to the trace with x constant -class firstScene(ThreeDScene): - def construct(self): - - axes = ThreeDAxes().scale(1) - label_x = TextMobject("$x$").shift([5.8,-0.5,0]) - label_y = TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) - - #---- graph of f(x,y) = -x^2-y^2 - surface = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(1.5).shift([0,0,2]).rotate(0.2) - - #---- curve(trace) along y axis - curve = ParametricSurface( - lambda u, v: np.array([ - u*0.4, - v, - -v**2 - ]),v_min =-1 , v_max =1 , u_min = -0.1, u_max = 0.1).scale(1.6).shift([0.02,0.1,2.3]).set_color("#800000").rotate(0.1) - - d = Dot(color =YELLOW).shift([-0.05,-0.2,2.3]) #---- critical point - - x_text = TextMobject("Tangent to the trace with $x$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) - - tangent_line = Line([-0.05,-1.5,2.3],[-0.05,1.5,2.3],color = '#228B22') - - self.add(axes) - self.set_camera_orientation(phi = 40 * DEGREES, theta = 55 * DEGREES) - self.begin_ambient_camera_rotation(rate = 0.1) - self.add(label_x) - self.add(label_y) - self.play(Write(surface)) - self.add_fixed_in_frame_mobjects(x_text) - self.add(curve) - self.wait(1) - self.play(Write(tangent_line),Write(d)) - self.wait(1) - - - -#---- tangent to the trace with y constant -class secondScene(ThreeDScene): - def construct(self): - - axes = ThreeDAxes().scale(1) - label_x = TextMobject("$x$").shift([5.8,-0.5,0]) - label_y = TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) - - #---- graph of f(x,y) = -x^2-y^2 - surface = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),u_min = -1, u_max = 1, v_min = -1, v_max = 1, checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D,PURPLE_E]).scale(1.5).shift([0,0,2]).rotate(0.2) - - #---- curve(trace) along x axis - curve = ParametricSurface( - lambda u, v: np.array([ - u, - v*0.4, - -u**2 - ]),v_min = -0.1, v_max = 0.1, u_min = -1, u_max = 1).scale(1.6).shift([0.07,0.1,2.3]).set_color("#800000") - - d = Dot(color = YELLOW).shift([0,-0.2,2.3]) #---- critical point - - tangent_line = Line(color = '#228B22').scale(1).shift([0,-0.2,2.3]).rotate(m.radians(190),LEFT) - - y_text = TextMobject("Tangent to the trace with $y$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) - - self.add(axes) - self.set_camera_orientation(phi = 40 * DEGREES, theta = 55 * DEGREES) - self.add(label_x) - self.add(label_y) - self.begin_ambient_camera_rotation(rate = 0.1) - self.play(Write(surface)) - self.add_fixed_in_frame_mobjects(y_text) - self.add(curve) - self.wait(1.5) - self.play(Write(tangent_line),Write(d)) - self.wait(0.5) |