def quaternion_about_axis(angle, axis):
 q = numpy.array([0.0, axis[0], axis[1], axis[2]])
 qlen = vector_norm(q)
 if (qlen > _EPS):
  q *= (math.sin((angle / 2.0)) / qlen)
 q[0] = math.cos((angle / 2.0))
 return q

def quaternion_about_axis ( angle , axis ) : q = numpy . array ( [ 0.0 , axis [ 0 ] , axis [ 1 ] , axis [ 2 ] ] ) qlen = vector_norm ( q ) if ( qlen > _EPS ) : q *= ( math . sin ( ( angle / 2.0 ) ) / qlen ) q [ 0 ] = math . cos ( ( angle / 2.0 ) ) return q
return quaternion for rotation about axis .