NormalizeAngle.java 597B

1234567891011121314151617181920212223242526272829
  1. public class NormalizeAngle {
  2. public Integer normalizeValueUsingModulo(Integer angle){
  3. Integer normalizedAngle = mod360(angle);
  4. if(normalizedAngle<0){
  5. normalizedAngle = normalizedAngle * (-1);
  6. }
  7. return normalizedAngle;
  8. }
  9. public Integer mod360 (Integer angle){
  10. Integer modulus360 = angle%360;
  11. return modulus360;
  12. }
  13. public Integer normalizeValueUsingFloorMod(Integer integer){
  14. int x = Math.floorMod(integer, 360);
  15. return x;
  16. }
  17. public static void main(String[] args){
  18. }
  19. }