Complex-step-compatible atan2()

atan2() or arctan2() function that is compatible with complex-step derivative operations.
23 Descargas
Actualizado 27 oct 2021

Ver licencia

The function atan2(Y,X) [or arctan2(Y,X)] is the four quadrant arctangent of the elements of X and Y such that -pi <= atan2(Y,X) <= pi.
MATLAB atan2() reports an error when inputs are complex. This function reproduces MATLAB atan2() results for real inputs, but can be used with complex inputs to enable complex-step derivative operations.
There is an output discontinuity at T = pi and -pi. However, the output derivative is continuous, so, at T = pi and -pi, this function calculates the derivative analytically and adds complex-step-equivalent perturbations to the output.
Because the function remains discontinuous, the user should carefully consider before using atan2() output for gradient-based optimization.
Complex step is a numerical differentiation technique. See description:

Citar como

Anthony Ricciardi (2026). Complex-step-compatible atan2() (https://es.mathworks.com/matlabcentral/fileexchange/101193-complex-step-compatible-atan2), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2016b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Versión Publicado Notas de la versión
1.0.0