| #!/usr/bin/env python |
| |
| from manimlib.imports import * |
| |
| def get_title(title_str = "Història"): |
| title = TextMobject(title_str) |
| title.scale(1.5) |
| title.to_edge(UP) |
| return title |
| |
| def create_image(source, scale=2.5): |
| img = ImageMobject(source) |
| img.scale(scale) |
| return img |
| |
| def create_label(img, desc): |
| label = TextMobject(desc) |
| label.scale(0.7) |
| label.next_to(img, DOWN) |
| return label |
| |
| class IntroHistoria(Scene): |
| def construct(self): |
| title = get_title() |
| |
| self.play(Write(title)) |
| self.wait(1.5) |
| |
| pol = TexMobject("p(x) = ", "x^n + a_{n-1} x^{n-1} + \ldots + a_0") |
| pol0, pol1 = pol.split(); |
| |
| pol2 = TexMobject("\\prod_{i = 1}^n (x - ", "\\alpha_i", ")") |
| pol2_1, alpha_pol, pol2_3 = pol2.split() |
| |
| vieta1 = TexMobject("a_{n-1} = - (", "\\alpha_1", " + \ldots + ", "\\alpha_n", ")") |
| vieta1_i, vieta1_alpha1, vieta1_plus, vieta1_alphan, vieta1_post = vieta1.split() |
| |
| vietamore = TexMobject("\\vdots") |
| |
| vieta2 = TexMobject("a_0 = (-1)^n \\cdot (", "\\alpha_1", " \cdot \ldots \cdot ", "\\alpha_n", ")") |
| vieta2_i, vieta2_alpha1, vieta2_prod, vieta2_alphan, vieta2_post = vieta2.split() |
| |
| general_vieta = TexMobject("(-1)^k a_{n-k} = \\sum_{1 \\le i_1 < i_2 < \\cdots < i_k \\le n} \\left( \\prod_{j=1}^k \\alpha_{i_j} \\right)") |
| general_vieta_desc = TextMobject("Fórmules de Viète") |
| |
| vietas = VGroup(vieta1, vietamore, vieta2) |
| vietamore.next_to(vieta1, DOWN, buff = 0.4) |
| vieta2.next_to(vietamore, DOWN, buff = 0.4) |
| vietas.next_to(pol, DOWN, buff = 1) |
| flow = VGroup(pol, vietas) |
| flow.center() |
| |
| # This should be done after the flow is centered: |
| pol2.next_to(pol0, RIGHT) |
| general_vieta.align_to(vietas, UP) |
| general_vieta_desc.next_to(vietas, DOWN) |
| |
| alpha_pol2 = alpha_pol.copy() |
| alpha_pol3 = alpha_pol.copy() |
| alpha_pol4 = alpha_pol.copy() |
| |
| framebox = SurroundingRectangle(general_vieta, buff = .15) |
| framebox.set_stroke(WHITE, 4) |
| |
| # Animations: |
| self.play(Write(pol)) |
| self.wait(1.5) |
| |
| self.play(Transform(pol1, pol2)) |
| self.wait(1.5) |
| |
| self.play(ApplyMethod( |
| alpha_pol.set_color, RED, |
| rate_func = there_and_back, |
| run_time = 2 |
| )) |
| self.wait(1.5) |
| |
| self.play( |
| Write(vieta1, |
| run_time=1), |
| Transform(alpha_pol, vieta1_alpha1), |
| Transform(alpha_pol2, vieta1_alphan) |
| ) |
| self.wait(1.5) |
| |
| self.play(FadeIn(vietamore)) |
| self.play( |
| Write(vieta2, |
| run_time=1), |
| Transform(alpha_pol3, vieta2_alpha1), |
| Transform(alpha_pol4, vieta2_alphan) |
| ) |
| self.wait(1.5) |
| |
| self.play(Transform(vietas, general_vieta)) |
| self.wait(1.5) |
| |
| self.play( |
| FadeIn(framebox), |
| FadeInFrom(general_vieta_desc, UP) |
| ) |
| self.wait(1.5) |
| |
| class LucaPacioli(Scene): |
| def construct(self): |
| title = get_title() |
| self.add(title) |
| self.wait(1.5) |
| |
| luca = create_image("img/pacioli.jpg") |
| luca.to_edge(LEFT, buff=1) |
| luca_desc = create_label(luca, "Luca Pacioli (c. 1445-1509)") |
| |
| suma = create_image("img/suma.png") |
| suma.to_edge(RIGHT, buff=1) |
| suma_desc = create_label(suma, "\\textit{Summa de arithmetica} (1494)") |
| |
| self.play( |
| FadeIn(luca), |
| FadeInFrom(luca_desc, UP) |
| ) |
| self.wait(1.5) |
| |
| self.play( |
| FadeIn(suma), |
| FadeInFrom(suma_desc, UP) |
| ) |
| self.wait(1.5) |
| |
| cardano = create_image("img/cardano.jpg") |
| cardano.to_edge(LEFT, buff=1) |
| cardano_desc = create_label(cardano, "Girolamo Cardano (1501-1576)") |
| |
| arsmagna = create_image("img/arsmagna.png") |
| arsmagna.to_edge(RIGHT, buff=1) |
| arsmagna_desc = create_label(arsmagna, "\\textit{Ars Magna} (1545)") |
| |
| cardano_cita = TextMobject("``Differentia aequationum ", "verarum", " et ", "fictarui", " \\\\ semper est numerus quadrato''") |
| cardano_pre, cardano_v, cardano_et, cardano_f, cardano_post = cardano_cita.split() |
| cardano_cita.scale(0.825) |
| cardano_cita.next_to(cardano, RIGHT) |
| |
| self.play( |
| FadeOut(suma), |
| FadeOut(suma_desc), |
| FadeOut(luca), |
| FadeIn(cardano), |
| Transform(luca_desc, cardano_desc) |
| ) |
| self.remove(luca_desc) |
| self.add(cardano_desc) |
| self.wait(1.5) |
| |
| self.play( |
| FadeIn(arsmagna), |
| FadeInFrom(arsmagna_desc, UP) |
| ) |
| self.wait(1.5) |
| |
| self.play( |
| FadeOut(arsmagna), |
| FadeOut(arsmagna_desc), |
| Write(cardano_cita) |
| ) |
| self.wait(1.5) |
| |
| self.play(ApplyMethod( |
| cardano_v.set_color, RED, |
| rate_func = there_and_back, |
| run_time = 1 |
| )) |
| self.play(ApplyMethod( |
| cardano_f.set_color, RED, |
| rate_func = there_and_back, |
| run_time = 1 |
| )) |
| self.wait(1.5) |
| |
| viete = create_image("img/viete.jpeg") |
| viete.to_edge(LEFT, buff=1) |
| viete_desc = create_label(viete, "François Viète (1540-1603)") |
| |
| self.play( |
| FadeOut(cardano_cita), |
| FadeOut(cardano), |
| FadeIn(viete), |
| Transform(cardano_desc, viete_desc) |
| ) |
| self.remove(cardano_desc) |
| self.add(viete_desc) |
| self.wait(1.5) |
| |
| girard = create_image("img/girard.jpg") |
| girard.to_edge(LEFT, buff=1) |
| girard_desc = create_label(girard, "Albert Girard (1595-1632)") |
| |
| self.play( |
| FadeOut(viete), |
| FadeIn(girard), |
| Transform(viete_desc, girard_desc) |
| ) |
| self.remove(viete_desc) |
| self.add(girard_desc) |
| self.wait(1.5) |
| |
| primer = TextMobject("Primer teorema de polinomis simètrics, \\\\ sense saber-ho") |
| primer.scale(0.825) |
| primer.next_to(girard, RIGHT) |
| |
| self.play(Write(primer)) |
| self.wait(1.5) |
| |
| invention = create_image("img/inventionnouvelle.png", 2) |
| invention.to_edge(RIGHT, buff=1) |
| invention_desc = create_label(invention, "\\textit{Invention nouvelle en l'algèbre} (1629)") |
| |
| self.play( |
| FadeOut(primer), |
| FadeIn(invention), |
| FadeInFrom(invention_desc, UP) |
| ) |
| self.wait(1.5) |
| |
| factions = create_image("img/factions.png", 1) |
| factions.to_edge(RIGHT, buff=1) |
| |
| self.play( |
| FadeOut(invention), |
| FadeIn(factions), |
| ApplyMethod(invention_desc.next_to, factions, DOWN) |
| ) |
| self.wait(1.5) |
| |
| factions_tex = TexMobject("\\text{Faction } k = \\sum_{\\{ i_1, \ldots, i_k \\} \\in \\{ 1, 2, \ldots, n \\}} \\alpha_{i_1} \\cdot \\cdots \\cdot \\alpha_{i_k}") |
| factions_tex.scale(0.95) |
| factions_tex.next_to(girard, RIGHT) |
| |
| self.play( |
| FadeOut(factions), |
| Write(factions_tex) |
| ) |
| self.wait(1.5) |
| |
| notthesame = TexMobject("\\sum_{i < j} \\alpha_i \\alpha_j ", "\\neq", " \\sum_{i} \\alpha_i^2") |
| notthesame.next_to(girard, RIGHT).shift(1*RIGHT) |
| |
| notthesame2 = TexMobject("\\sum_{i < j < k} \\alpha_i \\alpha_j \\alpha_k ", "\\neq", " \\sum_{i} \\alpha_i^3") |
| notthesame2.next_to(girard, RIGHT).shift(1*RIGHT) |
| |
| self.play(Transform(factions_tex, notthesame)) |
| self.remove(factions_tex) |
| self.add(notthesame) |
| self.wait(1.5) |
| |
| self.play(Transform(notthesame, notthesame2)) |
| self.remove(notthesame) |
| self.add(notthesame2) |
| self.wait(1.5) |
| |
| sommes = create_image("img/sommepuissances.png") |
| sommes.to_edge(RIGHT, buff=1) |
| |
| self.play( |
| FadeOut(notthesame2), |
| FadeIn(sommes), |
| ApplyMethod(invention_desc.next_to, sommes, DOWN) |
| ) |
| self.wait(1.5) |
| |
| sommes2 = create_image("img/sommepuissances2.png", 1) |
| sommes2.to_edge(RIGHT, buff=1) |
| sommes2_desc = create_label(sommes2, "\\textit{A Short Account of the History of Symmetric} \\\\ \\textit{Functions of Roots of Equations}, \\\\ H. Gray Funkhouser (1930).") |
| |
| self.play( |
| FadeOut(sommes), |
| FadeIn(sommes2), |
| Transform(invention_desc, sommes2_desc) |
| ) |
| self.remove(invention_desc) |
| self.add(sommes2_desc) |
| self.wait(1.5) |
| |
| waring = create_image("img/waring.jpg") |
| waring.to_edge(LEFT, buff=1) |
| waring_desc = create_label(waring, "Edward Waring (1736-1798)") |
| |
| self.play( |
| FadeOut(sommes2), |
| FadeOut(sommes2_desc), |
| FadeOut(girard), |
| FadeIn(waring), |
| Transform(girard_desc, waring_desc) |
| ) |
| self.remove(girard_desc) |
| self.add(waring_desc) |
| self.wait(1.5) |
| |
| class EdwardWaring(Scene): |
| def construct(self): |
| title = get_title() |
| self.add(title) |
| |
| waring = create_image("img/waring.jpg") |
| waring.to_edge(LEFT, buff=1) |
| waring_desc = create_label(waring, "Edward Waring (1736-1798)") |
| |
| self.add(waring) |
| self.add(waring_desc) |
| |
| th1 = TextMobject("Teorema 1. ", "???").set_color(GRAY) |
| th2 = TextMobject("Teorema 2. ???").set_color(GRAY) |
| th3 = TextMobject("Teorema 3. ", "???").set_color(GRAY) |
| |
| th1.shift(1*UP) |
| th3.shift(1*DOWN) |
| |
| teoremes = VGroup(th1, th2, th3) |
| teoremes.next_to(waring, RIGHT).shift(1*RIGHT) |
| |
| self.play( |
| FadeInFrom(th1, UP), |
| FadeIn(th2), |
| FadeInFrom(th3, DOWN) |
| ) |
| self.wait(1.5) |
| |
| th1_pre, th1_question = th1.split() |
| th1_text = TexMobject("\\sum_{i} \\alpha_i^k = f_k(a_i) \\quad \\forall k \\in \\mathbb{N}") |
| th1_text.scale(0.8) |
| th1_text.next_to(th1_pre) |
| |
| self.play( |
| Transform(th1_question, th1_text), |
| ApplyMethod(th1_pre.set_color, WHITE) |
| ) |
| self.wait(1.5) |
| |
| th3_pre, th3_question = th3.split() |
| th3_text = TextMobject("Precursor al Teo. Fonamental \\\\ dels Polinomis Simètrics") |
| th3_text.scale(0.7) |
| th3_text.next_to(th3_pre) |
| |
| self.play( |
| Transform(th3_question, th3_text), |
| ApplyMethod(th3_pre.set_color, WHITE) |
| ) |
| self.wait(1.5) |
| |
| meditationes = create_image("img/meditationes.png") |
| meditationes.to_edge(RIGHT, buff=2) |
| meditationes_desc = create_label(meditationes, "\\textit{Meditationes Algebraicae} (1770).") |
| |
| self.play( |
| FadeOut(th1), |
| FadeOut(th2), |
| FadeOut(th3), |
| FadeIn(meditationes), |
| FadeInFrom(meditationes_desc, UP) |
| ) |
| self.wait(1.5) |
| |
| conjectura = VGroup( |
| TextMobject("$n$ es pot escriure com a màxim com a suma de:"), |
| TextMobject("$\\cdot$ 4 quadrats"), |
| TextMobject("$\\cdot$ 9 cubs"), |
| TextMobject("$\\cdot$ 19 biquadrats"), |
| TextMobject("$\\cdot$ en general, $m$ potències k-èssimes positives, \\\\ essent $m$ depenent de $k$ ($\\forall k \\in \\mathbb{N}$)"), |
| ) |
| conjectura.scale(0.8) |
| conjectura.arrange(DOWN, buff = MED_LARGE_BUFF, aligned_edge = LEFT) |
| conjectura.to_edge(RIGHT, buff=0.75) |
| |
| self.play( |
| FadeOut(meditationes), |
| Write(conjectura) |
| ) |
| self.wait(1.5) |