bowtie 0.2.0

2D Game engine with messaging system
Documentation
1
2
3
4
5
6
7
8
9
10
11
/*
 * Normalizes num to be between min and max
 */
pub fn normalize<T>(num: T, min: T, max: T) -> f32
where
  T: Into<f32> + Copy,
{
  (max.into() - min.into())
    * ((num.into() - min.into()) / (max.into() - min.into()))
    + min.into()
}