Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php
public static function IMARGUMENT($complexNumber)
    {
        $complexNumber = Functions::flattenSingleValue($complexNumber);
        $parsedComplex = self::parseComplex($complexNumber);
        if ($parsedComplex['real'] == 0.0) {
            if ($parsedComplex['imaginary'] == 0.0) {
                return Functions::DIV0();
            } elseif ($parsedComplex['imaginary'] < 0.0) {
                return M_PI / -2;
            }

            return M_PI / 2;
        } elseif ($parsedComplex['real'] > 0.0) {
            return atan($parsedComplex['imaginary'] / $parsedComplex['real']);
        } elseif ($parsedComplex['imaginary'] < 0.0) {
            return 0 - (M_PI - atan(abs($parsedComplex['imaginary']) / abs($parsedComplex['real'])));
        }

        return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real']));
    }
public static function IMARGUMENT($complexNumber)
    {
        $complexNumber = Functions::flattenSingleValue($complexNumber);
        $parsedComplex = self::parseComplex($complexNumber);
        if ($parsedComplex['real'] == 0.0) {
            if ($parsedComplex['imaginary'] == 0.0) {
                return Functions::DIV0();
            } elseif ($parsedComplex['imaginary'] < 0.0) {
                return M_PI / -2;
            }

            return M_PI / 2;
        } elseif ($parsedComplex['real'] > 0.0) {
            return atan($parsedComplex['imaginary'] / $parsedComplex['real']);
        } elseif ($parsedComplex['imaginary'] < 0.0) {
            return 0 - (M_PI - atan(abs($parsedComplex['imaginary']) / abs($parsedComplex['real'])));
        }

        return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real']));
    }
public static function IMARGUMENT ( $ complexNumber ) { $ complexNumber = Functions :: flattenSingleValue ( $ complexNumber ) ; $ parsedComplex = self :: parseComplex ( $ complexNumber ) ; if ( $ parsedComplex [ 'real' ] == 0.0 ) { if ( $ parsedComplex [ 'imaginary' ] == 0.0 ) { return Functions :: DIV0 ( ) ; } elseif ( $ parsedComplex [ 'imaginary' ] < 0.0 ) { return M_PI / - 2 ; } return M_PI / 2 ; } elseif ( $ parsedComplex [ 'real' ] > 0.0 ) { return atan ( $ parsedComplex [ 'imaginary' ] / $ parsedComplex [ 'real' ] ) ; } elseif ( $ parsedComplex [ 'imaginary' ] < 0.0 ) { return 0 - ( M_PI - atan ( abs ( $ parsedComplex [ 'imaginary' ] ) / abs ( $ parsedComplex [ 'real' ] ) ) ) ; } return M_PI - atan ( $ parsedComplex [ 'imaginary' ] / abs ( $ parsedComplex [ 'real' ] ) ) ; }
IMARGUMENT.

Returns the argument theta of a complex number, i.e. the angle in radians from the real
axis to the representation of the number in polar coordinates.

Excel Function:
IMARGUMENT(complexNumber)

@param string $complexNumber the complex number for which you want the argument theta

@return float
IMARGUMENT .