
    `oj1                         d dl T d dlZdZdZdZdZdZdZd	Z	d
Z
dZ G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          ZdS )    )*Nz#1C1C1Cz#58C4DDz#83C167z#FFFF00z#FFFFFFMenlo皙?      ?      @c                       e Zd Zd ZdS )Scene1_Titlec                    t           | j        _        t          ddt          t
          t                    }|                    t          dz             t          dd          }|
                    t                     |                    t          dz             t          d	d
t          t          d          }|                    t          dz             |                     dd           |                     t          |t                     t                      |                     d           |                     t%          |          t                      |                     d           |                     t          |          t&                     |                     d           |                     t)          t+          | j                   d           d S )NzThe Pythagorean Theorem4   )	font_sizecolorweightfont333333?a^2 + b^2 = c^2H   r   r   u&   Proved not by numbers — but by area.   g?r   r   r   opacityr   z#Proved not by numbers, but by area.   durationrun_timer         ?      @      ?)BGcamerabackground_colorTextWHITE_CBOLDMONOmove_toUPMathTex	set_colorACCENTDOWNadd_subcaptionplayFadeInSLOWwaitWriteNORMALFadeOutGroupmobjects)selftitleeqtaglines       %/home/agentuser/pythagorean/script.py	constructzScene1_Title.construct   s   ')$%
 
 
 	b3h'2666
V


4#:4
 
 
 	s
###AANNN		&...	>>>		#		%))d	+++		#		&//F	333		#		'%/003	?????    N__name__
__module____qualname__r;    r<   r:   r	   r	      s(         @  @  @  @  @r<   r	   c                       e Zd Zd ZdS )Scene2_Trianglec           	         t           | j        _        t          ddt          t
          t                    }|                    t          d           | 	                    |           d\  }}t          j        |dz  |dz  z             }t          g d|d	d	gd	|d	gt          d
d	d          }t          t          g dg d          t          g dg d          dt          d          }t          ddt                     }|                    t          g dd	|d	g                                          t&          d           t          ddt(                    }|                    t          g d|d	d	g                                          t*          d           t          ddt,                    }	t          |d	d	gd	|d	g                                          }
|	                    |
g dz              t          ddt                    }|                    t*          d           |                     dd           |                     t5          |          t6                     |                     d           |                     t5          |          t:                     |                     d            |                     t=          |          t=          |          t>                     |                     d!           |                     t=          |	          t>                     |                     d           |                     d"d           |                     t=          |          t>                     |                     d#           |                     tA          tC          | j"                   d!           d S )$NzThe Right Triangle&   r   r   r   r   r   buffr         r   r   r   r   g?r   stroke_colorstroke_opacityfill_opacitystroke_width)r   r   r   )r   r   r   333333?)lengthr   rQ   a(   r   r   333333?bc)rR   rR   r   za = 3,\; b = 4,\; c = 5   g333333?z(A right triangle with sides 3, 4, and 5.r   r   r   r   r   r   z2The hypotenuse is always opposite the right angle.r   )#r   r    r!   r"   r#   r%   r$   to_edger'   addnpsqrtPolygon
RightAngleLiner(   PRIMARYnext_to
get_centerLEFT	SECONDARYr+   r*   r&   r,   r-   Creater/   r0   FASTr1   r2   r3   r4   r5   )r6   r7   a_lenb_lenhyptriraa_labelb_labelc_labelc_posnumss               r:   r;   zScene2_Triangle.construct8   sQ   ')$)RwTZ^___bs### ugeQh)**IIq!}q%m 
 
 
 KKK((KKK((
 
 
 $"G<<<YYYE166AACCTPTUUU$"I>>>YYY166AACCTPTUUU$"F;;;eQ]QqM22==??-... 1RwOOOT$$$FQRSSS		&++	---		#		&**t	,,,		#		%..%..6	BBB		#		%..6	222		#P[\]]]		%++	///		#		'%/003	?????r<   Nr=   rA   r<   r:   rC   rC   7   s(        7@ 7@ 7@ 7@ 7@r<   rC   c                       e Zd Zd ZdS )Scene3_ThreeSquaresc           	      0   t           | j        _        t          ddt          t
          t                    }|                    t          d           | 	                    |           t          g dg dg dt          d	d
d          }|                    t          dz  t          dz  z              t          dt          t          dd          }|                    t          dz  t          dz  z              t!          ddt                    }t!          ddt                    }t          dt"          t"          dd          }t!          ddt"                    }t!          ddt"                    }t          dt$          t$          dd          }	t!          ddt$                    }
t!          ddt$                    }|                    t          dz  t          dz  z              |                    |t(          d            |                    |t(          d            |	                    |t(          d            |                                                    |                                          }|                                                    |                                          }|
                                                    |	                                          }|                                                    |t          d          }|                                                    |t          d          }|                                                    |t          d          }|                     d!d"           |                     t3          |          t4          #           |                     d           |                     t9          |t:          #          t:          #           |                     t=          |          t>          #           |                     t=          |          t>          #           |                     d           |                     d$d%"           |                     t9          |t:          #          t:          #           |                     t=          |          t>          #           |                     t=          |          t>          #           |                     d           |                     d&d%"           |                     t9          |	t:          #          t:          #           |                     t=          |          t>          #           |                     t=          |          t>          #           |                     d           |                     d'd"           |                     d(           |                     tA          tC          | j"                   d#           d S ))NzThree SquaresrE   rF   r   rG   rL   )rJ   r   r   )r   r   r   rR   r   r   rM   g      @r   r   g      ?r   side_lengthrN   
fill_colorrP   rQ   a^2$   rV   z= 9rZ   rJ   g?b^2z= 16   rW   c^2z= 25r   z>Each side builds its own square. The areas are no coincidence.r   r   z The square on side a has area 9.rK   z!The square on side b has area 16.z/And the square on the hypotenuse c has area 25.r   )#r   r    r!   r"   r#   r%   r$   r[   r'   r\   r_   r&   re   r+   Squarerb   r(   rf   r*   rc   RIGHTcopyrd   r,   r-   rg   r2   r0   r.   r/   r1   rh   r3   r4   r5   )r6   r7   rl   sq_a
sq_a_labelsq_a_numsq_b
sq_b_labelsq_b_numsq_c
sq_c_labelsq_c_numsq_a_lblsq_b_lblsq_c_lblsq_a_nsq_b_nsq_c_ns                     r:   r;   zScene3_ThreeSquares.constructs   s   ')$_'UYZZZbs### IIyyy))) 
 
 
 	D3J+,,, !'g\`orsssTCZ$*,---VrAAA
6Rw??? !)	`cruvvvVrCCC
7b	BBB !&VZ^mpqqqVr@@@
7b??? 	D3J+,,,S%c***T5s+++T5s+++??$$,,T__->->????$$,,T__->->????$$,,T__->->??((4c(BB((4c(BB((4c(BB\ghiii		&++	///		#		&---	===		%//D	111		%--$	///		#>KKK		&---	===		%//D	111		%--$	///		#?!LLL		&---	===		%//D	111		%--$	///		#MXYZZZ		#		'%/003	?????r<   Nr=   rA   r<   r:   rt   rt   r   s-        E@ E@ E@ E@ E@r<   rt   c                       e Zd Zd ZdS )Scene4_Proofc                 	   t           | j        _        t          ddt          t
          t                    }|                    t          d           | 	                    |           d\  }}d}||z   }t          |t          dd	d
          }|                    t                     d	dd}t          g d|d
d
g||d
gd
|d
gft          t          d|}t          |d
d
g||z   d
d
g||z   |d
g||d
gft           t           d|}	t          ||d
g||z   |d
g||z   ||z   d
g|||z   d
gft          t          d|}
t          d
|d
g||d
g|||z   d
gd
||z   d
gft           t           d|}t          |t          t          dd          }t          |t           t           dd          }|                    ||dz  z   |dz  d
g           |                    |dz  ||dz  z   d
g           t#          ddt                    }|                    |                                           t#          ddt                     }|                    |                                           t          ddt          d          }|                     dd           |                     t+          |          t,                     |                     d           |                     t1          |          t1          |	          t1          |
          t1          |          t2                     |                     d	           |                     dd           |                     t5          |          t,                     |                     d	           |                     dd           |                     t1          |          t1          |          t2                     |                     t5          |          t5          |          t,                     |                     d            t          d!d"t          t
          d#$          }|                    t6          d#           |                     d%d           |                     t5          |          t,                     |                     d&           |                     t9          t;          | j                   d           d S )'NzThe Proof by ArearE   rF   r   rG   rI   r|   g?r   r   )rw   rN   rO   rQ   rP   )rQ   rP   rL   )rN   rx   ffffff?rK   rv   r   ry       rV   r{   u   4 × (ab/2)   )r   r   r   z?Four identical right triangles form a frame around two squares.r   r   r   z5The four triangles have total area 4 times ab over 2.u;   What's left? A square of area a² and a square of area b².       @
Rearranged   r   r   z9Now rearrange. Does the large square still fit perfectly?r   )r   r    r!   r"   r#   r%   r$   r[   r'   r\   r~   r*   r&   ORIGINr_   rb   rf   r(   rd   r,   r-   rg   r2   r0   r.   r/   r1   r+   r3   r4   r5   )r6   r7   rT   rX   rY   sq_side	container
tri_kwargst_blt_brt_trt_tlinner_ainner_blalb	tri_label	alt_titles                     r:   r;   zScene4_Proof.construct   s   ')$(BgDY]^^^bs### 1a% 
 
 
	 	&!!! '*3??
www1Q!Aa1Qq'r\crrgqrr!Aw1Qq	AaC!9q1gzIbkzzoyzz!Aw1Qq	AaC!A;1Q3q	zPWdkzzoyzz!Aw1Q!AaCQqs1IzIbkzzoyzz QW_bqrsssQY9cfuvwww 	QqS!A#q)***1a!A#gq)***Vr999


7%%''(((Vr;;;


7%%''((( "GSQQQ	]hijjj		&##f	555		#		&,,tfTllF4LLSW	XXX		#S^_```		%	""V	444		#Ydefff		&//6'??T	BBB		%))U2YY	888		# 6VYZZZ	$S)))Wbcddd		%	""V	444		#		'%/003	?????r<   Nr=   rA   r<   r:   r   r      s-        N@ N@ N@ N@ N@r<   r   c                       e Zd Zd ZdS )Scene5_Equationc                 <   t           | j        _        t          ddt          t
          t                    }|                    t          d           | 	                    |           t          dd          }|                    t                                        t          d	z             t          d
d          }|                    t          dz             t          dd          }|                    t          dz             |                     dd           |                     t!          |          t"                     |                     d           |                     t'          |                                |          t"                     |                     d           |                     dd           |                     t'          |                                |          t"                     |                     d           t+          |t,          dd          }|                     t/          |          t0                     |                     d           |                     t3          t5          | j                   d           d S )NzThe AlgebrarE   rF   r   rG   r   <   r   r   z3^2 + 4^2 = 5^28   r   z9 + 16 = 25r   r   zIn numbers, it looks like this.rK   r   r   z%Nine plus sixteen equals twenty-five.r   rR   r   )r   rH   rO   )r   r    r!   r"   r#   r%   r$   r[   r'   r\   r(   shiftr+   r&   r,   r-   r1   r/   r0   ReplacementTransformr   SurroundingRectangler*   rg   r2   r3   r4   r5   )r6   r7   eq1eq2eq3	highlights         r:   r;   zScene5_Equation.construct  s   ')$]bdSWXXXbs###(B777BdSj)))(B777D3Jn333D3J=JJJ		%**t	,,,		#		&sxxzz377$	GGG		#CaPPP		&sxxzz377$	GGG		# )FUXYYY			&##f	555		#		'%/003	?????r<   Nr=   rA   r<   r:   r   r     s(        @ @ @ @ @r<   r   c                       e Zd Zd ZdS )Scene6_TheSilencec                    t           | j        _        t          dd          }|                    dt
                     |                    dt                     |                    dt                     t          ddt          t          d	
          }|                    t          d           t          ddt          t          d
          }|                    t          d           |                     dd           |                     t          |t           dz            t           dz             |                     d           |                     t%          |          t&                     |                     d           |                     t%          |          t&                     |                     d           |                     t)          t+          | j                   d	           d S )Nr   r   r   ry   r{   r}   z/"A beautiful truth, timeless and self-evident."r   r   r   g?rG   zProved ~500 BC by Pythagoras   rR   r   z%Proved 2500 years ago. Still perfect.rJ   r   r   r   r   g      @)r   r    r!   r(   set_color_by_texrb   rf   r*   r"   r#   r%   r[   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   )r6   r8   subyears       r:   r;   zScene6_TheSilence.construct/  s   ')$'2666
E7+++
E9---
E6***=
 
 
 	Ds###2bVZdghhhT$$$CaPPP		&dSj111D3J	GGG		#		%**v	...		#		%++	///		#		'%/003	?????r<   Nr=   rA   r<   r:   r   r   .  s(        @ @ @ @ @r<   r   )manimnumpyr]   r   rb   rf   r*   r#   r%   rh   r2   r/   Scener	   rC   rt   r   r   r   rA   r<   r:   <module>r      s           
		
 SF$!@ !@ !@ !@ !@5 !@ !@ !@H8@ 8@ 8@ 8@ 8@e 8@ 8@ 8@vF@ F@ F@ F@ F@% F@ F@ F@RO@ O@ O@ O@ O@5 O@ O@ O@d@ @ @ @ @e @ @ @B@ @ @ @ @ @ @ @ @ @r<   