(cls, array)
return self
Initiate a new QUAT from an array-like object.

        The first axis of the array is assumed to correspond to the elements
        of the algebra, and needs to have the same length. Any other dimensions
        are left unchanged, and should have simple operations such as addition 
        and multiplication defined. NumPy arrays are therefore a perfect 
        candidate. 

        :param array: array-like object whose length is the dimension of the algebra.
        :return: new instance of QUAT.
Initiate a new QUAT from an array-like object.
Initiate a new QUAT from an array - like object .
def fromarray(cls, array):
        """Initiate a new QUAT from an array-like object.

        The first axis of the array is assumed to correspond to the elements
        of the algebra, and needs to have the same length. Any other dimensions
        are left unchanged, and should have simple operations such as addition 
        and multiplication defined. NumPy arrays are therefore a perfect 
        candidate. 

        :param array: array-like object whose length is the dimension of the algebra.
        :return: new instance of QUAT.
        """
        self = cls()
        if len(array) != len(self):
            raise TypeError('length of array must be identical to the dimension '
                            'of the algebra.')
        self.mvec = array
        return self
def fromarray ( cls , array ) : self = cls ( ) if len ( array ) != len ( self ) : raise TypeError ( 'length of array must be identical to the dimension ' 'of the algebra.' ) self . mvec = array return self