summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py
diff options
context:
space:
mode:
authorG Sri Harsha2020-07-01 01:39:39 +0530
committerGitHub2020-07-01 01:39:39 +0530
commitb319aaf00e62572270d1fc48675d65d3d8e58944 (patch)
tree200eb34921deaae1ba440420d852ad3e82c0b839 /FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py
parent70087cc17df3609a1ed256571bdfd3757ce75e24 (diff)
parent95b35efe6166fe145e44314e11e0a7d3ac638874 (diff)
downloadFSF-mathematics-python-code-archive-b319aaf00e62572270d1fc48675d65d3d8e58944.tar.gz
FSF-mathematics-python-code-archive-b319aaf00e62572270d1fc48675d65d3d8e58944.tar.bz2
FSF-mathematics-python-code-archive-b319aaf00e62572270d1fc48675d65d3d8e58944.zip
Merge pull request #4 from FOSSEE/master
others work
Diffstat (limited to 'FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py')
-rw-r--r--FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py
new file mode 100644
index 0000000..9310553
--- /dev/null
+++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/The-Second-Derivative-Test/file3_Degenerate_Hessian_Matrix.py
@@ -0,0 +1,45 @@
+from manimlib.imports import*
+import math as m
+
+class DegenerateHessian(ThreeDScene):
+ def construct(self):
+
+ heading = TextMobject("Degenerate Hessian Matrix",color = BLUE)
+
+ h_text = TextMobject("For $det \\hspace{1mm} H = 0$, the surface of the function at the critical point would be flat.").scale(0.7)
+
+ axes = ThreeDAxes()
+ label_x = TextMobject("$x$").shift([5.5,-0.3,0]) #---- x axis
+ label_y = TextMobject("$y$").shift([-0.3,5.5,0]).rotate(-4.5) #---- y axis
+
+ #---- function f(x,y)
+ f_surface = ParametricSurface(
+ lambda u, v: np.array([
+ u,
+ v,
+ -u**4-v**4
+ ]),u_min = -0.8, u_max = 0.8, v_min = -0.8, v_max = 0.8).set_color(TEAL).shift([0,0,-0.5]).scale(2)
+
+ f_text= TextMobject("surface of the function").to_corner(UL).scale(0.5)
+
+ d = Dot(color = "#800000").shift([0,0,-0.5]) #---- critical point
+ plane = Square(color = YELLOW,fill_opacity= 0.2).shift([0,0,-0.5]).scale(1.3)
+
+ self.set_camera_orientation(phi = 70*DEGREES, theta = 45*DEGREES)
+ self.add_fixed_in_frame_mobjects(heading)
+ self.wait(1)
+ self.play(FadeOut(heading))
+ self.add_fixed_in_frame_mobjects(h_text)
+ self.wait(2)
+ self.play(FadeOut(h_text))
+ self.wait(1)
+ self.add(axes)
+ self.add(label_x)
+ self.add(label_y)
+ self.play(Write(f_surface))
+ self.add_fixed_in_frame_mobjects(f_text)
+ self.wait(1)
+ self.play(Write(d))
+ self.wait(1)
+ self.play(Write(plane))
+ self.wait(1)