summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables
diff options
context:
space:
mode:
authorVaishnavi2020-06-29 00:43:56 +0530
committerGitHub2020-06-29 00:43:56 +0530
commita4c28a866815b0b2687e3baf2d1dbc96a7039324 (patch)
tree9d9f7f6b19bea10942114db7f246636114879b8a /FSF-2020/calculus-of-several-variables
parentf78f8e6889c00cc3d9ec4e0094fb8417cdf74240 (diff)
downloadFSF-mathematics-python-code-archive-a4c28a866815b0b2687e3baf2d1dbc96a7039324.tar.gz
FSF-mathematics-python-code-archive-a4c28a866815b0b2687e3baf2d1dbc96a7039324.tar.bz2
FSF-mathematics-python-code-archive-a4c28a866815b0b2687e3baf2d1dbc96a7039324.zip
Update file1_Extrema_over_g(x,y)=k.py
Diffstat (limited to 'FSF-2020/calculus-of-several-variables')
-rw-r--r--FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py
index 17f31ac..17ba858 100644
--- a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py
+++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file1_Extrema_over_g(x,y)=k.py
@@ -1,14 +1,18 @@
from manimlib.imports import*
+import math as m
class firstScene(ThreeDScene):
def construct(self):
- axes = ThreeDAxes()
+ axes = ThreeDAxes().fade(0.4)
+ label_x = TextMobject("$x$").shift([5.5,-0.5,0]).fade(0.4) #---- x axis
+ label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5).fade(0.4) #---- y axis
+
surface = ParametricSurface(
lambda u, v: np.array([
u,
v,
u**2+v**2+u**3-v**3
- ]),u_min=-0.5,u_max=0.5, v_min=-0.5,v_max=0.5).scale(5).shift([0,1,2.5]).set_color('#F0FFFF').fade(0.4)
+ ]),u_min=-0.5,u_max=0.5, v_min=-0.5,v_max=0.5).scale(5).shift([0,1,2.5]).set_color(TEAL).fade(0.4)
c = Circle().set_color('#FF00FF').shift([-0.4,0,1.5]).rotate(1.9,UP).scale(0.7)
@@ -26,10 +30,11 @@ class firstScene(ThreeDScene):
max_text = TextMobject("maximum over $g(x,y)=k$",color = '#FFA074').shift([-1.7,0,0]).scale(0.5).shift(2.2*UP)
min_text = TextMobject("minimum over $g(x,y)=k$",color = '#FFA074').shift([2.5,0.5,1]).scale(0.5).shift(0.5*UP)
label_f = TextMobject("$z=f(x,y)$",color = '#8A2BE2').scale(0.5).shift(3*UP+3*RIGHT)
- label_g = TextMobject("$g(x,y)=k$",color = '#8A2BE2').scale(0.5).shift(2*RIGHT)
-
+ label_g = TextMobject("$g(x,y)=k$",color = '#8A2BE2').scale(0.5).shift(2*RIGHT)
self.add(axes)
+ self.add(label_x)
+ self.add(label_y)
self.set_camera_orientation(phi=75*DEGREES,theta=45*DEGREES)
self.play(Write(surface))
self.add_fixed_in_frame_mobjects(label_f)
@@ -49,5 +54,3 @@ class firstScene(ThreeDScene):
self.play(Write(maxima_refl))
self.play(Write(minima_refl))
self.wait(1)
-
-