diff options
author | Vaishnavi | 2020-06-14 00:47:11 +0530 |
---|---|---|
committer | GitHub | 2020-06-14 00:47:11 +0530 |
commit | 246c53a8a6e621b7d6a6730e4ea7a3a0c3275740 (patch) | |
tree | 56987e966f9817b903dfb2e5917bb9f38fac5afd /FSF-2020 | |
parent | 9c829be87de73eb7bbd0ea2fe5a74e2894fb9720 (diff) | |
download | FSF-mathematics-python-code-archive-246c53a8a6e621b7d6a6730e4ea7a3a0c3275740.tar.gz FSF-mathematics-python-code-archive-246c53a8a6e621b7d6a6730e4ea7a3a0c3275740.tar.bz2 FSF-mathematics-python-code-archive-246c53a8a6e621b7d6a6730e4ea7a3a0c3275740.zip |
Create file5_f(x,y)=(y-x)(1-2x-3y).py
Diffstat (limited to 'FSF-2020')
-rw-r--r-- | FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py new file mode 100644 index 0000000..8a90990 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py @@ -0,0 +1,25 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + + #----f(x,y) = (y-x)(1-2x-3y) + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (v-u)*(1-2*u-3*v) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D, PURPLE_E], + resolution=(20, 20)).scale(1).fade(0.2).shift([0.2,0.2,0]) + + self.set_camera_orientation(phi = 75 * DEGREES,theta= 60*DEGREES) + self.begin_ambient_camera_rotation(rate=0.1) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f)) + self.wait(3) |