-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScene2.py
More file actions
42 lines (28 loc) · 998 Bytes
/
Scene2.py
File metadata and controls
42 lines (28 loc) · 998 Bytes
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
from manim import *
import math
#Defining what the actual heck the normal distribution is
def PDF_normal(x, mu, sigma):
'''
General form of probability density function of univariate normal distribution
'''
return math.exp(-((x-mu)**2)/(2*sigma**2))/(sigma*math.sqrt(2*math.pi))
class Scene2(Scene):
def construct(self):
CTLTitle = Title("Central Limit Theorem", include_underline= True)
ax1 = Axes(
x_range=[-5,5,1],
y_range=[0,1,1],
axis_config={"include_numbers": False}
)
curve = always_redraw(lambda:
ax1.plot(lambda x:PDF_normal(x, 0, 1), color=YELLOW))
self.play(Write(CTLTitle))
self.wait
self.play(Create(ax1))
self.wait()
self.play(Create(curve))
self.wait(3)
self.play(Uncreate(curve))
self.wait()
Group2 = VGroup(CTLTitle, ax1)
self.play(FadeOut(Group2))