diff options
author | Somnath Pandit | 2020-05-26 12:17:38 +0530 |
---|---|---|
committer | GitHub | 2020-05-26 12:17:38 +0530 |
commit | f26d34f6f654c5070fd62b92c8bb59f9e5b00762 (patch) | |
tree | 6ef78a3a15415b9a730158dbf6ae6a4feedbdb42 /FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file6-maximum.py | |
parent | 0a079186b73414908e7af909bb950dacb7ebac07 (diff) | |
parent | 4f868ac75ba1c8777cb7ab023909fc09bae9e3d0 (diff) | |
download | FSF-mathematics-python-code-archive-f26d34f6f654c5070fd62b92c8bb59f9e5b00762.tar.gz FSF-mathematics-python-code-archive-f26d34f6f654c5070fd62b92c8bb59f9e5b00762.tar.bz2 FSF-mathematics-python-code-archive-f26d34f6f654c5070fd62b92c8bb59f9e5b00762.zip |
Merge pull request #1 from FOSSEE/master
Update with head repo
Diffstat (limited to 'FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file6-maximum.py')
-rw-r--r-- | FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file6-maximum.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file6-maximum.py b/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file6-maximum.py new file mode 100644 index 0000000..255a0eb --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/div-curl-grad-and-all-that/gradient/file6-maximum.py @@ -0,0 +1,39 @@ +from manimlib.imports import * +import numpy as np + + +def function(coordinate): + x,y = coordinate[:2] + return np.array([ + x, + y, + 2 - x**2 - y**2 + ]) + +class ThreeDVector_one(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + self.add(axes) + self.set_camera_orientation(phi=75*DEGREES,theta=45*DEGREES,distance=40) + self.begin_ambient_camera_rotation(rate=0.5) + + surface = ParametricSurface( + lambda x, y: np.array([ + x, + y, + 2 - x**2 - y**2 + ]),u_min=-2,u_max=2, v_min=-2,v_max=2).set_color(RED_E).fade(0.7) + + probe = Sphere(radius = 0.2).set_color(PURPLE_E) + probe_one = Sphere(radius = 0.1).set_color(PURPLE_E).move_to(np.array([0,0,2.1])) + text_one_b = TexMobject(r" \textrm{ reads 0 at local maximum }").next_to(probe, RIGHT, buff = SMALL_BUFF) + name = TextMobject("PROBE2.0 ").next_to(probe, DOWN, buff = SMALL_BUFF).scale(0.5) + text = VGroup(probe, text_one_b, name).to_edge(1.5*UP+0.5*LEFT).scale(0.5) + + + self.play(ShowCreation(surface)) + self.add(probe_one) + field = VectorField(function).scale(0.8) + self.play(FadeIn(field)) + self.add_fixed_in_frame_mobjects(text) + self.wait(3) |