
    j/                         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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#FF6B6Bz#FFA07Az#C792EAMenlo皙?      ?      @c                       e Zd Zd ZdS )Scene1_Titlec                    t           | j        _        t          ddt          t
          t          d          }|                    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           |                     dd           |                     t!          |          t(                     |                     d           |                     t+          t-          | j                   d           d S )Nz*The Most Beautiful Equation
in Mathematics4   gffffff?)	font_sizecolorweightfontline_spacing      ?e^{i\pi} + 1 = 0H   r   333333?z-Five numbers. One line. Everything connected.   333333?r   r   r   opacityr      durationrun_timer         ?z"e to the i pi plus one equals zero      @)BGcamerabackground_colorTextPRIMARYBOLDMONOmove_toUPMathTex	set_colorACCENTDOWNWHITEadd_subcaptionplayFadeInSLOWwaitWriteNORMALFadeOutGroupmobjects)selftitlesubtitletaglines       '/home/agentuser/euler-formula/script.py	constructzScene1_Title.construct   s   ')$9
 
 
 	b3h."===6"""$$$;
 
 
 	s
###KVWXXX		&...	>>>		#		%//D	111		#@1MMM		&//F	333		#		'%/003	?????    N__name__
__module____qualname__r>    r?   r=   r	   r	      (        "@ "@ "@ "@ "@r?   r	   c                       e Zd Zd ZdS )Scene2_FiveConstantsc           	      Z   t           | j        _        t          ddt          t
          t                    }|                    t          d           | 	                    |           dt          ddfd	t          d
dfdt          ddfdt          ddfdt          ddfg}g }|D ]\  }}}}t                      }t          |d|          }	t          |dt          t
          dd          }
|
                    |	t"          d           |	                    |	|
           |                    |t&          z             |                    t"          dz             |                    |           |                     dd           t/          |          D ]J\  }}|                     t3          |t4                     t4                      |                     d!           K|                     d"           t          d#d$t8          t
          %          }|                    t"          d&           |                     d'd           |                     t;          |          t<                      |                     d(           |                     t?          tA          | j!                   d)            d S )*NzMeet the Five Constants$   r   r   r   r   r   buffezThe base of
natural growthg      izThe square root
of negative oneg      \piz-Ratio of a circle's
circumference to diameterg        1zThe foundation
of countingr   0zThe concept
of nothingnessg      @P   r   r      ffffff?g?)r   r   r   r   r   皙?333333?z%Five constants. Each one fundamental.r   r   r   r          @z3What if I told you they were all... the same thing?   r   r   r   r   z0What if I told you they were all the same thing?r    r   )"r!   r"   r#   r$   r.   r'   r&   to_edger)   addRED_CORANGEPURPLEr%   VGroupr*   next_tor-   r(   RIGHTshiftappendr/   	enumerater0   r1   r5   r3   r,   r4   r2   r6   r7   r8   )r9   headerconstants_datagroupssymr   descxgroupsym_text	desc_textrN   gteasers                 r=   r>   zScene2_FiveConstants.construct9   s   ')$/2UQU^bcccr$$$ 57$?6=tDVMsS79C@57#>
 #1 	! 	!CaHHEsb>>>HTRu4QTcfgggIh3777IIh	***MM!e)$$$KKs
###MM%    CaPPPf%% 	 	DAqIIfQ0006IBBBIIcNNNN		#A	
 
 
 	t#&&&NYZ[[[		%--$	///		#		'%/003	?????r?   Nr@   rD   r?   r=   rG   rG   8   s(        +@ +@ +@ +@ +@r?   rG   c                       e Zd Zd ZdS )Scene3_ComplexPlanec           	         t           | j        _        t          ddt          t
          t                    }|                    t          d           | 	                    |           t          g dg dddd	d
d                              t          dz             t          ddt          t
                    }|                                                    t           d           t          ddt"          t
                    }|                                                    t          d           |                     dd           |                     t+                    t,                     |                     t/          |          t/          |          t0                     |                     d           t5          dt6          dd          }|                                        dd                     |                     dd           |                     t+          |          t<                     |                     d           t?          ddt                    }|                                        dd                     |                     t/          |          t0                     |                     d
           tA          tB          d !          }|                                        d"d                     tE          d          tG          d
dd                    dd          t6          d#          }fd$}|$                    |           t?          d%d&t                                                            d
d'                    }	t?          d(d&t"                                                            d)d
                    }
|	%                    d           |
%                    d           | 	                    ||           |                     d*d           |                     j&        '                    tP          dz            t<                     |                     tS          |	          tS          |
          t0                     |                     d+           |                     j&        '                    tP                    t<                     t?          d,d&t                                                            d-d)                    }t?          d.d&t"                                                            d-d
                    }|                     tU          |	|          tU          |
|          t,                     |                     d/           t          d0d&tB          t
                    }|                    t          d1           |                     d2d           |                     t/          |          t,                     |                     d3           |                     tW          tY          | j-                   d
           d S )4NzThe Complex Plane&   rJ   r   rK   )            Fr   )include_numbersstroke_opacity)x_rangey_rangex_lengthy_lengthaxis_configrW   Re   rZ   ImzA geometric map of numbersrv   r   r   r   r   )radiusstroke_colorr{   fill_opacityz-Every point on this circle encodes a rotationr   rP      rS   gffffff?g333333?g{Gz?)r   r   rw   r   start_angleangle
arc_centerr   stroke_widthc                                                      }|                     t          dd|                    dd          t          d                     d S )NrU   r   r   r   )	get_valuebecomeArcc2p	SECONDARY)mr   axestheta_trackers     r=   
update_arcz1Scene3_ComplexPlane.construct.<locals>.update_arc   sg    !++--EHHS%$(HHQNN)RUW W W X X X X Xr?   z\cos(\theta)r   gٿzi\sin(\theta)g      z3As theta grows, the point rotates around the circler   z\cos(\pi) = -1g333333zi\sin(\pi) = 0rX   u!   At θ = π, the point lands at -1r   z3At theta equals pi, the point lands at negative oner    ).r!   r"   r#   r$   r.   r'   r&   r[   r)   r\   Axesrc   r-   r%   ra   
get_x_axisrb   r^   
get_y_axisr/   r0   Creater5   r4   FASTr3   Circler   r(   r   r2   r*   Dotr,   ValueTrackerr   add_updaterset_opacityanimate	set_valuePIr1   ReplacementTransformr6   r7   r8   )r9   r:   
real_label
imag_labelunit_circle
one_markerp_dotarcr   	cos_label	sin_labelcos_label_targetsin_label_targetnoter   r   s                 @@r=   r>   zScene3_ComplexPlane.constructh   s   ')$(Be$W[\\\bs### JJJJ,1SII
 
 
 	

4#:$"G$GGG
4??,,e#>>>$"FFFF
4??,,bs;;;81EEE		&,,	000		%
##U:%6%6	FFF		# AIc`abbbDHHQNN+++KVWXXX		&%%	555		# TRw???
488D$//000		%
##d	333		# &...dhhq!nn%%% %Q!1!Q!3 3 3	X 	X 	X 	X 	X 	X
 	
### OrIIIQQRVRZRZ[^`dReReff	,&IIIQQRVRZRZ[_adReReff	a   )"7"7":":":eQ\]^^^		-'11"q&99D	III		&##VI%6%6	FFF		#		-'11"55	EEE"#4'RRRZZ[_[c[cdhjn[o[opp"#4&QQQYYZ^ZbZbcgilZmZmnn		&y2BCC&y2BCCf 	 	V 	V 	V		#72VZ^___T$$$Q\]^^^		%++	///		#		'%/003	?????r?   Nr@   rD   r?   r=   rr   rr   g   s-        P@ P@ P@ P@ P@r?   rr   c                       e Zd Zd ZdS )Scene4_EulerBridgec                 ~   t           | j        _        t          ddt          t
          t                    }|                    t          d           | 	                    |           t          ddt                    }|                    t                                        t          d	z  t          d
z  z              |                     dd           |                     t#          |          t$                     |                     d           t          dd          }|                    t*          d
z             |                     dd           |                     t#          |          t$                     |                     d           t          ddt,          t
          d          }|                    t*          d           |                     t#          |          t.                     |                     d           |                     t1          t3          | j                   d
           d S )NzThe Bridge: Euler's FormularI   rJ   r   rK   ze^{i\theta} = \;@   rS   rv   r   z3What does it mean to raise e to an imaginary power?r   r   r   r   &e^{i\theta} = \cos\theta + i\sin\theta8   r   z8The exponential function and rotation are the same thingr   z1The complex exponential IS rotation in the plane.r   g333333?r   r   r    )r!   r"   r#   r$   r.   r'   r&   r[   r)   r\   r*   r%   LEFTrc   rb   r/   r0   r4   r2   r3   r(   r-   r   r5   r6   r7   r8   )r9   r:   questionanswerr   s        r=   r>   zScene4_EulerBridge.construct   s   ')$2bTXaefffbs###."GLLL$$UQYc%9:::Q\]^^^		%//D	111		#BbQQQtcz"""Vabccc		%--$	///		#?
 
 
 	T$$$		%++	///		#		'%/003	?????r?   Nr@   rD   r?   r=   r   r      s(        @ @ @ @ @r?   r   c                       e Zd Zd ZdS )Scene5_TheRevealc                 
   t           | j        _        t          ddt          t
          t                    }|                    t          d           | 	                    |           t          ddt                    }|                    t                                        t          d	z             |                     t          |          t          
           |                     d           t          ddt"                    }|                    |t          d           |                     dd           |                     t          |          t(          
           |                     d           t          ddt                    }|                    |t          d           |                     t+          |                                |          t(          
           |                     d           t          dd          }|                    |t          d           t          dd                              t0                    }t          dd                              t2                    }|                     dd           |                     t+          |                                |          t(          
           |                     d           t          ddt4                    }|                    |t          d           |                     dd           |                     t+          |                                |          t          
           |                     d           t          dd          }	|	                    dt8                     |	                    dt2                     |	                    dt"                     |	                    d t0                     |	                    t          d!           t;          |	t          t          d"#          }
t          d$d%t          t
          d&'          }|                    |
t                     |                     d(d)           |                     t+          |                                |	          t          
           |                     d           |                     t=          |
          t          |          t(          
           |                     d*           |                     t?          tA          | j!                   d+
           d S ),Nz
The RevealrI   rJ   r   rK   r   ,   rS   r   r   rX   z\text{Let } \theta = \pizNow substitute pi for thetarv   r   ze^{i\pi} = \cos\pi + i\sin\pir   ze^{i\pi} = -1 + i\cdot 0r   z-1rQ   z1Cosine of pi is negative one. Sine of pi is zero.r   ze^{i\pi} = -1r   z!e to the i pi equals negative oner   <   rM   rN   rO   rP   r   rV   )r   rL   z)Five fundamental constants. One identity.   rU   r   z?e to the i pi plus one equals zero. Five numbers. One equation.         @r   )"r!   r"   r#   r$   r.   r'   r&   r[   r)   r\   r*   rc   r-   r0   r4   r2   r3   r_   ra   r/   r5   r   copyr+   r%   r^   r,   set_color_by_texr]   BraceGrowFromCenterr6   r7   r8   )r9   r:   step1step2step3step4cos_pisin_pistep5finalbracebrace_labels               r=   r>   zScene5_TheReveal.construct   sB   ')$\Ru4PTUUUbs###ARW\]]]bs
+++		%,,	...		#3rPPPeT,,,9AFFF		%,,	000		#8BeTTTeT,,,		&uzz||U;;f	MMM		#3rBBBeT,,,"---77@@,,,66v>>OZ[\\\		&uzz||U;;f	MMM		#(BfEEEeT,,,?!LLL		&uzz||U;;d	KKK		#+r:::tU+++tV,,,vv...tW---d%%%eTS999FRT\ahlvyzzzE4(((]hijjj		&uzz||U;;d	KKK		#		.''{););f	MMM		#		'%/003	?????r?   Nr@   rD   r?   r=   r   r      s(        5@ 5@ 5@ 5@ 5@r?   r   c                       e Zd Zd ZdS )Scene6_TheSilencec                    t           | j        _        t          dd          }|                    dt
                     |                    dt                     |                    dt                     |                    dt                     |                    dt                     | 
                    d	d
           |                     t          |t          dz            t          dz             |                     d           dt
          fdt          fdt          fdt          fdt          ffD ]u\  }}t          ||dd          }|                     t!          |          d           |                     d           |                     t#          |          d           v|                     d           t%          ddt&          t(          d          }|                    t,          d           | 
                    dd           |                     t/          |          t                     |                     d           |                     t#          t1          | j                   d           d S )Nr   rR   r   rM   rN   rO   rP   rQ   ze. i. pi. one. zero.r   r   r   r   r    rW   g?)r   r{   rL   rV   rX   z-"The most remarkable formula in mathematics."rY   g?r   rK   z+The most remarkable formula in mathematics.r   r   r   )r!   r"   r#   r*   r   r]   r^   r_   r%   r.   r/   r0   r1   r2   r3   SurroundingRectangler   r6   r$   r,   r'   r[   r-   r4   r7   r8   )r9   r   constr   hlquotes         r=   r>   zScene6_TheSilence.construct  s6   ')$+r:::tU+++tV,,,vv...tW---tU+++2Q???		&444tcz	JJJ		# #E]T6NVV<LtU\o`dfk_lm 	1 	1LE5%e5SVWWWBIIfRjj3I///IIcNNNIIgbkkCI0000		#=
 
 
 	d%%%ITUVVV		%,,	...		#		'%/003	?????r?   Nr@   rD   r?   r=   r   r     rE   r?   r   )manimnumpynpr!   r%   r   r,   r]   r^   r_   r'   r   r5   r2   Scener	   rG   rr   r   r   r   rD   r?   r=   <module>r      s           
				 SF$#@ #@ #@ #@ #@5 #@ #@ #@L,@ ,@ ,@ ,@ ,@5 ,@ ,@ ,@^Q@ Q@ Q@ Q@ Q@% Q@ Q@ Q@h@ @ @ @ @ @ @ @B6@ 6@ 6@ 6@ 6@u 6@ 6@ 6@r#@ #@ #@ #@ #@ #@ #@ #@ #@ #@r?   