summaryrefslogtreecommitdiff
path: root/FSF-2020
diff options
context:
space:
mode:
authorVaishnavi2020-06-24 08:18:20 +0530
committerGitHub2020-06-24 08:18:20 +0530
commit3c5b714525c48f088bda1371cea7257ac7fb6e72 (patch)
tree7748f969601e93b60babc90d150e7e785682e095 /FSF-2020
parente21e7a8b9ad0c4ee941be780252e01f1cf0fe4dc (diff)
downloadFSF-mathematics-python-code-archive-3c5b714525c48f088bda1371cea7257ac7fb6e72.tar.gz
FSF-mathematics-python-code-archive-3c5b714525c48f088bda1371cea7257ac7fb6e72.tar.bz2
FSF-mathematics-python-code-archive-3c5b714525c48f088bda1371cea7257ac7fb6e72.zip
Create file3_Optimizing_function_w.r.t_one_constraint.py
Diffstat (limited to 'FSF-2020')
-rw-r--r--FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.py b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.py
new file mode 100644
index 0000000..bf75dd8
--- /dev/null
+++ b/FSF-2020/calculus-of-several-variables/approximations-and-optimizations/Lagrange-Multipliers/file3_Optimizing_function_w.r.t_one_constraint.py
@@ -0,0 +1,29 @@
+from manimlib.imports import*
+
+class firstScene(ThreeDScene):
+ def construct(self):
+ axes = ThreeDAxes()
+ cylinder = ParametricSurface(
+ lambda u, v: np.array([
+ np.cos(TAU * v),
+ np.sin(TAU * v),
+ 2 * (u)
+ ]),checkerboard_colors=[YELLOW_C,YELLOW_D,YELLOW_E]
+ ).fade(0.4) #Resolution of the surfaces
+
+ plane = ParametricSurface(
+ lambda u, v: np.array([
+ u,
+ v,
+ u+v
+ ]),checkerboard_colors=[TEAL_C,TEAL_D,TEAL_E]
+ ).scale(2.5)
+ self.add(axes)
+ self.set_camera_orientation(phi=75*DEGREES,theta=45*DEGREES)
+ self.play(Write(cylinder))
+ self.play(Write(plane))
+ self.wait(1)
+ self.begin_ambient_camera_rotation(rate=0.7)
+ self.wait(5)
+ self.move_camera(phi=35*DEGREES,theta=-45*DEGREES)
+ self.wait(2)