summaryrefslogtreecommitdiff
path: root/FSF-2020/approximations-and-optimizations
diff options
context:
space:
mode:
authorVaishnavi2020-06-13 22:58:17 +0530
committerGitHub2020-06-13 22:58:17 +0530
commit29223f0559e2f94166591fdacee0afa651f9bdc0 (patch)
treecb3c19ef3c80edb03e1b91998655e19cb0d266ca /FSF-2020/approximations-and-optimizations
parentfdec91753096122b57ab787d005d08c2aa8b4386 (diff)
downloadFSF-mathematics-python-code-archive-29223f0559e2f94166591fdacee0afa651f9bdc0.tar.gz
FSF-mathematics-python-code-archive-29223f0559e2f94166591fdacee0afa651f9bdc0.tar.bz2
FSF-mathematics-python-code-archive-29223f0559e2f94166591fdacee0afa651f9bdc0.zip
Update and rename file1_Total_area_of_cross_section.py to file1_Critical_Point_of_a_function.py
modified the code for gif1
Diffstat (limited to 'FSF-2020/approximations-and-optimizations')
-rw-r--r--FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py32
-rw-r--r--FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py31
2 files changed, 32 insertions, 31 deletions
diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py
new file mode 100644
index 0000000..0b15ebf
--- /dev/null
+++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py
@@ -0,0 +1,32 @@
+from manimlib.imports import*
+import math as m
+
+
+class CriticalPoint(ThreeDScene):
+ def construct(self):
+
+ axes = ThreeDAxes()
+ surface = ParametricSurface(
+ lambda u, v: np.array([
+ u,
+ v,
+ m.exp(-10*u**2-10*v**2) #---- function equation
+ ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[TEAL_E,TEAL_D,TEAL_C]).fade(0.6).scale(3.5).shift([0,0,1.5])
+
+ l1 = Line([0,0,3.75],[0,0,0],color = '#800000')
+
+ d = Dot([0,0,3.75],color = '#800000')
+ f_text = TextMobject("Critical Point of a function",color = YELLOW).shift([3,0,3.7]).scale(0.7)
+
+ self.add(axes)
+ self.set_camera_orientation(phi=75*DEGREES,theta=90*DEGREES)
+ self.begin_ambient_camera_rotation(rate=0.4)
+ self.play(Write(surface))
+ self.wait(1)
+ self.play(Write(l1))
+ self.play(Write(d))
+ self.wait(2)
+ self.move_camera(phi=0 * DEGREES,theta = 90*DEGREES)
+ self.add_fixed_in_frame_mobjects(f_text)
+ self.wait(1)
+
diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py
deleted file mode 100644
index b1ce29c..0000000
--- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py
+++ /dev/null
@@ -1,31 +0,0 @@
-from manimlib.imports import*
-
-class MotivationAnimation(Scene):
- def construct(self):
-
- r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip
- b = Brace(r,UP)
- r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP)
- m_text = TextMobject("Metal Strip").shift(3*DOWN)
- a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP)
- a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2)
- START = [1,0,0]
- END = [0,3,0]
- l = Line(START,END,color = RED).shift(0.9*DOWN)
- a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT)
-
- group1 = VGroup(r_text,b,a,l,a2,a2_text)
- f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN)
-
- ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip
-
- self.play(Write(r))
- self.wait(1)
- self.play(ShowCreation(m_text))
- self.wait(1)
- self.play(Write(group1))
- self.wait(2)
- self.play(FadeOut(group1))
- self.wait(1)
- self.play(ReplacementTransform(r,ring),ShowCreation(f_text))
-