def normalize_angle_positive(angle): """ map an angle from 0 to 2pi """ return fmod(fmod(angle, 2.0*pi) + 2.0*pi, 2.0*pi) # map to -pi to +pi