def __mul__(self, rhs):
    """
    Multiplies *self* with the #Quaternion *rhs* and returns a new #Quaternion.
    """

    if not isinstance(rhs, Quaternion):
      raise TypeError('can only multiply with Quaternion')
    return Quaternion(
      self.w * rhs.x + self.x * rhs.w + self.y * rhs.z - self.z * rhs.y,
      self.w * rhs.y - self.x * rhs.z + self.y * rhs.w + self.z * rhs.x,
      self.w * rhs.z + self.x * rhs.y - self.y * rhs.x + self.z * rhs.w,
      self.w * rhs.w - self.x * rhs.x - self.y * rhs.y - self.z * rhs.z)
def __mul__ ( self , rhs ) : if not isinstance ( rhs , Quaternion ) : raise TypeError ( 'can only multiply with Quaternion' ) return Quaternion ( self . w * rhs . x + self . x * rhs . w + self . y * rhs . z - self . z * rhs . y , self . w * rhs . y - self . x * rhs . z + self . y * rhs . w + self . z * rhs . x , self . w * rhs . z + self . x * rhs . y - self . y * rhs . x + self . z * rhs . w , self . w * rhs . w - self . x * rhs . x - self . y * rhs . y - self . z * rhs . z )
Multiplies *self* with the #Quaternion *rhs* and returns a new #Quaternion.