src/Chippyash/Math/Type/Calculator/Native.php
public function complexMul(ComplexType $a, ComplexType $b)
    {
        $r = $this->rationalSub(
            $this->rationalMul($a->r(), $b->r()),
            $this->rationalMul($a->i(), $b->i())
        );
        $i = $this->rationalAdd(
            $this->rationalMul($a->i(), $b->r()),
            $this->rationalMul($a->r(), $b->i())
        );
        return ComplexTypeFactory::create($r, $i);
    }
public function complexMul(ComplexType $a, ComplexType $b)
    {
        $r = $this->rationalSub(
            $this->rationalMul($a->r(), $b->r()),
            $this->rationalMul($a->i(), $b->i())
        );
        $i = $this->rationalAdd(
            $this->rationalMul($a->i(), $b->r()),
            $this->rationalMul($a->r(), $b->i())
        );
        return ComplexTypeFactory::create($r, $i);
    }
public function complexMul ( ComplexType $ a , ComplexType $ b ) { $ r = $ this -> rationalSub ( $ this -> rationalMul ( $ a -> r ( ) , $ b -> r ( ) ) , $ this -> rationalMul ( $ a -> i ( ) , $ b -> i ( ) ) ) ; $ i = $ this -> rationalAdd ( $ this -> rationalMul ( $ a -> i ( ) , $ b -> r ( ) ) , $ this -> rationalMul ( $ a -> r ( ) , $ b -> i ( ) ) ) ; return ComplexTypeFactory :: create ( $ r , $ i ) ; }
Complex number multiplication

@param ComplexType $a first operand
@param ComplexType $b second operand

@return ComplexType
Complex number multiplication