Skip to content
Snippets Groups Projects
NormalizationStrategy.cpp 363 B
Newer Older
  • Learn to ignore specific revisions
  • //
    // Created by martin on 21.11.18.
    //
    
    #include "NormalizationStrategy.h"
    
    DoubleUnitStrategy::DoubleUnitStrategy() {}
    
    double DoubleUnitStrategy::normalize(double n, double max, double min) {
        return 2*(n - min)/(max - min) - 1;
    
    }
    
    double DoubleUnitStrategy::de_normalize(double n, double max, double min) {
        return 0.5 * (1 + (max - min) * n) + min;
    }