public static function div($z, $w) {
        if (!($z instanceof Complex)) $z = static::parse($z);
        if (!($w instanceof Complex)) $w = static::parse($w);

        $d = $w->x * $w->x + $w->y * $w->y;

        if ($d == 0) throw new DivisionByZeroException();

        return static::create(($z->x * $w->x + $z->y * $w->y)/$d, (-$z->x * $w->y + $z->y * $w->x)/$d);
    }
public static function div($z, $w) {
        if (!($z instanceof Complex)) $z = static::parse($z);
        if (!($w instanceof Complex)) $w = static::parse($w);

        $d = $w->x * $w->x + $w->y * $w->y;

        if ($d == 0) throw new DivisionByZeroException();

        return static::create(($z->x * $w->x + $z->y * $w->y)/$d, (-$z->x * $w->y + $z->y * $w->x)/$d);
    }
public static function div ( $ z , $ w ) { if ( ! ( $ z instanceof Complex ) ) $ z = static :: parse ( $ z ) ; if ( ! ( $ w instanceof Complex ) ) $ w = static :: parse ( $ w ) ; $ d = $ w -> x * $ w -> x + $ w -> y * $ w -> y ; if ( $ d == 0 ) throw new DivisionByZeroException ( ) ; return static :: create ( ( $ z -> x * $ w -> x + $ z -> y * $ w -> y ) / $ d , ( - $ z -> x * $ w -> y + $ z -> y * $ w -> x ) / $ d ) ; }
divide two complex numbers

Complex::div($z, $w) computes and returns $z/$w


@param mixed $z (Complex, or parsable to Complex)
@param mixed $w (Complex, or parsable to Complex)
@retval Complex
divide two complex numbers