You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Tools.cs 498 B

1234567891011121314151617181920
  1. using System;
  2. namespace Preparation.Utility
  3. {
  4. public static class Tools
  5. {
  6. public static double CorrectAngle(double angle) // 将幅角转化为主值0~2pi
  7. {
  8. if (double.IsNaN(angle) || double.IsInfinity(angle))
  9. {
  10. return 0.0;
  11. }
  12. while (angle < 0)
  13. angle += 2 * Math.PI;
  14. while (angle >= 2 * Math.PI)
  15. angle -= 2 * Math.PI;
  16. return angle;
  17. }
  18. }
  19. }