import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
# ฟังก์ชันการแจกแจงเบตา
beta = mnm.Tex(r'f(\alpha,\beta) = \frac{x^{\alpha-1}(1-x)^{\beta-1} }{B(\alpha,\beta)}',font_size=96)
# แทนค่า α=2, β=3 ลงสมการ
beta23 = mnm.Tex(r'f(2,3) = \frac{x^{2-1}(1-x)^{3-1} }{B(2,3)}',font_size=96,color='#a4ff9a')
self.play(
mnm.Transform(beta,beta23),
run_time=1.5
)
self.wait(0.5)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
poisson = mnm.Tex(r'f(\lambda) = \frac{\lambda^x \exp(-\lambda)}{x!}',
font_size=144,
fill_opacity=0,
stroke_width=4)
poisson6 = mnm.Tex(r'f(6) = \frac{6^x \exp(-6)}{x!}',
font_size=144,
color='#9addff',
fill_opacity=0,
stroke_width=4)
self.play(
mnm.Transform(poisson,poisson6),
run_time=1.5
)
self.wait(0.5)
mnm.Tex('f','(','p',')','=','p','^x','(','1','-','p)','^{1','-','x}')
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
bernoulli = mnm.Tex(r'f(p) = p^x(1-p)^{1-x}',
isolate=['f','p','=','x','-','1'])
# แทนที่จะเขียนแยกส่วนเป็น
# bernoulli = mnm.Tex('f','(','p',')','=','p','^x','(','1','-','p)','^{1','-','x}')
bernoulli.set_color_by_gradient('#ff9add','#a9f2be')
self.play(
bernoulli.animate.set_width(13),
run_time=1.5
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
bernoulli = mnm.Tex(r'f(p) = p^x(1-p)^{1-x}',
isolate=['f','p','=','x','-','1'],
font_size=144)
bernoulli07 = mnm.Tex(r'f(0.7) = 0.7^x(1-0.7)^{1-x}',
isolate=['f','0.7','=','x','-','1'],
font_size=112,
color='#a9f2ee')
self.play(
mnm.TransformMatchingTex(bernoulli,
bernoulli07,
key_map={'p':'0.7'}),
run_time=1.5
)
self.wait(0.5)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
tex1 = mnm.VGroup(mnm.Tex('n! =',
isolate=['n','!','='],
font_size=112),
mnm.Tex(r'n \times (n-1) \times \cdots \times 1',
isolate=['(','n-1',')','n',r'\times','1',r'\cdots'],
font_size=112))
tex1.arrange(mnm.RIGHT)
tex1.set_color('#cfa3d3')
tex2 = mnm.VGroup(mnm.Tex('6! =',
isolate=['6','!','='],
font_size=112),
mnm.Tex(r'6 \times 5 \times 4 \times 3 \times 2 \times 1',
isolate=['6','5','4','3','2','1',r'\times'],
font_size=112))
tex2.arrange(mnm.RIGHT)
tex2.set_color('#d0f2a9')
tex3 = mnm.VGroup(mnm.Tex('4! =',
isolate=['4','!','='],
font_size=112),
mnm.Tex(r'4 \times 3 \times 2 \times 1',
isolate=['4','3','2','1',r'\times'],
font_size=112))
tex3.arrange(mnm.RIGHT)
tex3.set_color('#d1d3a3')
vg = mnm.VGroup(tex1,tex3,tex2)
vg.arrange(mnm.DOWN,buff=1)
self.add(tex1)
self.play(
mnm.TransformMatchingTex(tex1[0].copy(),
tex2[0],
key_map={'n':'6'}),
mnm.TransformMatchingTex(tex1[1].copy(),
tex2[1],
key_map={'n':'6','n-1':'5'}),
run_time=1.25
)
self.play(
mnm.TransformMatchingTex(tex1[0].copy(),
tex3[0],
key_map={'n':'4'}),
mnm.TransformMatchingTex(tex1[1].copy(),
tex3[1],
key_map={'n':'4','n-1':'3'}),
run_time=1.25
)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
tt = mnm.TexText(r'''Geometrinen jakauma \\
$p(1-p)^{x-1}$ \\
Negatiivinen binomijakauma \\
$C(x+r-1,x)(1-p)^rp^x$''',
color='#f2a9e0',
font_size=100)
self.play(
mnm.Write(tt),
run_time=1.25
)
self.wait(0.25)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
# ค่าในเมทริกซ์
matr = [[1.2,2.4,3.6],
[5,6.6,8.8]]
# เมทริกซ์เลขทศนิยม
matr1 = mnm.DecimalMatrix(matr)
matr1.set_color('#ddf2a9')
matr1.set_width(12)
# เมทริกซ์จำนวนเต็ม
matr2 = mnm.IntegerMatrix(matr)
matr2.set_color('#caa9f2')
matr2.set_width(12)
self.play(
mnm.Transform(matr1,matr2),
run_time=1.25
)
self.wait(0.25)
import manimlib as mnm
class Manimala(mnm.Scene):
def construct(self):
tex = mnm.Tex('7-x','+','3i+yi',font_size=180,color="#e3ebb8")
brace1 = mnm.Brace(tex[0],mnm.UP,color='#a3d3ba')
text1 = mnm.Text('ส่วนจริง',color='#a3d3ba',size=1.6)
text1.next_to(brace1,mnm.UP)
brace2 = mnm.Brace(tex[2],mnm.UP,color='#d3a3bf')
text2 = mnm.Text('ส่วนจินตภาพ',color='#d3a3bf',size=1.6)
text2.next_to(brace2,mnm.UP)
brace3 = mnm.Brace(tex,mnm.DOWN,color='#b8e3eb')
text3 = mnm.Text('จำนวนเชิงซ้อน',color='#b8e3eb',size=2)
text3.next_to(brace3,mnm.DOWN)
self.add(tex)
self.play(
mnm.ClockwiseTransform(tex[0].copy(),brace1),
mnm.CounterclockwiseTransform(tex[2].copy(),brace2),
mnm.FadeTransform(tex.copy(),brace3),
mnm.ShowCreation(text1),
mnm.Write(text2),
mnm.GrowFromCenter(text3),
run_time=1.1
)
self.wait(0.4)
ติดตามอัปเดตของบล็อกได้ที่แฟนเพจ