NormalizeAngle.java 404B

12345678910111213141516
  1. public class NormalizeAngle {
  2. public Integer normalizeValueUsingModulo(Integer angle){
  3. angle = angle % 360;
  4. return angle >= 0 ? angle : angle + 360;
  5. }
  6. public Integer normalizeValueUsingFloorMod(Integer integer){
  7. integer = Math.floorMod(integer, 360);
  8. return integer >= 0 ? integer : integer + 360;
  9. }
  10. public static void main(String[] args){
  11. }
  12. }