def rescale(OldValue,OldMin,OldMax,NewMin,NewMax):
    """
    # =============================================================================
    #  rescale(OldValue,OldMin,OldMax,NewMin,NewMax)
    # =============================================================================
    this function rescale a value between two boundaries to a new value bewteen two 
    other boundaries
    inputs:
        1-OldValue:
            [float] value need to transformed
        2-OldMin:
            [float] min old value
        3-OldMax:
            [float] max old value
        4-NewMin:
            [float] min new value
        5-NewMax:
            [float] max new value
    output:
        1-NewValue:
            [float] transformed new value
        
    """
    OldRange = (OldMax - OldMin)  
    NewRange = (NewMax - NewMin)  
    NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin
    
    return NewValue