def transformCoordinatesList(xIn : list, transformationMatrix, translation):
    """
    Transforms coordinates by multiplying by 9-component transformationMatrix
    then offsetting by translation.
    :xIn: List of 3-D coordinates to transform:
    :return: List of 3-D transformed coordinates.
    """
    assert (len(xIn) > 0) and (len(xIn[0]) == 3) and (len(transformationMatrix) == 9) and (len(translation) == 3)
    xOut = []
    for x in xIn:
        x2 = []
        for c in range(3):
            v = translation[c]
            for d in range(3):
                v += transformationMatrix[c*3 + d]*x[d]
            x2.append(v)
        xOut.append(x2)
    return xOut