diff options
Diffstat (limited to 'FSF-2020/calculus/series-and-transformations/Fourier Transform')
3 files changed, 10 insertions, 53 deletions
diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py index 39db6d8..fdb8719 100644 --- a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video1_DividingAToneIntoItsConstituents.py @@ -1,13 +1,6 @@ from manimlib.imports import* import numpy as np -# def func(t,n): -# s=0 -# for i in range(1,n+1): -# s+=((-2/(i*np.pi))*((-1)**i)*np.sin(2*np.pi*i*t)) -# return s - - class intro(GraphScene): CONFIG = { "x_min": -3, diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py index 8f3706b..c87e58e 100644 --- a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video2_ColorsAnalogyForFourierSeries.py @@ -101,27 +101,27 @@ class divideColors(GraphScene): self.get_graph(lambda x:func(x,6,24),x_min=-1,x_max=1).set_color([DARK_BROWN,RED_C]), self.get_graph(lambda x:func(x,7,24),x_min=-1,x_max=1).set_color(DARK_BROWN) ] - #self.y_axis_label="$\\frac { 2 }{ \pi } sin(2\pi t)$" + self.setup_axes(scalee=1) axes.append(self.axes) graph1=self.get_graph(lambda x:func(x,1,1),x_min=-1,x_max=1,color=GREEN_E) - #self.y_axis_label="$\\frac { -1 }{ \pi } sin(4\pi t)$" + self.setup_axes(scalee=1) axes.append(self.axes) graph2=self.get_graph(lambda x:func(x,2,2),x_min=-1,x_max=1,color=GREEN_C) - #self.y_axis_label="$\\frac { 2 }{ 3\pi } sin(6\pi t)$" + self.setup_axes(scalee=1) axes.append(self.axes) graph3=self.get_graph(lambda x:func(x,3,3),x_min=-1,x_max=1,color=GOLD_E) - #self.y_axis_label="$\\frac { -1 }{ 2\pi } sin(8\pi t)$" + self.setup_axes(scalee=1) axes.append(self.axes) graph4=self.get_graph(lambda x:func(x,4,4),x_min=-1,x_max=1,color=GOLD_C) - #self.y_axis_label="$\\frac { 2 }{ 5\pi } sin(10\pi t)$" + self.setup_axes(scalee=1) axes.append(self.axes) graph5=self.get_graph(lambda x:func(x,5,5),x_min=-1,x_max=1,color=ORANGE) - #self.y_axis_label="$\\frac { -1 }{ 3\pi } sin(12\pi t)$" + self.setup_axes(scalee=1) axes.append(self.axes) graph6=self.get_graph(lambda x:func(x,6,6),x_min=-1,x_max=1,color=RED_C) @@ -132,9 +132,7 @@ class divideColors(GraphScene): self.play(ShowCreation(graphs[0])) self.play(Write(coeff[0])) self.wait(1) - # self.play(ApplyMethod(axes[0].scale,0.4),ApplyMethod(graphs[0].scale,0.4),ApplyMethod(axes[1].scale,0.4), - # ApplyMethod(axes[2].scale,0.4),ApplyMethod(axes[3].scale,0.4), - # ApplyMethod(axes[4].scale,0.4),ApplyMethod(axes[5].scale,0.4),ApplyMethod(axes[6].scale,0.4)) + self.play(ReplacementTransform(graphs[0],graphs[1]),ApplyMethod(groups[0].shift,4*LEFT+UP),ReplacementTransform(coeff[0],coeff[2]),FadeIn(coeff[1])) self.play(ReplacementTransform(graphs[1],graphs[2]),ApplyMethod(groups[1].shift,4*RIGHT+UP),ReplacementTransform(coeff[2],coeff[4]),FadeIn(coeff[3])) self.play(ReplacementTransform(graphs[2],graphs[3]),ApplyMethod(groups[2].shift,4*LEFT+2*DOWN),ReplacementTransform(coeff[4],coeff[6]),FadeIn(coeff[5])) @@ -142,24 +140,7 @@ class divideColors(GraphScene): self.play(ReplacementTransform(graphs[4],graphs[5]),ApplyMethod(groups[4].shift,2.5*UP),ReplacementTransform(coeff[8],coeff[10]),FadeIn(coeff[9])) self.play(ReplacementTransform(graphs[5],graphs[6]),ApplyMethod(groups[5].shift,2.5*DOWN),ReplacementTransform(coeff[10],coeff[12]),FadeIn(coeff[11])) - # self.play(ReplacementTransform(graphs[0],graphs[1]),ApplyMethod(groups[0].shift,3*LEFT)) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - # self.play(ReplacementTransform(graphs[0],graphs[1]),) - - + self.wait(2) - # self.play(ReplacementTransform(function,const)) - # self.play(ShowCreation(sinx),ShowCreation(cosx)) - # self.play(ShowCreation(sin2x),ShowCreation(cos2x)) - # self.play(ShowCreation(sin3x),ShowCreation(cos3x)) - # self.play(ShowCreation(sin4x),ShowCreation(cos4x)) - # sintext=TextMobject("Infinite","sines").shift(5*RIGHT).set_color_by_tex_to_color_map({"Infinite":[YELLOW,RED],"sines":BLUE}) - # costext=TextMobject("Infinite","cosines").shift(5*LEFT).set_color_by_tex_to_color_map({"Infinite":[YELLOW,RED],"cosines":BLUE}) - # sintext.scale(0.6) - # costext.scale(0.6) - # self.play(FadeIn(sintext),FadeIn(costext)) - # self.wait(2)
\ No newline at end of file + diff --git a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py index 07f884a..d35f8bf 100644 --- a/FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py +++ b/FSF-2020/calculus/series-and-transformations/Fourier Transform/video3_seriesVSTransform.py @@ -125,22 +125,5 @@ class compare(GraphScene,MovingCameraScene): self.play(ApplyMethod(left.shift,LEFT*x_each_unit*0.5),ApplyMethod(right.shift,RIGHT*x_each_unit*0.5),ReplacementTransform(result4,result5),ReplacementTransform(coeffResult[2],coeffResult[3])) - # coeffResult=[ - # TextMobject("$\\frac { { 2 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 1 }{ \\frac { 2{ (-1) }^{ n }{ 2 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } }$").scale(0.3).shift(4.5*RIGHT+1.5*UP), - # TextMobject("$\\frac { { 2 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 4 }{ \\frac { 2{ (-1) }^{ n }{ 2 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+1.5*UP), - # TextMobject("$\\frac { { 2 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 10 }{ \\frac { 2{ (-1) }^{ n }{ 2 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+1.5*UP), - # TextMobject("$\\frac { { 2 }^{ 2 } }{ 6 } +\sum _{ n=1 }^{ 20 }{ \\frac { 2{ (-1) }^{ n }{ 2 }^{ 2 }cos(\\frac { n\pi x }{ 2 } ) }{ { \pi }^{ 2 }{ n }^{ 2 } } } $").scale(0.3).shift(4.5*RIGHT+1.5*UP), - # ] - # result2a=self.returnPartResult(2,1) - # result2b=self.returnPartResult(2,4) - # result2c=self.returnPartResult(2,10) - # result2d=self.returnPartResult(2,20) - # self.play(ReplacementTransform(partFunction2,result2a),ReplacementTransform(coeffResult[0],coeffResult[1])) - # self.play(ReplacementTransform(result2a,result2b),ReplacementTransform(coeffResult[0],coeffResult[1])) - # self.play(ReplacementTransform(result2b,result2c),ReplacementTransform(coeffResult[0],coeffResult[1])) - # self.play(ReplacementTransform(result2c,result2d),ReplacementTransform(coeffResult[0],coeffResult[1])) - # self.wait(0.5) - - - self.wait(2)
\ No newline at end of file + self.wait(2) |