public function cross(Vector $b) : self
    {
        if ($this->n !== 3 or $b->size() !== 3) {
            throw new DimensionalityMismatchException('Cross product is'
                . ' only defined for vectors of 3 dimensions.');
        }

        $c = [];

        $c[] = ($this->a[1] * $b[2]) - ($this->a[2] * $b[1]);
        $c[] = ($this->a[2] * $b[0]) - ($this->a[0] * $b[2]);
        $c[] = ($this->a[0] * $b[1]) - ($this->a[1] * $b[0]);

        return static::quick($c);
    }
public function cross(Vector $b) : self
    {
        if ($this->n !== 3 or $b->size() !== 3) {
            throw new DimensionalityMismatchException('Cross product is'
                . ' only defined for vectors of 3 dimensions.');
        }

        $c = [];

        $c[] = ($this->a[1] * $b[2]) - ($this->a[2] * $b[1]);
        $c[] = ($this->a[2] * $b[0]) - ($this->a[0] * $b[2]);
        $c[] = ($this->a[0] * $b[1]) - ($this->a[1] * $b[0]);

        return static::quick($c);
    }
public function cross ( Vector $ b ) : self { if ( $ this -> n !== 3 or $ b -> size ( ) !== 3 ) { throw new DimensionalityMismatchException ( 'Cross product is' . ' only defined for vectors of 3 dimensions.' ) ; } $ c = [ ] ; $ c [ ] = ( $ this -> a [ 1 ] * $ b [ 2 ] ) - ( $ this -> a [ 2 ] * $ b [ 1 ] ) ; $ c [ ] = ( $ this -> a [ 2 ] * $ b [ 0 ] ) - ( $ this -> a [ 0 ] * $ b [ 2 ] ) ; $ c [ ] = ( $ this -> a [ 0 ] * $ b [ 1 ] ) - ( $ this -> a [ 1 ] * $ b [ 0 ] ) ; return static :: quick ( $ c ) ; }
Calculate the cross product between two 3 dimensional vectors.

@param \Rubix\Tensor\Vector $b
@throws \Rubix\Tensor\Exceptions\DimensionalityMismatchException
@return self
Calculate the cross product between two 3 dimensional vectors .