double Wrap(num value, num min, num max) { return value - (max - min)*((value - min)/(max - min)).floorToDouble(); }