def create_rotation_matrix()

in utils/base_tools.py [0:0]


def create_rotation_matrix(alpha, axis):
    alpha = alpha / 180 * math.pi
    c = torch.cos(alpha)
    s = torch.sin(alpha)
    rot_2d = torch.as_tensor([[c, -s], [s, c]], dtype=torch.float, device=device)
    rot_3d = my_eye(3)
    idx = [i for i in range(3) if i != axis]
    for i in range(len(idx)):
        for j in range(len(idx)):
            rot_3d[idx[i], idx[j]] = rot_2d[i, j]
    return rot_3d