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
|
from manimlib.imports import *
class GasLaw(Scene):
def construct(self):
gas_law = TextMobject(r"$P$", r"$V$", r"=", r"$n$", r"$R$", r"$T$").scale(1.5)
gas_law[0].set_color(BLUE_C)
gas_law[1].set_color(GREEN_C)
gas_law[3].set_color(RED_C)
gas_law[4].set_color(ORANGE)
gas_law[5].set_color(YELLOW_C)
gas_law_trans = TexMobject("V", "=", "{n", "R", "T", "\\over", "P}").scale(1.5)
gas_law_trans[0].set_color(GREEN_C)
gas_law_trans[2].set_color(RED_C)
gas_law_trans[3].set_color(ORANGE)
gas_law_trans[4].set_color(YELLOW_C)
gas_law_trans[6].set_color(BLUE_C)
gas_law_func = TexMobject("V", "=", "f(", "n", ",", "T", ",", "P", ")").scale(1.5)
gas_law_func[0].set_color(GREEN_C)
gas_law_func[2].set_color(ORANGE)
gas_law_func[3].set_color(RED_C)
gas_law_func[5].set_color(YELLOW_C)
gas_law_func[7].set_color(BLUE_C)
gas_law_func[8].set_color(ORANGE)
partial_gas_law_func = TexMobject("{\\partial", "V","\\over", "\\partial", "P}", r"=", "{\\partial", "\\over", "\\partial", "P}", "f(", r"n", ",", r"T", ",", r"P", r")").scale(1.5)
partial_gas_law_func.set_color_by_tex("\\partial", PINK)
partial_gas_law_func.set_color_by_tex("P}", BLUE_C)
partial_gas_law_func[1].set_color(GREEN_C)
partial_gas_law_func[10].set_color(ORANGE)
partial_gas_law_func[11].set_color(RED_C)
partial_gas_law_func[13].set_color(YELLOW_C)
partial_gas_law_func[15].set_color(BLUE_C)
partial_gas_law_func[16].set_color(ORANGE)
partial_gas_law_trans = TexMobject("{\\partial", "V","\\over", "\\partial", "P}", r"=", "{\\partial", "\\over", "\\partial", "P}", "{n", "R", "T", "\\over", "P}").scale(1.5)
partial_gas_law_trans.set_color_by_tex("\\partial", PINK)
partial_gas_law_trans.set_color_by_tex("P}", BLUE_C)
partial_gas_law_trans[1].set_color(GREEN_C)
partial_gas_law_trans[10].set_color(RED_C)
partial_gas_law_trans[11].set_color(ORANGE)
partial_gas_law_trans[12].set_color(YELLOW_C)
partial_gas_law_trans2 = TexMobject("{\\partial", "V","\\over", "\\partial", "P}", r"=", "n", "R", "T", "{\\partial", "\\over", "\\partial", "P}", "P^{-1}",).scale(1.5)
partial_gas_law_trans2.set_color_by_tex("\\partial", PINK)
partial_gas_law_trans2.set_color_by_tex("P}", BLUE_C)
partial_gas_law_trans2[1].set_color(GREEN_C)
partial_gas_law_trans2[6].set_color(RED_C)
partial_gas_law_trans2[7].set_color(ORANGE)
partial_gas_law_trans2[8].set_color(YELLOW_C)
partial_gas_law_trans2[-1].set_color(BLUE_C)
partial_gas_law_trans3 = TexMobject("{\\partial", "V","\\over", "\\partial", "P}", r"=", "n", "R", "T", "P^{-2}",).scale(1.5)
partial_gas_law_trans3.set_color_by_tex("\\partial", PINK)
partial_gas_law_trans3.set_color_by_tex("P}", BLUE_C)
partial_gas_law_trans3[1].set_color(GREEN_C)
partial_gas_law_trans3[6].set_color(RED_C)
partial_gas_law_trans3[7].set_color(ORANGE)
partial_gas_law_trans3[8].set_color(YELLOW_C)
partial_gas_law_trans3[9].set_color(BLUE_C)
framebox = SurroundingRectangle(partial_gas_law_trans3, color = PURPLE, buff = 0.3)
self.play(Write(gas_law))
self.wait()
self.play(Transform(gas_law, gas_law_trans))
self.wait()
self.play(Transform(gas_law, gas_law_func))
self.wait()
self.play(Transform(gas_law, gas_law_trans))
self.wait()
self.play(Transform(gas_law, partial_gas_law_func))
self.wait()
self.play(Transform(gas_law, partial_gas_law_trans))
self.wait()
self.play(Transform(gas_law, partial_gas_law_trans2))
self.wait()
self.play(Transform(gas_law, partial_gas_law_trans3))
self.wait()
self.play(ShowCreation(framebox))
self.wait()
|