NormalizeAngle.java 530B

12345678910111213141516171819202122232425
  1. public class NormalizeAngle {
  2. public Integer normalizeValueUsingModulo(Integer angle){
  3. int newAngle = angle;
  4. while(newAngle < 0) newAngle += 360;
  5. while(newAngle > 359) newAngle -= 360;
  6. return newAngle;
  7. }
  8. public Integer normalizeValueUsingFloorMod(Integer integer){
  9. int normalize1 = Math.floorMod(integer, 360);
  10. return normalize1;
  11. }
  12. public static void main(String[] args){
  13. NormalizeAngle norangle = new NormalizeAngle();
  14. }
  15. }