summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus-of-several-variables/triple-and-surface-integrals/surface-integrals/file2_cube.py
blob: 2a094c8f723fdd8c81ce0ddab6a01b1f3c8988fe (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
from manimlib.imports import*
class cuber(ThreeDScene):

    def construct(self):

        axes=ThreeDAxes()
        cube=Cube(color=RED)
        # cube.scale(1)
        cube.shift(RIGHT+DOWN+OUT)

        sq1=Square(side_length=2,color=RED, fill_opacity=0.5)
        sq1.shift(RIGHT+DOWN)
        # sq1.scale(1.2)
        sq2=Square(color=YELLOW, fill_opacity=0.5)
        sq2.rotate(PI/2,axis=RIGHT)
        sq2.shift(RIGHT+OUT)

        sq3=Square(color=GREEN , fill_opacity=0.5)
        sq3.rotate(PI/2, axis=UP)
        sq3.shift(DOWN+OUT)

        a=TextMobject("side A",tex_to_color_map={"side A": BLACK})
        b=TextMobject("side B",tex_to_color_map={"side B": BLACK})
        c=TextMobject("side C",tex_to_color_map={"side C": BLACK})
        a.rotate(PI/2, axis=RIGHT)
        a.shift(RIGHT+OUT+2*DOWN)
        b.rotate(PI/2, axis=OUT)
        b.rotate(PI/2, axis=UP)
        b.shift(2*RIGHT+DOWN+OUT)
        c.shift(RIGHT+DOWN+2*OUT)
        c.rotate(PI/4, axis=OUT)


        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)



     


        self.set_camera_orientation(phi=75 * DEGREES,theta=-67*DEGREES)
        self.play(ShowCreation(axes),ShowCreation(axis_label))
        self.play(ShowCreation(cube))
        self.begin_ambient_camera_rotation(rate=0.04)
        self.wait(0.7)
        self.play(ShowCreation(sq1))
        self.play(ShowCreation(sq2))
        
        self.play(ShowCreation(sq3))
        self.wait(0.6)
        self.play(ShowCreation(a))
        
        self.play(ShowCreation(b))
        self.move_camera(phi=60*DEGREES,run_time=1)
        self.play(ShowCreation(c))
        self.wait(1)
        self.wait(2)