Here you can find the source of angleAdd(int i, final int i1)
Parameter | Description |
---|---|
i | the angle |
i1 | the value to increment |
public static int angleAdd(int i, final int i1)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w .j av a 2s. c om*/ * Increments to angle (degrees), wrapping around if necessary * * @param i the angle * @param i1 the value to increment * @return angle, snapped if necessary */ public static int angleAdd(int i, final int i1) { i += i1; while (i >= 360) { i -= 360; } while (i < 0) { i += 360; } return i; } }