
    
9j5                    T   S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKJr  S SKJ	r	  \R                  " SSS	S
5      r\R                  " SSSS5      r\R                  " SSSS5      r\R                  " SSSS5      r\R                  " SSSS5      r\R                  " SSSS5      r\R                  " SSSS5      r\R                  " SSSS 5      r\R&                  " S!S"/\	" 5       QS#PS$P7S%S&S'9r\R&                  " S(S"/\	" 5       QS#PS$P7S)S*S'9rS-S\R,                  -  S+.S, jjr\r\rg).    )annotationsN)_core)sumprod)ufunc)	bf16_loopsin   cupy_sinzDElementwise sine function.

    .. seealso:: :data:`numpy.sin`

    coscupy_coszFElementwise cosine function.

    .. seealso:: :data:`numpy.cos`

    tancupy_tanzGElementwise tangent function.

    .. seealso:: :data:`numpy.tan`

    asincupy_arcsinziElementwise inverse-sine function (a.k.a. arcsine function).

    .. seealso:: :data:`numpy.arcsin`

    acoscupy_arccoszmElementwise inverse-cosine function (a.k.a. arccosine function).

    .. seealso:: :data:`numpy.arccos`

    atancupy_arctanzoElementwise inverse-tangent function (a.k.a. arctangent function).

    .. seealso:: :data:`numpy.arctan`

    hypot   
cupy_hypotzComputes the hypoteneous of orthogonal vectors of given length.

    This is equivalent to ``sqrt(x1 **2 + x2 ** 2)``, while this function is
    more efficient.

    .. seealso:: :data:`numpy.hypot`

    atan2cupy_arctan2zeElementwise inverse-tangent of the ratio of two arrays.

    .. seealso:: :data:`numpy.arctan2`

    cupy_deg2radze->ezf->fzd->dz$out0 = in0 * (out0_type)(M_PI / 180)zyConverts angles from degrees to radians elementwise.

    .. seealso:: :data:`numpy.deg2rad`, :data:`numpy.radians`

    )doccupy_rad2degz$out0 = in0 * (out0_type)(180 / M_PI)zyConverts angles from radians to degrees elementwise.

    .. seealso:: :data:`numpy.rad2deg`, :data:`numpy.degrees`

    )periodc                  [         R                  " U 5      n U R                  n[        R                  " XS9nUc  US-  n[        SS5      /U-  n[        SS5      Xb'   [        U5      n[        R                  " UR                  U5      n[        R                  " U[        R                  5      (       a  [        US5      u  pU	S:H  n
OUS-  nSn
U* n[         R                  " X[-
  U5      U-   nU
(       a  [         R                  " XX:H  US:  -  S9  X-
  n[         R                  " US[        U5      U:  S9  [         R                   " U SUS9nX   [         R"                  " XS9-   X'   U$ )	aH  Unwrap by taking the complement of large deltas w.r.t. the period.

This unwraps a signal `p` by changing elements which have an absolute
difference from their predecessor of more than ``max(discont, period/2)``
to their `period`-complementary values.

For the default case where `period` is :math:`2\pi` and is ``discont``
is :math:`\pi`, this unwraps a radian phase `p` such that adjacent
differences are never greater than :math:`\pi` by adding :math:`2k\pi`
for some integer :math:`k`.

Args:
    p (cupy.ndarray): Input array.
        discont (float): Maximum discontinuity between values, default is
        ``period/2``. Values below ``period/2`` are treated as if they were
        ``period/2``. To have an effect different from the default,
        ``discont`` should be larger than ``period/2``.
    axis (int): Axis along which unwrap will operate, default is the last
        axis.
    period: float, optional
        Size of the range over which the input wraps. By default, it is
        :math:`2\pi`.
Returns:
    cupy.ndarray: The result array.

.. seealso:: :func:`numpy.unwrap`
)axisNr   r	   r   T)where)copydtype)cupyasarrayndimr   diffslicetuplenumpyresult_typer"   
issubdtypeintegerdivmodmodcopytoabsarraycumsum)pdiscontr   r   ndddslice1r"   interval_highremboundary_ambiguousinterval_lowddmod
ph_correctups                  R/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/_math/trigonometric.pyunwrapr@   m   sD   : 	QA	
B	a	#B(D$ #FD>FL6]Fbhh/Eu}}--#FA. AX
!!>LHHR&/,>EE!b1f1. 	/JKK
ASWw%67	AD	.BT[[??BJI    )N)
__future__r   r)   r#   r   
cupy._mathr   r   
cupy._utilr   create_math_ufuncr   r   r   arcsinarccosarctanr   arctan2create_ufuncdeg2radrad2degpir@   degreesradians rA   r?   <module>rR      s   "        	1j	 	1j	 	1j	 
	 	 
A}
	 
	 	 
A}
	 
	 	 
A}
	 	Q			 
!
!Q	 

*ik*6*6**			 

*ik*6*6**			5qz 5p 
rA   