Complex-step-compatible atan2()
Version 1.0.0 (2,66 KB) von
Anthony Ricciardi
atan2() or arctan2() function that is compatible with complex-step derivative operations.
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:
Zitieren als
Anthony Ricciardi (2026). Complex-step-compatible atan2() (https://de.mathworks.com/matlabcentral/fileexchange/101193-complex-step-compatible-atan2), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Erstellt mit
R2016b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxTags
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0 |
