util.js 178 B

12345678910111213
  1. var PI2 = Math.PI * 2;
  2. function normalizeRadian(angle) {
  3. angle %= PI2;
  4. if (angle < 0) {
  5. angle += PI2;
  6. }
  7. return angle;
  8. }
  9. exports.normalizeRadian = normalizeRadian;