def quaternion_about_axis(angle, axis):
    quaternion = numpy.zeros((4, ), dtype=numpy.float64)
    quaternion[:3] = axis[:3]
    qlen = vector_norm(quaternion)
    if qlen > _EPS:
        quaternion *= math.sin(angle/2.0) / qlen
    quaternion[3] = math.cos(angle/2.0)
    return quaternion
Return quaternion for rotation about axis.
dataset/ETHPy150Open omangin/multimodal/multimodal/lib/transformations.py/quaternion_about_axis