(self, b)
Return the cross product of `self` and `b` relaxing the condition
        of compatible dimensions: if each has 3 elements, a matrix of the
        same type and shape as `self` will be returned. If `b` has the same
        shape as `self` then common identities for the cross product (like
        `a x b = - b x a`) will hold.

        See Also
        ========

        dot
        multiply
        multiply_elementwise
Return the cross product of `self` and `b` relaxing the condition
        of compatible dimensions: if each has 3 elements, a matrix of the
        same type and shape as `self` will be returned. If `b` has the same
        shape as `self` then common identities for the cross product (like
        `a x b = - b x a`) will hold.
Return the cross product of self and b relaxing the condition of compatible dimensions : if each has 3 elements a matrix of the same type and shape as self will be returned . If b has the same shape as self then common identities for the cross product ( like a x b = - b x a ) will hold .
def cross(self, b):
        """Return the cross product of `self` and `b` relaxing the condition
        of compatible dimensions: if each has 3 elements, a matrix of the
        same type and shape as `self` will be returned. If `b` has the same
        shape as `self` then common identities for the cross product (like
        `a x b = - b x a`) will hold.

        See Also
        ========

        dot
        multiply
        multiply_elementwise
        """
        if not is_sequence(b):
            raise TypeError("`b` must be an ordered iterable or Matrix, not %s." %
                type(b))
        if not (self.rows * self.cols == b.rows * b.cols == 3):
            raise ShapeError("Dimensions incorrect for cross product.")
        else:
            return self._new(self.rows, self.cols, (
                (self[1]*b[2] - self[2]*b[1]),
                (self[2]*b[0] - self[0]*b[2]),
                (self[0]*b[1] - self[1]*b[0])))
def cross ( self , b ) : if not is_sequence ( b ) : raise TypeError ( "`b` must be an ordered iterable or Matrix, not %s." % type ( b ) ) if not ( self . rows * self . cols == b . rows * b . cols == 3 ) : raise ShapeError ( "Dimensions incorrect for cross product." ) else : return self . _new ( self . rows , self . cols , ( ( self [ 1 ] * b [ 2 ] - self [ 2 ] * b [ 1 ] ) , ( self [ 2 ] * b [ 0 ] - self [ 0 ] * b [ 2 ] ) , ( self [ 0 ] * b [ 1 ] - self [ 1 ] * b [ 0 ] ) ) )