normalize.py 184 B

1234567891011
  1. intMin = 100
  2. intMax = 900
  3. intLocation = 100
  4. intMin = -1
  5. intMax = 1
  6. normalized_x = int ( 2 * int ( int (intLocation - intMin) / int (intMax - intMin) ) ) - 1
  7. print ( normalized_x )