def translate(value, leftMin, leftMax, rightMin, rightMax):
    """
    Normalize the data in range rightMin and rightMax
    :param value: Value to be normalize
    :param leftMin: original min value
    :param leftMax: original max value
    :param rightMin: final min value
    :param rightMax: final max value
    :return: Normalized value
    """
    leftSpan = leftMax - leftMin
    rightSpan = rightMax - rightMin
    valueScaled = float(value - leftMin) / float(leftSpan)
    return rightMin + (valueScaled * rightSpan)