diff --git a/fossee-animations/AnalyticFunctions.py b/fossee-animations/AnalyticFunctions.py new file mode 100644 index 0000000..4ca829a --- /dev/null +++ b/fossee-animations/AnalyticFunctions.py @@ -0,0 +1,339 @@ +from manimlib.imports import * +import numpy as np + +class intro(Scene): + def construct(self): + t1=TextMobject("A","property") + t1.set_color_by_tex_to_color_map({"property":GREEN}) + t2=TextMobject("of") + t3=TextMobject("Analytic","functions") + t3.set_color_by_tex_to_color_map({"Analytic":RED}) + t1.shift(UP) + t1.scale(1.5) + t3.shift(DOWN) + t3.scale(1.7) + + self.play(Write(t1)) + self.play(Write(t2)) + self.play(Write(t3)) + self.wait(2) + +class definition(Scene): + def construct(self): + t1=TextMobject("Theorem:") + t1.set_color(GREEN) + t1.to_edge(UP+LEFT) + t2=TextMobject("If f is") + t2.next_to(t1,DOWN,buff=0.5) + t3=TextMobject("analytic") + t3.set_color(RED) + t3_dup=TextMobject("analytic") + t3.next_to(t2,RIGHT,buff=0.3) + t3_dup.next_to(t2,RIGHT,buff=0.3) + t4=TextMobject("on a domain D, and if $f'(x) $=0 $\\forall$ z $\\in$ D, then") + t4.next_to(t3,RIGHT,buff=0.3) + t5=TextMobject("f is constant in D") + t5.next_to(t2,DOWN,buff=0.3) + t5.shift(1.3*RIGHT) + r=Rectangle(height=2,width=26,fill_color=BLUE,fill_opacity=0.7,color=BLUE) + r.shift(5*LEFT+DOWN*0.8) + self.play(FadeIn(t1)) + self.play(Write(t2)) + self.play(Write(t3)) + self.play(Write(t4)) + self.play(Write(t5)) + self.wait(2) + self.play(ReplacementTransform(t3_dup,r)) + self.wait(1) + t6a=TextMobject("f is said to be analytic in D if and only if u(x,y) and v(x,y) have continuous first partial derivatives on D and $u{ _{ x } }=v{ _{ y } }$ and $u{ _{ y } }= -v{ _{ x } }$ where f(z)=u(x,y)+iv(x,y)") + #t6b=TextMobject() + t6a.scale(0.7) + t6a.set_color(WHITE) + t6a.shift(DOWN*0.7) + self.add(t6a) + self.wait(4) + +class connection1(Scene): + def construct(self): + t1=TextMobject("Let's","analyse","this") + factorial=TextMobject("!") + factorial.scale(2.5) + factorial.next_to(t1,RIGHT,buff=0.6) + factorial.set_color(GREEN) + t1.set_color_by_tex_to_color_map({"analyse":BLUE}) + self.play(Write(t1)) + self.play(Write(factorial)) + self.wait(2) + +class pictorial(Scene): + def construct(self): + t1=TextMobject("Consider some domain, D") + img = ImageMobject('amoeba.png') + img.scale(4) + img.shift(LEFT*3) + self.play(Write(t1)) + self.wait(1) + self.play(FadeOut(t1)) + self.play(ShowCreation(img)) + t2=TextMobject("Now consider some disc, $B_{ r }(a)$ inside D") + t2.scale(0.7) + t3=TextMobject("which represents a set of complex numbers,") + t3.scale(0.7) + number=TextMobject("$|z-z_{ 0 }|\\le r$") + number.scale(1.5) + t2.shift(3.5*RIGHT+2*UP) + t3.shift(3.5*RIGHT+2*UP) + number.shift(4*RIGHT+2*UP) + self.play(Write(t2)) + self.wait(1.5) + self.play(ReplacementTransform(t2,t3)) + self.wait(1.5) + self.play(ReplacementTransform(t3,number)) + self.wait(2) + center=Dot(color=BLACK,radius=0.03) + center.shift(2.5*LEFT) + line=DashedLine(start=LEFT*2.5,end=LEFT*2.1,color=BLACK) + line.scale(0.7) + r=TextMobject("r") + r.scale(0.4) + r.shift(LEFT*2.3+UP*0.1) + c1=Circle(radius=0.4,fill_color=PURPLE_E,fill_opacity=0.7,color=PURPLE_E) + c2=Circle(radius=1.7,fill_color=PURPLE_E,fill_opacity=0.7,color=PURPLE_E) + c2.shift(3*RIGHT) + c1.shift(2.5*LEFT) + self.play(ReplacementTransform(number,c1)) + self.play(Write(center),ShowCreation(line)) + self.play(Write(r)) + self.wait(2) + + self.play(FadeOut(line),FadeOut(center),FadeOut(r)) + an=TextMobject("a") + an.scale(0.5) + an.shift(2.8*RIGHT) + self.play(ReplacementTransform(c1,c2)) + center.move_to(3*RIGHT) + self.add(center) + self.play(Write(an)) + self.wait(1.2) + + t4=TextMobject("Let c $\\in B_{ r }(a)$") + t4.shift(2.5*DOWN+3.3*RIGHT) + t4.scale(0.7) + self.play(Write(t4)) + self.wait(0.2) + c=Dot(radius=0.03,color=BLACK) + c.shift(3.9*RIGHT+UP) + cn=TextMobject("c") + cn.scale(0.5) + cn.shift(RIGHT*3.9+UP*1.2) + self.play(Write(c)) + self.play(Write(cn)) + self.wait(1) + + t5=TextMobject("Now pick a point b $\\in B_{ r }(a)$ as shown") + t5.shift(2.5*DOWN+3.3*RIGHT) + t5.scale(0.7) + b=Dot(radius=0.03,color=BLACK) + b.shift(3.9*RIGHT) + bn=TextMobject("b") + bn.scale(0.5) + bn.shift(RIGHT*3.9+DOWN*0.2) + + self.play(ReplacementTransform(t4,t5)) + self.play(Write(b)) + self.play(Write(bn)) + self.wait(1) + + dl1=DashedLine(start=RIGHT*3,end=RIGHT*3.9,color=BLACK) + dl2=DashedLine(start=RIGHT*3.9,end=RIGHT*3.9+UP,color=BLACK) + self.play(Write(dl1),Write(dl2)) + self.wait(0.5) + + t6=TextMobject("Since given $\grave { f\left( z \\right) } $=0,") + t7=TextMobject("$u_{ x }=u_{ y }=v_{ x }=v_{ y }$=0") + t8=TextMobject("$u_{ y }=v_{ y }=0$ implies u(b)=u(c) and v(b)=v(c)") + t9=TextMobject("and $u_{ x }=v_{ x }=0$ implies u(a)=u(b) and v(a)=v(b)") + t9a=TextMobject("(i.e. a,b,c are coincident)") + t6.scale(0.7) + t7.scale(0.7) + t8.scale(0.7) + t9.scale(0.7) + t9a.scale(0.7) + t6.shift(2.5*DOWN+3.3*RIGHT) + t7.shift(2.5*DOWN+3.3*RIGHT) + t8.shift(2.5*DOWN+3.3*RIGHT) + t9.shift(2.5*DOWN+3.3*RIGHT) + t9a.shift(2.3*UP+3.3*RIGHT) + self.play(ReplacementTransform(t5,t6)) + self.wait(1.5) + self.play(ReplacementTransform(t6,t7)) + self.wait(1.5) + self.play(ReplacementTransform(t7,t8)) + self.wait(1.5) + self.play(FadeOut(dl2)) + self.play(ApplyMethod(c.shift,DOWN),ApplyMethod(cn.shift,DOWN)) + self.wait(1) + self.play(ReplacementTransform(t8,t9)) + self.play(FadeOut(dl1)) + self.play(ApplyMethod(b.shift,LEFT*0.9),ApplyMethod(c.shift,LEFT*0.9),ApplyMethod(bn.shift,LEFT*0.9),ApplyMethod(cn.shift,LEFT*0.9)) + self.wait(1) + self.play(Write(t9a)) + self.wait(1.4) + + self.play(FadeOut(t9a)) + t10=TextMobject("Since c was an arbitrary point in $B_{ r }(a)$") + t11=TextMobject("Thus u and v are constant in $B_{ r }(a)$") + t12=TextMobject("$\\therefore $ f is constant in $B_{ r }(a)$") + t10.scale(0.7) + t11.scale(0.7) + t12.scale(0.7) + t10.shift(2.5*DOWN+3.3*RIGHT) + t11.shift(2.5*DOWN+3.3*RIGHT) + t12.shift(2.5*DOWN+3.3*RIGHT) + self.play(ReplacementTransform(t9,t10)) + self.wait(1.5) + self.play(ReplacementTransform(t10,t11)) + self.wait(1.5) + self.play(ReplacementTransform(t11,t12)) + self.wait(2) + self.play(FadeOut(t12),FadeOut(center),FadeOut(an),FadeOut(c),FadeOut(cn),FadeOut(b),FadeOut(bn)) + self.wait(0.4) + c1=Circle(radius=0.4,fill_color=PURPLE_E,fill_opacity=0.7,color=PURPLE_E) + c1.shift(2.5*LEFT) + self.play(ReplacementTransform(c2,c1)) + self.wait(1) + + t13=TextMobject("Now let b $\\notin B_{ r }(a)$ and be an arbitrary point in D") + t13.scale(0.7) + t13.shift(2*UP+3.3*RIGHT) + c3=Circle(radius=0.4,fill_color=GREEN_E,fill_opacity=0.7,color=GREEN_E) + c3.shift(2*LEFT+UP) + a=Dot(color=BLACK,radius=0.03) + an=TextMobject("a") + b=Dot(color=BLACK,radius=0.03) + bn=TextMobject("b") + an.scale(0.4) + bn.scale(0.4) + a.shift(3.5*LEFT+DOWN) + an.shift(3.5*LEFT+DOWN*0.8) + b.shift(2*LEFT+UP) + bn.shift(2*LEFT+1.2*UP) + self.play(Write(t13)) + self.play(ApplyMethod(c1.shift,LEFT+DOWN)) + self.play(Write(a),Write(an)) + self.play(Write(c3)) + self.play(Write(b),Write(bn)) + self.wait(1.4) + + t14=TextMobject("Since D is connected, $\\exists$ some curve connecting a and b") + t14.scale(0.7) + t14.shift(2*UP+2.9*RIGHT) + arc=ArcBetweenPoints(start=3.5*LEFT+DOWN,end=2*LEFT+UP,angle=TAU/6,color=DARK_BROWN) + self.play(ReplacementTransform(t13,t14)) + self.wait(0.5) + self.play(ShowCreation(arc)) + self.wait(1.5) + + t15=TextMobject("$\\therefore$ we can draw discs along the same curve") + t15.scale(0.7) + t15.shift(2*UP+3.1*RIGHT) + circles=[0,0,0,0] + circles_dup=[0,0,0,0] + circles[0]=Circle(radius=0.34,color=BLUE) + circles[1]=Circle(radius=0.24,color=YELLOW) + circles[2]=Circle(radius=0.3,color=GREEN) + circles[3]=Circle(radius=0.35,color=RED) + circles[0].shift(2.9*LEFT+0.7*DOWN) + circles[1].shift(2.65*LEFT+0.3*DOWN) + circles[2].shift(2.3*LEFT) + circles[3].shift(2*LEFT+0.4*UP) + + c1_dup=Circle(radius=0.4,color=WHITE) + c1_dup.shift(3.5*LEFT+DOWN) + circles_dup[0]=Circle(radius=0.34,color=WHITE) + circles_dup[1]=Circle(radius=0.24,color=WHITE) + circles_dup[2]=Circle(radius=0.3,color=WHITE) + circles_dup[3]=Circle(radius=0.35,color=WHITE) + circles_dup[0].shift(2.9*LEFT+0.7*DOWN) + circles_dup[1].shift(2.65*LEFT+0.3*DOWN) + circles_dup[2].shift(2.3*LEFT) + circles_dup[3].shift(2*LEFT+0.4*UP) + c3_dup=Circle(radius=0.4,color=WHITE) + c3_dup.shift(2*LEFT+UP) + + self.play(ReplacementTransform(t14,t15)) + self.play(Write(circles[0])) + self.play(Write(circles[1])) + self.play(Write(circles[2])) + self.play(Write(circles[3])) + self.wait(1) + + t16=TextMobject("Since f is constant in the disc") + t17=TextMobject("around the point 'a', similarly f should be constant") + t18=TextMobject("in it's neighbouring disk and so on.") + #t19=TextMobject("Since the two disks overlap, the two constants must be equal.Similarly if we continue,we reach disc b. $\\therefore$ we get f(a)=f(b).Thus f is constant in D") + t19=TextMobject("Since the two discs overlap,") + t20=TextMobject("the two constants must be equal") + t21=TextMobject("Similarly if we continue,we reach disc b") + t22=TextMobject("$\\therefore$ we get f(a)=f(b)") + t23=TextMobject("Thus f is constant in D") + t16.scale(0.7) + t17.scale(0.7) + t18.scale(0.7) + t19.scale(0.7) + t20.scale(0.7) + t21.scale(0.7) + t22.scale(0.7) + t23.scale(0.7) + t16.shift(2*UP+3.15*RIGHT) + t17.next_to(t16,DOWN,buff=0.3) + t18.next_to(t17,DOWN,buff=0.3) + g1=VGroup(t16,t17,t18) + g2=VGroup(t19,t20,t21) + self.play(ReplacementTransform(t15,t16)) + self.play(Write(t17)) + self.play(Write(t18)) + self.wait(1.4) + + self.play(FadeOut(g1)) + t19.shift(2*UP+3.15*RIGHT) + self.play(Write(t19),FadeIn(c1_dup),FadeIn(circles_dup[0])) + t20.next_to(t19,DOWN,buff=0.3) + self.play(Write(t20)) + t21.next_to(t20,DOWN,buff=0.3) + self.play(FadeOut(c1_dup),FadeOut(circles_dup[0])) + self.play(Write(t21)) + self.play(FadeIn(c1_dup)) + self.play(FadeIn(circles_dup[0])) + self.play(FadeIn(circles_dup[1])) + self.play(FadeIn(circles_dup[2])) + self.play(FadeIn(circles_dup[3])) + self.play(FadeIn(c3_dup)) + self.wait(0.7) + self.play(FadeOut(circles_dup[0]),FadeOut(circles_dup[1]),FadeOut(circles_dup[2]),FadeOut(circles_dup[3])) + self.wait(1.4) + + self.play(FadeOut(g2),FadeOut(c1_dup),FadeOut(c3_dup)) + t22.shift(2*UP+3.15*RIGHT) + self.play(Write(t22)) + self.wait(1) + t23.shift(2*UP+3.15*RIGHT) + t23.scale(1.3) + self.play(ReplacementTransform(t22,t23)) + self.wait(1) + + self.play(FadeOut(circles[0]),FadeOut(circles[1]),FadeOut(circles[2]),FadeOut(circles[3])) + self.play(FadeOut(arc)) + self.play(ApplyMethod(c3.shift,1.5*LEFT+2*DOWN),ApplyMethod(bn.shift,1.35*LEFT+1.95*DOWN),ApplyMethod(b.shift,1.5*LEFT+2*DOWN)) + self.wait(2) + +class conclusion(Scene): + def construct(self): + t1=TextMobject("Hence the","property","is","satisfied") + t2=TextMobject("$\\forall$ z $\\in$ D") + t1.shift(UP) + t2.next_to(t1,DOWN,buff=0.4) + t1.set_color_by_tex_to_color_map({"property":BLUE,"satisfied":YELLOW}) + self.play(Write(t1)) + self.play(Write(t2)) + self.wait(3) \ No newline at end of file diff --git a/fossee-animations/CauchySequence.py b/fossee-animations/CauchySequence.py new file mode 100644 index 0000000..0e23030 --- /dev/null +++ b/fossee-animations/CauchySequence.py @@ -0,0 +1,327 @@ +from manimlib.imports import * +import numpy as np + +def intro_text(): + return TextMobject("Cauchy") + +class intro(Scene): + def construct(self): + text=intro_text() + text1=TextMobject("Sequence") + text1.scale(1) + text.set_color_by_tex_to_color_map({"Cauchy": BLUE}) + text.scale(4) + text.move_to(1*UP+1*LEFT) + + self.play(Write(text)) + self.play(FadeIn(text1)) + self.wait(1) + + self.play(ApplyMethod(text.shift,1.5*UP),ApplyMethod(text1.shift,2.3*UP+3.2*RIGHT)) + self.wait(1) + + text2=TextMobject("what does","it","mean") + question=TextMobject("?") + text2.set_color_by_tex_to_color_map({"it":GREEN}) + text2.shift(0.5*LEFT) + text2.scale(1.5) + question.scale(4) + question.next_to(text2,RIGHT,buff=0.6) + + self.play(Write(text2)) + self.play(ShowCreation(question)) + self.wait(0.5) + + self.play(ApplyMethod(question.scale,-1)) + self.wait(1) + + text3=TextMobject("Here goes the formal definition..") + self.play(FadeOut(question)) + self.play(ReplacementTransform(text2,text3)) + self.wait(3) + +class definition(Scene): + def construct(self): + definition_text_1=TextMobject("A sequence, $(x_n)$ is said to be a" ,"Cauchy", "Sequence if ","for all", "$\\epsilon > 0$") + definition_text_2=TextMobject("$\\exists$ \\ K($\\epsilon$) such that ","for all m,n $\geq$ $ K(\\epsilon)$,","$|x_m-x_n|<\\epsilon$") + definition_text_1.shift(UP) + definition_text_1.set_color_by_tex_to_color_map({"Cauchy": YELLOW,"$\\epsilon > 0$": BLUE,"for all":RED}) + definition_text_2.set_color_by_tex_to_color_map({"$|x_m-x_n|<\\epsilon$": YELLOW," \\ K($\\epsilon$) ":BLUE,"for all m,n $\geq$ $ K(\\epsilon)$,":BLUE}) + + self.play(Write(definition_text_1)) + self.play(Write(definition_text_2)) + #self.play(Applymethod()) + self.wait(5.5) + +class to_graph(Scene): + def construct(self): + t1=TextMobject("Let us understand it", "graphically") + t1.scale(1.8) + t2=TextMobject("Consider the following graph of sequence") + t3=TextMobject("$X_n = (20 \\frac{(-1)^n}{n}) + 4$") + t3.set_color_by_tex_to_color_map({"$X_n = (20 \\frac{(-1)^n}{n}) + 4$":GREEN}) + t1.set_color_by_tex_to_color_map({"graphically": YELLOW}) + + self.play(Write(t1)) + self.wait(2) + self.play(ApplyMethod(t1.shift,2.3*UP)) + self.play(Write(t2)) + self.wait(1) + self.play(ReplacementTransform(t2,t3)) + self.wait(3) + +class graph(GraphScene): + CONFIG = { + "x_min": -2.5, + "x_max": 35, + "y_min": -10, + "y_max": 10, + "graph_origin": ORIGIN+4*LEFT, + "function_color": RED, + "axes_color": GREEN, + "x_axis_label": "$n$", + "y_axis_label": "$x_n$", + "exclude_zero_label": True, + "x_labeled_nums": range(0, 36, 5), + "y_labeled_nums": range(-10,11,2) + } + def construct(self): + t3=TextMobject("$X_n = (20 \\frac{(-1)^n}{n}) + 4$") + t3.scale(0.7) + t3.to_edge(UP+RIGHT) + t3.set_color(RED) + self.add(t3) + self.setup_axes(animate=True) + self.wait(1) + + mathfunc = lambda x: 20*((-1)**x)/x + 4 + + points = [ Dot(color = RED, radius = 0.03) for dot in range(1,34) ] + + x_each_unit = self.x_axis_width / (self.x_max - self.x_min) + y_each_unit = self.y_axis_height / (self.y_max - self.y_min) + [points[counter].shift(self.graph_origin + counter * (RIGHT * x_each_unit) + mathfunc(counter) * (UP * y_each_unit)) for counter in range(1, len(points))] + for i in range(1,len(points)): + self.add(points[i]) + self.wait(0.15) + self.wait(2) + + limit=4 + epsilon=2 + + limit_line=DashedLine(start=self.graph_origin,end=4.2*RIGHT,color=BLUE) + limit_line.shift(y_each_unit*limit*UP) + + self.play(Write(limit_line)) + self.wait(2) + + intro_arrow=TextMobject("Since" ,"$\\epsilon$"," value is","arbitary") + intro_arrow.shift(2.8*UP) + intro_arrow.set_color_by_tex_to_color_map({"arbitary":YELLOW,"$\\epsilon$":YELLOW}) + intro_arrow.scale(0.8) + self.play(Write(intro_arrow)) + self.wait(2) + arrow_text=TextMobject("Let epsilon $=$ 3") + arrow_text.scale(0.8) + arrow_text.shift(2.8*UP) + self.play(ReplacementTransform(intro_arrow,arrow_text)) + self.wait(1) + + epsilon_line=Line(start=(4-(20/7))*y_each_unit*UP,end=4*UP*y_each_unit) + epsilon_line.shift(self.graph_origin+x_each_unit*RIGHT*7) + self.play(Write(epsilon_line)) + self.wait(2) + + text=TextMobject("$\\epsilon=3$") + text.shift(self.graph_origin+RIGHT*5*x_each_unit+UP*3*y_each_unit) + text.scale(0.7) + self.play(Write(text),FadeOut(arrow_text)) + + arrow_text1=TextMobject("Now according to definition,","$\\exists K(\\epsilon)$") + arrow_text1.shift(2.8*UP+0.2*RIGHT) + arrow_text1.set_color_by_tex_to_color_map({"$\\exists K(\\epsilon)$":BLUE}) + arrow_text1.scale(0.8) + + self.play(Write(arrow_text1)) + self.wait(1) + point=Dot(color=BLUE,radius=0.06) + point.shift(self.graph_origin+RIGHT*7*x_each_unit) + self.add(point) + point_text=TextMobject("K($\\epsilon$)") + point_text.scale(0.7) + point_text.shift(self.graph_origin+RIGHT*7.2*x_each_unit+y_each_unit*1.4*DOWN) + self.play(FadeIn(point_text)) + self.wait(1.5) + + arrow_text2=TextMobject("such that" ,"$\\forall$ natural numbers") + arrow_text2.set_color_by_tex_to_color_map({"$\\forall$ natural numbers":YELLOW}) + arrow_text2a=TextMobject("m,n $\geq$ K($\\epsilon$)") + arrow_text2a.set_color(BLUE) + arrow_text2.scale(0.8) + arrow_text2a.scale(0.8) + arrow_text2.shift(2.8*UP+0.3*RIGHT) + arrow_text2a.shift(2.2*UP+0.3*RIGHT) + arrow_group=VGroup(arrow_text2,arrow_text2a) + self.play(ReplacementTransform(arrow_text1,arrow_group)) + self.wait(2) + + m_and_n_points=[Dot(color=WHITE, radius=0.05) for point in range(1,29)] + [m_and_n_points[i].shift(self.graph_origin+RIGHT*8*x_each_unit+RIGHT*i*x_each_unit) for i in range(0,28)] + for j in range(0,28): + self.add(m_and_n_points[j]) + self.wait(0.1) + + #here show all m,n by zoming out + self.wait(2) + + text1=TextMobject("(Consider any two points)") + text1.shift(2*DOWN+RIGHT) + self.play(Write(text1)) + self.wait(1) + self.play(FadeOut(text1)) + for k in range(28): + self.remove(m_and_n_points[k]) + + self.wait(1) + + pointm1=Dot(color=BLUE,radius=0.05) + pointm1.shift(self.graph_origin + 9*RIGHT*x_each_unit) + pointn1=Dot(color=BLUE,radius=0.05) + pointn1.shift(self.graph_origin + 11*RIGHT*x_each_unit) + self.play(Write(pointm1),Write(pointn1)) + + m=TextMobject("m") + m.shift(self.graph_origin+9*x_each_unit*RIGHT+y_each_unit*DOWN*0.7) + m.set_color(RED) + m.scale(0.4) + self.play(Write(m)) + + n=TextMobject("n") + n.shift(self.graph_origin+11*x_each_unit*RIGHT+y_each_unit*DOWN*0.7) + n.set_color(RED) + n.scale(0.4) + self.play(Write(n)) + + self.wait(1) + + self.play(ApplyMethod(pointm1.move_to,self.graph_origin + 9*RIGHT*x_each_unit + (4-(20/9))*UP*y_each_unit),ApplyMethod(pointn1.move_to,self.graph_origin + 11*RIGHT*x_each_unit + (4-(20/11))*UP*y_each_unit)) + self.wait(1) + + arrow_text3=TextMobject("$|X_m-X_n| < \\epsilon$") + arrow_text3.set_color_by_tex_to_color_map({"$|X_m-X_n| < \\epsilon$":YELLOW}) + arrow_text3.shift(2.8*UP+0.3*RIGHT) + self.play(ReplacementTransform(arrow_group,arrow_text3)) + self.wait(2) + + upline=Line(start=(4-20/9)*UP*y_each_unit,end=(4-20/11)*UP*y_each_unit) + upline.shift(self.graph_origin+9*RIGHT*x_each_unit) + leftline=Line(start=11*RIGHT*x_each_unit,end=9*RIGHT*x_each_unit) + leftline.shift(self.graph_origin+(4-20/11)*UP*y_each_unit) + self.play(Write(leftline)) + self.wait(0.4) + self.play(Write(upline)) + + self.wait(2) + self.play(ApplyMethod(epsilon_line.move_to,self.graph_origin+6*DOWN*y_each_unit+7*RIGHT*x_each_unit),ApplyMethod(upline.move_to,self.graph_origin+6*DOWN*y_each_unit+12*RIGHT*x_each_unit)) + + self.play(FadeOut(text),FadeOut(leftline),FadeOut(pointm1),FadeOut(pointn1),FadeOut(m),FadeOut(n)) + self.wait(1) + x1=TextMobject("$\\epsilon$") + x2=TextMobject("$|X_m-X_n|$") + x1.shift(self.graph_origin+7*RIGHT*x_each_unit+9*DOWN*y_each_unit) + x1.scale(0.8) + x2.shift(self.graph_origin+14*RIGHT*x_each_unit+9*DOWN*y_each_unit) + x2.scale(0.5) + + self.play(FadeIn(x1),FadeIn(x2)) + self.wait(1) + greater=TextMobject("$>$") + greater.shift(self.graph_origin+10*RIGHT*x_each_unit+6*DOWN*y_each_unit) + self.add(greater) + self.wait(1) + greater1=TextMobject("$>$") + greater1.scale(0.5) + greater1.shift(self.graph_origin+10*RIGHT*x_each_unit+9*DOWN*y_each_unit) + self.add(greater1) + self.wait(2.8) + self.play(FadeOut(x1),FadeOut(x2),FadeOut(greater1)) + self.play(FadeOut(greater),FadeOut(upline)) + self.wait(0.4) + + self.play(ApplyMethod(epsilon_line.move_to,self.graph_origin+(2.5)*UP*y_each_unit+7*RIGHT*x_each_unit)) + + self.wait(1.9) + + + +class conclusion(Scene): + def construct(self): + endformula=TextMobject("$|X_m-X_n|<\\epsilon$") + endformula.set_color_by_tex_to_color_map({"$|X_m-X_n|<\\epsilon$":YELLOW}) + endformula.shift(2.8*UP+0.3*RIGHT) + self.add(endformula) + self.wait(1) + + self.play(ApplyMethod(endformula.move_to,1.5*UP)) + self.wait(1.3) + endtext=TextMobject("Similarlly","the condition is true","$\\forall$ natural numbers","m,n$\geq$$K(\\epsilon)$") + endtext.set_color_by_tex_to_color_map({"it is true":YELLOW,"$\\forall$ natural numbers":BLUE}) + self.play(Write(endtext)) + self.wait(2.7) + + +class conclusion_final(Scene): + def construct(self): + final1=TextMobject("Since the","equation","satisfies the","condition") + final1.set_color_by_tex_to_color_map({"equation":YELLOW,"condition":BLUE}) + final1.shift(UP) + final2=TextMobject("$|X_m-X_n|<\\epsilon$") + final2.set_color(RED) + final2.scale(1.5) + final3=TextMobject("$\\forall \\epsilon>0$"," and ","$\\forall$ m,n$\geq$$K(\\epsilon)$") + final3.set_color_by_tex_to_color_map({"$\\forall \\epsilon>0$":BLUE,"$\\forall$ m,n$\geq$$K(\\epsilon)$":BLUE}) + final3.shift(DOWN) + + self.play(Write(final1)) + self.wait(1) + self.play(FadeIn(final2)) + self.wait(0.6) + self.play(Write(final3)) + + self.wait(3.5) + + group1=VGroup(final1,final2,final3) + + t1=TextMobject("That is,","for any","small positive distance","$\\epsilon$") + self.wait(0.5) + t1.set_color_by_tex_to_color_map({"for any":YELLOW,"small positive distance":BLUE}) + self.play(ReplacementTransform(group1,t1)) + self.play(ApplyMethod(t1.move_to,1.5*UP)) + t2=TextMobject("a","finite number","of elements of the sequence are","less than") + t2.set_color_by_tex_to_color_map({"finite number":RED,"less than":YELLOW}) + t2.shift(0.5*UP) + t3=TextMobject("that","given distance","from each other and the elements","become") + t3.set_color_by_tex_to_color_map({"given distance":YELLOW,"become":BLUE}) + t3.shift(0.5*DOWN) + t4=TextMobject("arbitarily close","to each other","as the sequence progresses.") + t4.set_color_by_tex_to_color_map({"arbitarily close":BLUE,"as the sequence progresses.":RED}) + t4.shift(1.5*DOWN) + self.play(Write(t2)) + self.play(Write(t3)) + self.play(Write(t4)) + self.wait(3) + + group3=VGroup(t2,t3,t4) + + group4=VGroup(t1,t2,t3,t4) + + text1=TextMobject("Hence it is called") + text1.shift(UP) + text2=TextMobject("Cauchy","Sequence") + text2.scale(1.7) + text2.set_color_by_tex_to_color_map({"Cauchy":GREEN,"Sequence":RED}) + group2=VGroup(text1,text2) + self.play(ReplacementTransform(group4,group2)) + self.wait(4.5) + + diff --git a/fossee-animations/CompletingSquareMethod.py b/fossee-animations/CompletingSquareMethod.py new file mode 100644 index 0000000..7b75073 --- /dev/null +++ b/fossee-animations/CompletingSquareMethod.py @@ -0,0 +1,231 @@ +from manimlib.imports import * +import numpy as np + +class intro(Scene): + def construct(self): + t1=TextMobject("Completing","Square") + t1.set_color_by_tex_to_color_map({"Completing":RED,"Square":BLUE}) + t2=TextMobject("method") + t1.shift(0.8*UP) + t1.scale(2) + t2.scale(0.8) + t2.shift(3*RIGHT) + + self.play(Write(t1)) + self.play(FadeIn(t2)) + self.wait(1.8) + +class example(Scene): + def construct(self): + t1=TextMobject("Consider an","equation") + t1.set_color_by_tex_to_color_map({"equation":GREEN}) + t1.scale(1.4) + t1.shift(UP) + #t2=TextMobject("$x^{ 2 }+2x=15$") + t2a=TextMobject("$x^{ 2 }$") + t2a.set_color_by_tex_to_color_map({"$x^{ 2 }$":RED}) + t2b=TextMobject("$+$") + t2b.next_to(t2a,RIGHT,buff=0.3) + t2c=TextMobject("2x") + t2c.set_color_by_tex_to_color_map({"2x":GREEN}) + t2c.next_to(t2b,RIGHT,buff=0.3) + t2d=TextMobject("=") + t2d.next_to(t2c,RIGHT,buff=0.3) + t2e=TextMobject("15") + t2e.set_color_by_tex_to_color_map({"15":MAROON_D}) + t2e.next_to(t2d,RIGHT,buff=0.3) + t2=VGroup(t2a,t2b,t2c,t2d,t2e) + t2.scale(1.6) + t2.shift(UP+LEFT) + + t2a_dup=TextMobject("$x^{ 2 }$") + t2a_dup.shift(3*UP+LEFT) + t2b_dup=TextMobject("$+$") + t2b_dup.next_to(t2a_dup,RIGHT,buff=0.3) + t2c_dup1=TextMobject("2x") + t2c_dup1.next_to(t2b_dup,RIGHT,buff=0.3) + t2c_dup2=TextMobject("2x") + t2c_dup2.next_to(t2b_dup,RIGHT,buff=0.3) + t2d_dup=TextMobject("=") + t2d_dup.next_to(t2c_dup1,RIGHT,buff=0.3) + t2e_dup=TextMobject("15") + t2e_dup.next_to(t2d_dup,RIGHT,buff=0.3) + t2_dup=VGroup(t2a_dup,t2b_dup,t2c_dup1,t2c_dup2,t2d_dup,t2e_dup) + t2_dup.scale(1.6) + + self.play(Write(t1)) + self.wait(0.7) + self.play(FadeOut(t1)) + self.wait(0.3) + self.play(Write(t2)) + self.wait(1.4) + + self.play(ApplyMethod(t2.shift,2*UP)) + self.wait(1.5) + + xsquare=Square() + xsquare.shift(3*LEFT+0.8*DOWN) + xsquare.scale(0.75) + xsquare.set_fill(RED,opacity=0.5) + x1=Rectangle(width=0.5,height=1.5) + x1.next_to(xsquare,RIGHT,buff=0.1) + x1.set_fill(GREEN,opacity=0.5) + x2=Rectangle(width=1.5,height=0.5) + x2.next_to(xsquare,UP,buff=0.1) + x2.set_fill(GREEN,opacity=0.5) + oneleft=Square() + oneleft.shift((RIGHT+UP)*1.1+3*LEFT+0.8*DOWN) + oneleft.scale(0.25) + oneleft.set_fill(BLUE,opacity=0.5) + + fifteensquare=Rectangle(width=1.9,height=2) + fifteensquare.shift(0.5*DOWN+2*RIGHT) + fifteensquare.set_fill(MAROON_D,opacity=0.5) + strip=Rectangle(width=0.1,height=2) + strip.next_to(fifteensquare,RIGHT,buff=0.1) + strip.set_fill(BLUE,opacity=0.5) + + self.play(ReplacementTransform(t2a_dup,xsquare)) + self.wait(0.4) + self.play(ReplacementTransform(t2c_dup1,x1),ReplacementTransform(t2c_dup2,x2)) + self.wait(0.4) + self.play(ReplacementTransform(t2e_dup,fifteensquare)) + self.wait(1) + + xtext_d=TextMobject("x") + xtext_u=TextMobject("x") + onetext=TextMobject("1") + fifteentext=TextMobject("15") + xtext_d.scale(0.4) + xtext_u.scale(0.4) + onetext.scale(0.4) + fifteentext.scale(0.4) + xtext_u.shift(3.9*LEFT+0.8*DOWN) + xtext_d.shift(2.9*LEFT+1.85*DOWN) + onetext.shift(1.85*DOWN+1.2*RIGHT+3.1*LEFT) + fifteentext.shift(0.5*DOWN+2*RIGHT) + + self.play(Write(xtext_d),Write(xtext_u),Write(onetext),Write(fifteentext)) + self.wait(2) + + text1=TextMobject("Now to","complete","the square,") + text1.set_color_by_tex_to_color_map({"complete":RED}) + text2=TextMobject("We introduce a","suitable shape","of","suitable size") + text2.set_color_by_tex_to_color_map({"suitable shape":BLUE,"suitable size":YELLOW}) + text3=TextMobject("(1X1 square in this case)") + text4=TextMobject("(a strip of area one unit in this case)") + text1.scale(0.7) + text2.scale(0.7) + text3.scale(0.7) + text4.scale(0.7) + text1.shift(2.8*DOWN) + text2.shift(2.8*DOWN) + text3.shift(2.8*DOWN+2.5*LEFT) + text4.shift(2.8*DOWN+2.7*RIGHT) + tempgroup=VGroup(text3,text4) + + self.play(Write(text1)) + self.wait(1.7) + self.play(ReplacementTransform(text1,text2)) + self.wait(1.7) + self.play(ReplacementTransform(text2,tempgroup)) + self.wait(1.3) + + self.play(FadeIn(oneleft),FadeIn(strip)) + self.wait(1.3) + + leftgroup=VGroup(t2a,t2b,t2c) + plusonetext1=TextMobject("+ 1") + plusonetext2=TextMobject("+ 1") + plusonetext1.scale(1.6) + plusonetext2.scale(1.6) + plusonetext1.shift(3*UP+0.43*RIGHT) + plusonetext2.next_to(t2e,RIGHT,buff=0.3) + + self.play(ApplyMethod(leftgroup.shift,1.15*LEFT)) + self.wait(0.8) + self.play(Write(plusonetext1),Write(plusonetext2)) + self.wait(2) + + leftgroup=VGroup(t2a,t2b,t2c,plusonetext1) + rightgroup=VGroup(t2e,plusonetext2) + completetextleft=TextMobject("$(x+1)^{ 2 }$") + completetextleft.scale(1.6) + completetextright=TextMobject("$4^{ 2 }$") + completetextright.scale(1.6) + completetextleft.next_to(t2d,LEFT,buff=0.4) + completetextright.next_to(t2d,RIGHT,buff=0.4) + + self.play(ReplacementTransform(leftgroup,completetextleft),ReplacementTransform(rightgroup,completetextright)) + self.wait(1.5) + + self.play(FadeOut(xtext_d),FadeOut(xtext_u),FadeOut(onetext)) + self.play(ApplyMethod(x1.shift,0.1*LEFT),ApplyMethod(x2.shift,0.1*DOWN),ApplyMethod(oneleft.shift,0.1*(DOWN+LEFT))) + xsquare.set_fill(GREEN,opacity=0.5) + oneleft.set_fill(GREEN,opacity=0.5) + self.play(ApplyMethod(strip.shift,0.1*LEFT)) + strip.set_fill(MAROON_D,opacity=0.5) + self.wait(0.6) + self.play(FadeOut(fifteentext)) + + finalleft1=TextMobject("(x+1)") + finalleft1.scale(0.42) + finalleft1.shift(0.8*DOWN+4.35*LEFT) + finalleft2=TextMobject("(x+1)") + finalleft2.scale(0.42) + finalleft2.shift(2.9*LEFT+1.85*DOWN) + finalright1=TextMobject("4") + finalright2=TextMobject("4") + finalright1.scale(0.42) + finalright2.scale(0.42) + finalright1.next_to(strip,RIGHT,buff=0.2) + finalright2.next_to(fifteensquare,DOWN,buff=0.2) + + self.play(Write(finalleft1),Write(finalleft2),Write(finalright1),Write(finalright2)) + self.wait(0.4) + + insideleft=TextMobject("$(x+1)^{ 2 }$") + insideright=TextMobject("$4^{ 2 }$") + insideleft.scale(0.7) + insideright.scale(0.7) + insideleft.shift(2.7*LEFT+0.8*DOWN) + insideright.shift(0.5*DOWN+2*RIGHT) + + self.play(FadeIn(insideleft),FadeIn(insideright)) + self.wait(1.75) + + equal=TextMobject("=") + equal.scale(1.6) + equal.next_to(x1,2.3*RIGHT,buff=0.35) + + self.play(Write(equal)) + self.wait(0.5) + + text5=TextMobject("$\\therefore$ the","sides","of both the squares","should be same!") + text5.set_color_by_tex_to_color_map({"sides":RED,"should be same!":GREEN}) + text5.scale(0.7) + text5.shift(2.8*DOWN) + + self.play(FadeOut(tempgroup)) + self.play(Write(text5)) + self.wait(1) + groupleft=VGroup(x1,x2,xsquare,oneleft,insideleft,finalleft1) + groupright=VGroup(fifteensquare,strip,insideright,finalright1) + groupup=VGroup(completetextleft,completetextright,t2d) + + self.play(FadeOut(groupleft),FadeOut(groupright),FadeOut(text5)) + self.play(ApplyMethod(finalleft2.shift,UP),ApplyMethod(finalright2.shift,UP)) + self.play(FadeOut(groupup)) + self.wait(1) + finaltext=TextMobject("Hence x=3 ","!") + finaltext.set_color_by_tex_to_color_map({"!":RED}) + finaltext.scale(1.3) + group=VGroup(equal,finalleft2,finalright2) + self.play(ReplacementTransform(group,finaltext)) + self.wait(0.8) + finaltext1=TextMobject("and x=-5","(if negative values are also considered)") + finaltext1.set_color_by_tex_to_color_map({"(if negative values are also considered)":BLUE}) + finaltext1.scale(0.8) + self.play(ApplyMethod(finaltext.shift,UP)) + self.play(Write(finaltext1)) + self.wait(2) diff --git a/fossee-animations/NichomachusTheorem.py b/fossee-animations/NichomachusTheorem.py new file mode 100644 index 0000000..27e688b --- /dev/null +++ b/fossee-animations/NichomachusTheorem.py @@ -0,0 +1,288 @@ +from manimlib.imports import * +import numpy as np + +class intro(Scene): + def construct(self): + t1=TextMobject("Nichomachus") + t2=TextMobject("Theorem") + t1.scale(3) + t2.scale(0.8) + t1.set_color(GREEN) + t2.set_color(WHITE) + t1.shift(UP+0.8*LEFT) + t2.move_to(0.3*DOWN+1.6*RIGHT) + + self.play(Write(t1)) + self.play(FadeIn(t2)) + self.wait(2) + self.play(FadeOut(t1),FadeOut(t2)) + +class definition(Scene): + def construct(self): + t1=TextMobject("What","does","it","mean") + question=TextMobject("?") + question.set_color(RED) + question.scale(4) + t1.set_color_by_tex_to_color_map({"it":GREEN,"What":YELLOW}) + t1.scale(1.4) + t1.move_to(0.5*LEFT+0.3*UP) + question.next_to(t1,RIGHT,buff=0.6) + self.play(Write(t1)) + self.play(ShowCreation(question)) + self.wait(0.5) + self.play(ApplyMethod(question.scale,-1)) + self.wait(2) + self.play(ApplyMethod(question.scale,-1)) + self.play(ApplyMethod(t1.shift,2.6*UP),ApplyMethod(question.shift,2.6*UP)) + self.wait(1) + + formula1=TextMobject("$(1+2+3+...n)^{ 2 }$") + formula1.shift(1.6*LEFT+0.8*UP) + equal=TextMobject("$=$") + equal.scale(2.7) + equal.set_color(GREEN) + equal.shift(0.2*DOWN+0.3*LEFT) + formula2=TextMobject("$(1)^{ 3 }+(2)^{ 3 }+(3)^{ 3 }+...(n)^{ 3 }$") + formula2.shift(RIGHT+1.2*DOWN) + + self.play(Write(formula1)) + self.play(Write(equal)) + self.play(Write(formula2)) + self.wait(3) + +# class formulaProof(Scene): +# def construct(self): +# t1=TextMobject("Formulated","proof") +# t1.set_color_by_tex_to_color_map({"Formulated":BLUE,"proof":YELLOW}) +# t1.shift(0.7*LEFT+0.3*UP) +# t1.scale(1.7) +# self.play(Write(t1)) +# self.wait(1) +# self.play(ApplyMethod(t1.shift,2.5*UP)) +# self.wait(2) + +# f1=TextMobject("$(\\sum { n } )^{ 2 }$") +# equal1=TextMobject("$=$") +# equal2=TextMobject("$=$") +# equal3=TextMobject("$=$") +# equal1.set_color(GREEN) +# equal2.set_color(GREEN) +# equal3.set_color(GREEN) +# f2=TextMobject("$((n(n+1))/2)^{ 2 }$") +# f3=TextMobject("$(n^{ 2 }(n+1)^{ 2 })/4$") +# f4=TextMobject("$\\sum { n^{ 3 } }$") +# f1.shift(UP+LEFT) +# equal1.shift(0.1*UP+LEFT) +# equal1.scale(2) +# f2.shift(2.6*LEFT+0.8*DOWN) +# equal2.next_to(f2,RIGHT,buff=0.6) +# f3.next_to(equal2,RIGHT,buff=0.6) +# equal3.shift(1.7*DOWN+LEFT) +# equal3.scale(2) +# f4.shift(2.6*DOWN+LEFT) +# self.play(FadeIn(f1)) +# self.play(Write(equal1)) +# self.play(Write(f2)) +# self.play(Write(equal2)) +# self.play(Write(f3)) +# self.play(Write(equal3)) +# self.play(FadeIn(f4)) +# self.wait(2) + +class connection1(Scene): + def construct(self): + t1=TextMobject("Let's understand it","pictorially","..") + factorial=TextMobject("!") + t1.set_color_by_tex_to_color_map({"pictorially":YELLOW}) + t1.scale(1.5) + factorial.scale(2.3) + factorial.next_to(t1,RIGHT,buff=0.6) + factorial.set_color(GREEN) + + self.play(Write(t1)) + self.play(Write(factorial)) + self.wait(2) + +class pictorialProof(Scene): + def construct(self): + t1=TextMobject("Pictorial","representation") + t1.set_color_by_tex_to_color_map({"Pictorial":BLUE,"representation":YELLOW}) + t1.shift(0.6*LEFT+0.3*UP) + t1.scale(1.7) + + self.play(Write(t1)) + self.wait(2) + # self.play(FadeOut(t1)) + # self.wait(1) + self.play(ApplyMethod(t1.move_to,0.6*LEFT+2.5*UP)) + self.wait(1) + t2=TextMobject("Let's consider an example..") + t2.scale(1.3) + t2.shift(0.7*LEFT+0.3*UP) + t=TextMobject("Let n=3") + t.scale(1.6) + t.shift(0.7*LEFT+0.3*UP) + + self.play(Write(t2)) + self.wait(1.5) + + self.play(Transform(t2,t)) + self.wait(2) + + self.play(FadeOut(t2),FadeOut(t1)) + self.wait(1) + + t3=TextMobject("Consider n=3") + t3.to_edge(UP+RIGHT) + t3.set_color(RED) + self.add(t3) + + sq=[[Square() for i in range(7)] for j in range(7)] + for i in range(7): + for j in range(7): + sq[i][j].scale(0.25) + if(i==0 and j==0): + sq[i][j].shift(2*LEFT+3.3*UP) + #self.play(Write(sq[i][j])) + #sq[i][j].shift(j*RIGHT) + #sq[i][j].shift(i*DOWN) + sq[5][0].set_fill(RED, opacity=0.5) + for j in range(2): + for i in range(3-j): + sq[3+j][i].set_fill(BLUE,opacity=0.5) + sq[i+3+j][2-j].set_fill(BLUE,opacity=0.5) + + for i in range(6): + if(i<3): + for j in range(6): + sq[i][j].set_fill(GREEN,opacity=0.5) + else: + for j in range(3): + sq[i][j+3].set_fill(GREEN,opacity=0.5) + + for j in range(6): + for i in range(6): + sq[j][i+1].next_to(sq[j][i],RIGHT,buff=0.01) + sq[j+1][0].next_to(sq[j][0],DOWN,buff=0.01) + + self.play(Write(sq[0][0]),Write(sq[0][1]),Write(sq[0][2]),Write(sq[0][3]),Write(sq[0][4]),Write(sq[0][5]), + Write(sq[1][0]),Write(sq[1][1]),Write(sq[1][2]),Write(sq[1][3]),Write(sq[1][4]),Write(sq[1][5]), + Write(sq[2][0]),Write(sq[2][1]),Write(sq[2][2]),Write(sq[2][3]),Write(sq[2][4]),Write(sq[2][5]), + Write(sq[3][0]),Write(sq[3][1]),Write(sq[3][2]),Write(sq[3][3]),Write(sq[3][4]),Write(sq[3][5]), + Write(sq[4][0]),Write(sq[4][1]),Write(sq[4][2]),Write(sq[4][3]),Write(sq[4][4]),Write(sq[4][5]), + Write(sq[5][0]),Write(sq[5][1]),Write(sq[5][2]),Write(sq[5][3]),Write(sq[5][4]),Write(sq[5][5])) + + t4=TextMobject("(Here each box is a square of length one unit)") + t4.shift(2*DOWN+0.6*LEFT) + t4.set_color(RED) + self.play(Write(t4)) + self.wait(1.5) + self.play(FadeOut(t4)) + self.wait(1.5) + + t5a=TextMobject("Area : ") + t5b=TextMobject("$(6)^{ 2 }$") + t5c=TextMobject("$(1+2+3)^{ 2 }$") + t5a.shift(2*UP+2.5*RIGHT) + t5b.next_to(t5a,RIGHT,buff=0.5) + t5c.next_to(t5a,RIGHT,buff=0.5) + + self.play(Write(t5a)) + self.play(Write(t5b)) + self.wait(1.5) + self.play(Transform(t5b,t5c)) + self.wait(2) + + t5=VGroup(t5a,t5c) + + plus1=TextMobject("+") + plus2=TextMobject("+") + plus1.scale(2) + plus2.scale(2) + plus1.shift(2.1*DOWN+3.7*LEFT) + plus2.shift(2.1*DOWN+1.8*RIGHT) + + self.play(ApplyMethod(sq[5][0].move_to,1.8*DOWN+6*LEFT)) + + two=VGroup(sq[3][0],sq[3][1],sq[3][2],sq[4][0],sq[4][1],sq[4][2],sq[5][1],sq[5][2]) + self.play(ApplyMethod(two.move_to,1.8*DOWN+LEFT)) + + three=VGroup(sq[0][0],sq[0][1],sq[0][2],sq[0][3],sq[0][4],sq[0][5], + sq[1][0],sq[1][1],sq[1][2],sq[1][3],sq[1][4],sq[1][5], + sq[2][0],sq[2][1],sq[2][2],sq[2][3],sq[2][4],sq[2][5], + sq[3][3],sq[3][4],sq[3][5],sq[4][3],sq[4][4],sq[4][5], + sq[5][3],sq[5][4],sq[5][5]) + self.play(ApplyMethod(three.move_to,1.8*DOWN+5*RIGHT)) + self.wait(0.3) + + self.play(Write(plus1),Write(plus2)) + self.wait(1.8) + + self.play(FadeOut(t5a)) + self.play(ApplyMethod(t5b.shift,6*LEFT+0.8*UP)) + self.wait(1.5) + + vad=VGroup(sq[5][1],sq[5][2]) + vas=VGroup(sq[3][0],sq[4][0]) + vad.rotate(PI/2) + + self.play(ApplyMethod(vas.shift,0.1*LEFT)) + self.play(ApplyMethod(vad.shift,3*UP/4+5*LEFT/4+0.1*LEFT+0.02*UP)) + self.wait(1) + + #self.play(ApplyMethod(sq[3][1].shift,0.1*RIGHT),ApplyMethod(sq[3][2].shift,0.1*RIGHT),ApplyMethod(sq[4][1].shift,0.1*RIGHT),ApplyMethod(sq[4][2].shift,0.1*RIGHT)) + #self.play(ApplyMethod(sq[5][1].shift,LEFT+UP),ApplyMethod(sq[5][2].shift,sq[4][0])) + vbl=VGroup(sq[0][0],sq[0][1],sq[0][2],sq[1][0],sq[1][1],sq[1][2],sq[2][0],sq[2][1],sq[2][2]) + vbm=VGroup(sq[0][3],sq[0][4],sq[0][5],sq[1][3],sq[1][4],sq[1][5],sq[2][3],sq[2][4],sq[2][5]) + vbd=VGroup(sq[3][3],sq[3][4],sq[3][5],sq[4][3],sq[4][4],sq[4][5],sq[5][3],sq[5][4],sq[5][5]) + + self.play(ApplyMethod(vbl.shift,0.1*LEFT)) + self.play(ApplyMethod(vbd.shift,0.1*DOWN)) + self.wait(2) + + text1=TextMobject("1 1X1 square") + text2=TextMobject("2 2X2 squares") + text3=TextMobject("3 3X3 squares") + text1.shift(2.5*DOWN+6*LEFT) + text2.shift(2.5*DOWN+LEFT) + text3.shift(2.5*DOWN+4*RIGHT) + text1.scale(0.4) + text2.scale(0.4) + text3.scale(0.4) + + self.play(Write(text1)) + self.play(Write(text2)) + self.play(Write(text3)) + self.wait(2.5) + + self.play(FadeOut(text1),FadeOut(text2),FadeOut(text3)) + self.wait(1) + + cube1=TextMobject("$1^{ 3 }$") + cube2=TextMobject("$2^{ 3 }$") + cube3=TextMobject("$3^{ 3 }$") + cube1.shift(2*DOWN+6*LEFT) + cube2.shift(2*DOWN+LEFT) + cube3.shift(2*DOWN+5*RIGHT) + cube1.set_color(RED) + cube2.set_color(BLUE) + cube3.set_color(GREEN) + self.play(Transform(sq[5][0],cube1)) + self.play(Transform(two,cube2)) + self.play(Transform(three,cube3)) + self.wait(2) + + equalto=TextMobject("=") + equalto.scale(2.4) + equalto.shift(0.3*UP+LEFT) + equalto.set_color(GREEN) + self.play(Write(equalto)) + self.wait(3) + +class final(Scene): + def construct(self): + t=TextMobject("Similarly","it","is","true","$\\forall n \\in N $") + t.scale(1.7) + t.set_color_by_tex_to_color_map({"it":BLUE,"true":YELLOW}) + self.play(Write(t)) + self.wait(3) diff --git a/fossee-animations/README.md b/fossee-animations/README.md new file mode 100644 index 0000000..840df15 --- /dev/null +++ b/fossee-animations/README.md @@ -0,0 +1,2 @@ +Source code of the animations in <a href="https://animations.fossee.in/">animations.fossee</a> + diff --git a/fossee-animations/gifs/AnalyticFunctions(a).gif b/fossee-animations/gifs/AnalyticFunctions(a).gif new file mode 100644 index 0000000..6ae7560 Binary files /dev/null and b/fossee-animations/gifs/AnalyticFunctions(a).gif differ diff --git a/fossee-animations/gifs/AnalyticFunctions(b).gif b/fossee-animations/gifs/AnalyticFunctions(b).gif new file mode 100644 index 0000000..7585251 Binary files /dev/null and b/fossee-animations/gifs/AnalyticFunctions(b).gif differ diff --git a/fossee-animations/gifs/AnalyticFunctions(c).gif b/fossee-animations/gifs/AnalyticFunctions(c).gif new file mode 100644 index 0000000..253e336 Binary files /dev/null and b/fossee-animations/gifs/AnalyticFunctions(c).gif differ diff --git a/fossee-animations/gifs/AnalyticFunctions(d).gif b/fossee-animations/gifs/AnalyticFunctions(d).gif new file mode 100644 index 0000000..a7c333b Binary files /dev/null and b/fossee-animations/gifs/AnalyticFunctions(d).gif differ diff --git a/fossee-animations/gifs/CauchySequence(a).gif b/fossee-animations/gifs/CauchySequence(a).gif new file mode 100644 index 0000000..d6b1c90 Binary files /dev/null and b/fossee-animations/gifs/CauchySequence(a).gif differ diff --git a/fossee-animations/gifs/CauchySequence(b).gif b/fossee-animations/gifs/CauchySequence(b).gif new file mode 100644 index 0000000..7b07559 Binary files /dev/null and b/fossee-animations/gifs/CauchySequence(b).gif differ diff --git a/fossee-animations/gifs/CauchySequence(c).gif b/fossee-animations/gifs/CauchySequence(c).gif new file mode 100644 index 0000000..271412e Binary files /dev/null and b/fossee-animations/gifs/CauchySequence(c).gif differ diff --git a/fossee-animations/gifs/CompletingSquareMethod(a).gif b/fossee-animations/gifs/CompletingSquareMethod(a).gif new file mode 100644 index 0000000..d108089 Binary files /dev/null and b/fossee-animations/gifs/CompletingSquareMethod(a).gif differ diff --git a/fossee-animations/gifs/CompletingSquareMethod(b).gif b/fossee-animations/gifs/CompletingSquareMethod(b).gif new file mode 100644 index 0000000..889cf4b Binary files /dev/null and b/fossee-animations/gifs/CompletingSquareMethod(b).gif differ diff --git a/fossee-animations/gifs/NichomachusTheorem(a).gif b/fossee-animations/gifs/NichomachusTheorem(a).gif new file mode 100644 index 0000000..79750ac Binary files /dev/null and b/fossee-animations/gifs/NichomachusTheorem(a).gif differ diff --git a/fossee-animations/gifs/NichomachusTheorem(b).gif b/fossee-animations/gifs/NichomachusTheorem(b).gif new file mode 100644 index 0000000..b62244c Binary files /dev/null and b/fossee-animations/gifs/NichomachusTheorem(b).gif differ