+
    i:'                         R t R.t^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
HtHt ^ RIHt ^ RIHtHt ^ RIHtHt ^ R	IHt ^ R
IHt ^ RIHtHtHt ^ RIHtHtH t  ]PB                  ! ]] ,          4      t" ! R R]4      t#R# )zb
This module has all the classes and functions related to waves in optics.

**Contains**

* TWave
TWave)Basic)Expr)
DerivativeFunction)NumberpiI)S)Symbolsymbols)_sympifysympify)exp)sqrt)atan2cossin)speed_of_lightmetersecondc                   2  a  ] tR t^t o RtR]P                  R]! R4      3R lt]	R 4       t
]	R 4       t]	R 4       t]	R 4       t]	R	 4       t]	R
 4       t]	R 4       t]	R 4       t]	R 4       tR t]tR tR tR tR tR tR tR tR tR tR tR tRt V t!R# )r   ax  
This is a simple transverse sine wave travelling in a one-dimensional space.
Basic properties are required at the time of creation of the object,
but they can be changed later with respective methods provided.

Explanation
===========

It is represented as :math:`A \times cos(k*x - \omega \times t + \phi )`,
where :math:`A` is the amplitude, :math:`\omega` is the angular frequency,
:math:`k` is the wavenumber (spatial frequency), :math:`x` is a spatial variable
to represent the position on the dimension on which the wave propagates,
and :math:`\phi` is the phase angle of the wave.


Arguments
=========

amplitude : Sympifyable
    Amplitude of the wave.
frequency : Sympifyable
    Frequency of the wave.
phase : Sympifyable
    Phase angle of the wave.
time_period : Sympifyable
    Time period of the wave.
n : Sympifyable
    Refractive index of the medium.

Raises
=======

ValueError : When neither frequency nor time period is provided
    or they are not consistent.
TypeError : When anything other than TWave objects is added.


Examples
========

>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A1, phi1, A2, phi2, f = symbols('A1, phi1, A2, phi2, f')
>>> w1 = TWave(A1, f, phi1)
>>> w2 = TWave(A2, f, phi2)
>>> w3 = w1 + w2  # Superposition of two waves
>>> w3
TWave(sqrt(A1**2 + 2*A1*A2*cos(phi1 - phi2) + A2**2), f,
    atan2(A1*sin(phi1) + A2*sin(phi2), A1*cos(phi1) + A2*cos(phi2)), 1/f, n)
>>> w3.amplitude
sqrt(A1**2 + 2*A1*A2*cos(phi1 - phi2) + A2**2)
>>> w3.phase
atan2(A1*sin(phi1) + A2*sin(phi2), A1*cos(phi1) + A2*cos(phi2))
>>> w3.speed
299792458*meter/(second*n)
>>> w3.angular_velocity
2*pi*f

Nnc                   Ve#   \        V4      p\        P                  V,          pVeN   \        V4      p\        P                  V,          pVe(   V\        P                  V,          8w  d   \        R4      hVf   Vf   \        R4      hVf   XpVf   Xp\        V4      p\        V4      p\	        V4      p\
        P                  ! WW#WE4      pV# )Nz/frequency and time_period should be consistent.z*Either frequency or time period is needed.)r   r
   One
ValueErrorr   r   __new__)	cls	amplitude	frequencyphasetime_periodr   
_frequency_time_periodobjs	   &&&&&&   z/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/physics/optics/waves.pyr   TWave.__new__Y   s     "";/K{*J  +I55?L&k 11$%VWW!4IJJ"I&KY'	AJmmCIkM
    c                (    V P                   ^ ,          # )z
Returns the amplitude of the wave.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A, phi, f = symbols('A, phi, f')
>>> w = TWave(A, f, phi)
>>> w.amplitude
A
argsselfs   &r%   r   TWave.amplitudev   s     yy|r'   c                (    V P                   ^,          # )z
Returns the frequency of the wave,
in cycles per second.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A, phi, f = symbols('A, phi, f')
>>> w = TWave(A, f, phi)
>>> w.frequency
f
r)   r+   s   &r%   r   TWave.frequency         yy|r'   c                (    V P                   ^,          # )z
Returns the phase angle of the wave,
in radians.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A, phi, f = symbols('A, phi, f')
>>> w = TWave(A, f, phi)
>>> w.phase
phi
r)   r+   s   &r%   r    TWave.phase   r0   r'   c                (    V P                   ^,          # )z
Returns the temporal period of the wave,
in seconds per cycle.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A, phi, f = symbols('A, phi, f')
>>> w = TWave(A, f, phi)
>>> w.time_period
1/f
r)   r+   s   &r%   r!   TWave.time_period   r0   r'   c                (    V P                   ^,          # )z,
Returns the refractive index of the medium
r)   r+   s   &r%   r   TWave.n   s    
 yy|r'   c                R    \         V P                  V P                  ,          ,          # )a:  
Returns the wavelength (spatial period) of the wave,
in meters per cycle.
It depends on the medium of the wave.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A, phi, f = symbols('A, phi, f')
>>> w = TWave(A, f, phi)
>>> w.wavelength
299792458*meter/(second*f*n)
)cr   r   r+   s   &r%   
wavelengthTWave.wavelength   s    " $..'((r'   c                <    V P                   V P                  ,          # )a/  
Returns the propagation speed of the wave,
in meters per second.
It is dependent on the propagation medium.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A, phi, f = symbols('A, phi, f')
>>> w = TWave(A, f, phi)
>>> w.speed
299792458*meter/(second*n)
)r9   r   r+   s   &r%   speedTWave.speed   s    " t~~--r'   c                >    ^\         ,          V P                  ,          # )z
Returns the angular velocity of the wave,
in radians per second.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A, phi, f = symbols('A, phi, f')
>>> w = TWave(A, f, phi)
>>> w.angular_velocity
2*pi*f
)r   r   r+   s   &r%   angular_velocityTWave.angular_velocity   s      tDNN""r'   c                >    ^\         ,          V P                  ,          # )a  
Returns the wavenumber of the wave,
in radians per meter.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.optics import TWave
>>> A, phi, f = symbols('A, phi, f')
>>> w = TWave(A, f, phi)
>>> w.wavenumber
pi*second*f*n/(149896229*meter)
)r   r9   r+   s   &r%   
wavenumberTWave.wavenumber   s      tDOO##r'   c                f    ^ RI Hp \        V 4      P                  V! V P                  4      ,           # )z!String representation of a TWave.)sstr)sympy.printingrE   type__name__r*   )r,   rE   s   & r%   __str__TWave.__str__  s"    'Dz""T$))_44r'   c                   \        V\        4      '       Ed   V P                  VP                  8X  Edb   V P                  VP                  8X  EdF   \        \	        V P
                  ^,          VP
                  ^,          ,           ^V P
                  ,          VP
                  ,          \        V P                  VP                  ,
          4      ,          ,           4      V P                  \        V P
                  \        V P                  4      ,          VP
                  \        VP                  4      ,          ,           V P
                  \        V P                  4      ,          VP
                  \        VP                  4      ,          ,           4      4      # \        R4      h\        \        V4      P                  R,           4      h)zw
Addition of two waves will result in their superposition.
The type of interference will depend on their phase angles.
zJInterference of waves with different frequencies has not been implemented.z# and TWave objects cannot be added.)
isinstancer   r   r9   r   r   r   r    r   r   NotImplementedError	TypeErrorrG   rH   r,   others   &&r%   __add__TWave.__add__  sD   
 eU##~~0T__HXHX5XT$..!"3eooq6H"H1"&..L116LAAD&*jj5;;&>B@L@ #@ A "^^"4>>#djj/#A$s5;;/??$@!^^C

O;$s5;;/??@A	  * +1 2 2 DK003XXYYr'   c                    \        V4      p\        V\        4      '       d0   \        V P                  V,          .V P
                  R,          O5!  # \        \        V4      P                  R,           4      h)zD
Multiplying a wave by a scalar rescales the amplitude of the wave.
:   NNz( and TWave objects cannot be multiplied.)	r   rL   r   r   r   r*   rN   rG   rH   rO   s   &&r%   __mul__TWave.__mul__,  sV     eV$$->		">>DK003]]^^r'   c                2    V P                  RV,          4      # rT   rQ   rO   s   &&r%   __sub__TWave.__sub__6  s    ||BuH%%r'   c                $    V P                  R4      # rX   rU   r+   s   &r%   __neg__TWave.__neg__9  s    ||Br'   c                $    V P                  V4      # NrZ   rO   s   &&r%   __radd__TWave.__radd__<      ||E""r'   c                $    V P                  V4      # rb   r^   rO   s   &&r%   __rmul__TWave.__rmul__?  re   r'   c                &    V ) P                  V4      # rb   )rc   rO   s   &&r%   __rsub__TWave.__rsub__B  s    &&r'   c                    V P                   \        V P                  \        R 4      ,          V P                  \        R4      ,          ,
          V P
                  ,           \        ^,          ,           RR7      ,          # )xtF)evaluate)r   r   rB   r   r?   r    r   r,   r*   kwargss   &*,r%   _eval_rewrite_as_sinTWave._eval_rewrite_as_sinE  s_    ~~c$//&+"=##F3K/#026**#=?A!t#DNSU U 	Ur'   c                    V P                   \        V P                  \        R 4      ,          V P                  \        R4      ,          ,
          V P
                  ,           4      ,          # rm   rn   )r   r   rB   r   r?   r    rp   s   &*,r%   _eval_rewrite_as_cosTWave._eval_rewrite_as_cosI  sL    ~~c$//&+"=##F3K/#026**#= > > 	>r'   c                    \        R 4      w  r4rV\        R4      p\        V! WV4      V^4      W4,          \        V! WV4      V^4      ,          ,           # )zmu, epsilon, x, tE)r   r   r   )r,   r*   rq   muepsilonrm   rn   ry   s   &*,     r%   _eval_rewrite_as_pdeTWave._eval_rewrite_as_pdeM  sG    #$78QSM!A'1a(2:j1!Q6O+OOOr'   c           	         V P                   \        \        V P                  \	        R 4      ,          V P
                  \	        R4      ,          ,
          V P                  ,           ,          4      ,          # ru   )r   r   r	   rB   r   r?   r    rp   s   &*,r%   _eval_rewrite_as_expTWave._eval_rewrite_as_expR  sS    ~~c!T__VC[%@##F3K/&026**&= #> ? ? 	?r'    )"rH   
__module____qualname____firstlineno____doc__r
   Zeror   r   propertyr   r   r    r!   r   r9   r<   r?   rB   rI   __repr__rQ   rU   r[   r_   rc   rg   rj   rr   rv   r|   r   __static_attributes____classdictcell__)__classdict__s   @r%   r   r      s&    :~ &&Sk:     "  "  "   ) )& . .$ # #" $ $"5
 HZ,_& ##'U>P
? ?r'   N)$r   __all__sympy.core.basicr   sympy.core.exprr   sympy.core.functionr   r   sympy.core.numbersr   r   r	   sympy.core.singletonr
   sympy.core.symbolr   r   sympy.core.sympifyr   r   &sympy.functions.elementary.exponentialr   (sympy.functions.elementary.miscellaneousr   (sympy.functions.elementary.trigonometricr   r   r   sympy.physics.unitsr   r   r   
convert_tor8   r   r   r'   r%   <module>r      sa    ) "   4 . . " / 0 6 9 F F = = eFl+y?D y?r'   