def makeW(r1, r2, r3, r4=0):
    """
    matrix involved in quaternion rotation
    """
    W = np.asarray([
        [r4, r3, -r2, r1],
        [-r3, r4, r1, r2],
        [r2, -r1, r4, r3],
        [-r1, -r2, -r3, r4]])
    return W
def makeW ( r1 , r2 , r3 , r4 = 0 ) : W = np . asarray ( [ [ r4 , r3 , - r2 , r1 ] , [ - r3 , r4 , r1 , r2 ] , [ r2 , - r1 , r4 , r3 ] , [ - r1 , - r2 , - r3 , r4 ] ] ) return W
matrix involved in quaternion rotation