summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/triple-integrals/file2_cylindrical_coordinates.py
blob: d441dc057bb5cc5a7eaeb5328cb53ce06ac21d91 (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
from manimlib.imports import*
class Cy(ThreeDScene):

    def construct(self):

        axes=ThreeDAxes()
        x=TextMobject("X")
        y=TextMobject("Y")
        z=TextMobject("Z")

        x.rotate(PI/2, axis=RIGHT)
        x.rotate(PI/4,axis=OUT)
        x.shift(5.8*DOWN)

        y.rotate(PI/2, axis=RIGHT)
        y.rotate(PI/8,axis=OUT)
        y.shift(5.8*RIGHT)

        z.rotate(PI/2, axis=RIGHT)
        z.rotate(PI/5,axis=OUT)
        z.shift(3.2*OUT+0.4*LEFT)
        axis_label=VGroup(x,y,z)






        
        x1=TextMobject("$x_{1}$")
        y1=TextMobject("$y_{1}$")
        z1=TextMobject("$z_{1}$")
        



        x1.rotate(PI/2, axis=RIGHT)
        x1.rotate(PI/2, axis=OUT)
        x1.shift(2*DOWN+0.3*OUT+0.3*LEFT)
        
        y1.rotate(PI/2, axis=RIGHT)
        y1.shift(2*RIGHT+0.3*OUT)
        
        z1.rotate(PI/2, axis=RIGHT)
        z1.rotate(PI/4, axis=OUT)
        z1.shift(2*OUT+0.3*DOWN+0.2*LEFT)


        d1=Dot(color=RED,radius=0.05)
        d2=Dot(color=RED,radius=0.05)
        d3=Dot(color=RED,radius=0.05)


        d1.shift(2*DOWN)
        d1.rotate(PI/2,axis=UP)

        d2.rotate(PI/2, axis=RIGHT)
        d2.shift(2*RIGHT)

        d3.rotate(PI/2, axis=RIGHT)
        d3.rotate(PI/4, axis=OUT)
        d3.shift(2*OUT)



        l1=DashedLine(color=RED)
        l1.scale(5)
        l1.shift(2*DOWN+5*RIGHT)

        l2=DashedLine(color=RED)
        l2.scale(5)
        l2.rotate(PI/2, axis=IN)
        l2.shift(2*RIGHT+5*DOWN)

        l3=DashedLine(color=RED)
        l3.scale(5)
        l3.rotate(PI/4,axis=IN)
        l3.shift(2*OUT+4*RIGHT+4*DOWN)

        point=Sphere(radius=0.02, checkerboard_colors=[BLUE,BLUE])
        point.shift(2*RIGHT+2*DOWN)

        proj=Line()
        proj.scale(1.414)
        proj.rotate(PI/4,axis=IN)
        proj.shift(1*RIGHT+1*DOWN)


        projl=DashedLine()
        projl.rotate(PI/2, axis=DOWN)
        projl.shift(1*OUT+2*RIGHT+2*DOWN)

        p=TextMobject("$P(x,y,z)$")
        p.scale(0.6)
        p.rotate(PI/2, axis=RIGHT)
        p.rotate(PI/9, axis=OUT)
        p.shift(2.9*RIGHT+2.5*DOWN+2.3*OUT)

        rho=TextMobject(r"$\rho$",tex_to_color_map={r"$\rho$": YELLOW})
        rho.rotate(PI/2, axis=RIGHT)
        rho.shift(1.5*RIGHT+1.36*DOWN+0.2*OUT)

       


        carrow=CurvedArrow(start_point=1*DOWN, end_point=0.5*RIGHT+0.5*DOWN)
     

        phi=TextMobject(r"$\phi$",tex_to_color_map={"$\phi$": YELLOW})
        phi.scale(0.93)
        phi.rotate(PI/2, axis=RIGHT)
        phi.shift(0.3*RIGHT+1.3*DOWN)










        self.set_camera_orientation(phi=70 * DEGREES,theta=-15*DEGREES)
        self.play(ShowCreation(axes),ShowCreation(axis_label))
        self.begin_ambient_camera_rotation(rate=-0.1)
        
        self.play(ShowCreation(x1),ShowCreation(d1))
        self.wait(0.5)
        self.play(ShowCreation(l1))
        self.wait(1)
        self.play(ShowCreation(y1),ShowCreation(d2))
        self.wait(0.5)
        self.play(ShowCreation(l2))
        self.wait(1)
        self.add(point)
        self.wait(0.5)
        self.play(FadeOut(l1),FadeOut(l2))
        self.wait(0.5)
        self.play(ShowCreation(proj))
        self.wait(0.64)
        self.stop_ambient_camera_rotation()  
        self.play(ShowCreation(rho))
        self.wait(1)

        self.play(ShowCreation(z1),ShowCreation(d3))
        self.wait(0.5)
        self.play(ShowCreation(l3))
        self.wait(1)
        self.play(ApplyMethod(point.shift, 2*OUT), ShowCreation(projl))
        self.play(FadeOut(l3))
        self.play(ShowCreation(p),FadeOut(projl))
        self.wait(0.5)
        # self.play(ShowCreation(vec))



        

        self.wait(1)
        self.play(ShowCreation(carrow),ShowCreation(phi))

        self.wait(5)