def rotate(self, vec):
    """
    Returns *vec* rotated by this #Quaternion.

    :param vec: A vector object.
    :return: object of type of *vec*
    """

    qvec = self * Quaternion(vec.x, vec.y, vec.z, 0) * ~self
    return type(vec)(qvec.x, qvec.y, qvec.z)
Returns *vec* rotated by this #Quaternion.

    :param vec: A vector object.
    :return: object of type of *vec*