summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_epsilon_delta_defn.py
blob: 63b6165122caf3db3c8ed88bdfd14b9b8b1b6119 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
from manimlib.imports import *

class EpsilonDelta(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes() # creates a 3D Axis
        

        sphere = ParametricSurface(
            lambda u, v: np.array([
                2*np.sin(u)*np.cos(v),
                2*np.sin(u)*np.sin(v),
                2*np.cos(u)
            ]),u_min=0,u_max=PI/4,v_min=0,v_max=PI/2,checkerboard_colors=[RED_D, RED_E],
            resolution=(15, 32)).scale(2)
        #sphere.shift(0.5*RIGHT+0.5*UP)

        #self.set_camera_orientation(phi=0*DEGREES,theta=270*DEGREES)
        self.set_camera_orientation(phi=75 * DEGREES)
        


        circle = Circle(radius= 0.4,color = GREEN)
        circle.shift(0.5*RIGHT+0.5*UP)

        line1 = DashedLine(np.array([0.5, 0.1,0]), np.array([0.5, 0.1,2.1]), color = BLUE_E)
        line2 = DashedLine(np.array([0.5, 0.9,0]), np.array([0.5, 0.9,1.7]), color = BLUE_E)
        line3 = DashedLine(np.array([0, 0,2.1]), np.array([0.5, 0.1,2.1]), color = YELLOW_C)
        line4 = DashedLine(np.array([0, 0,1.7]), np.array([0.5, 0.9,1.7]), color = YELLOW_C)

        dot1 = Sphere()
        dot1.scale(0.01)
        dot1.move_to(np.array([0,0,1.9]))
        dot1.set_fill(BLUE_E)

        temp_func1 = TextMobject(r"$L$")
        temp_func1.scale(0.6)
        temp_func1.set_color(BLUE_E)

        dot2 = Sphere()
        dot2.scale(0.01)
        dot2.move_to(np.array([0,0,1.7]))
        dot2.set_fill(PURPLE)

        temp_func2 = TextMobject(r"$L - \epsilon$")
        temp_func2.scale(0.6)
        temp_func2.set_color(PURPLE)

        dot3 = Sphere()
        dot3.scale(0.01)
        dot3.move_to(np.array([0,0,2.1]))
        dot3.set_fill(PURPLE)

        temp_func3 = TextMobject(r"$L + \epsilon$")
        temp_func3.scale(0.6)
        temp_func3.set_color(PURPLE)

        self.add(axes)

        self.play(ShowCreation(dot1))
        self.add_fixed_in_frame_mobjects(temp_func1)
        temp_func1.move_to(1.9*UP)
        self.play(Write(temp_func1))

        self.play(ShowCreation(dot2))
        self.add_fixed_in_frame_mobjects(temp_func2)
        temp_func2.move_to(1.7*UP)
        self.play(Write(temp_func2))

        self.play(ShowCreation(dot3))
        self.add_fixed_in_frame_mobjects(temp_func3)
        temp_func3.move_to(2.1*UP)
        self.play(Write(temp_func3))


        circle_center = Sphere()
        circle_center.scale(0.05)
        circle_center.move_to(np.array([0.5,0.5,0]))
        circle_center.set_fill(GREEN)

        temp_circle_center = TextMobject(r"$(a,b,0)$")
        temp_circle_center.scale(0.5)
        temp_circle_center.set_color(GREEN)

        curve_circle_center = Sphere()
        curve_circle_center.scale(0.05)
        curve_circle_center.move_to(np.array([0.5,0.5,1.9]))
        curve_circle_center.set_fill(BLUE_E)

        temp_curve_circle_center = TextMobject(r"$(a,b,L)$")
        temp_curve_circle_center.scale(0.5)
        temp_curve_circle_center.set_color(BLUE)

        delta_lab = TextMobject(r"$\delta - disk$")
        delta_lab.scale(0.5)
        delta_lab.set_color(PINK)   

        self.play(ShowCreation(circle_center))
        self.add_fixed_in_frame_mobjects(temp_circle_center)
        temp_circle_center.move_to(1.5*RIGHT)
        self.play(Write(temp_circle_center))

        self.play(ShowCreation(curve_circle_center))
        self.add_fixed_in_frame_mobjects(temp_curve_circle_center)
        temp_curve_circle_center.move_to(1.9*UP+1*RIGHT)
        self.play(Write(temp_curve_circle_center))


        self.add_fixed_in_frame_mobjects(delta_lab)
        delta_lab.move_to(0.4*DOWN+1.7*RIGHT)
        self.play(Write(delta_lab))





        self.begin_ambient_camera_rotation(rate=0.2)
        self.play(Write(sphere))
        self.play(ShowCreation(circle), ShowCreation(line1), ShowCreation(line2))
        self.play(ShowCreation(line3), ShowCreation(line4))
        self.wait(8)