- Joined
- Nov 17, 2014
- Messages
- 4,906
- Thread Author
- #1
In the case that a randomly chosen angle is more than 359 or less than 0, instead of throwing an illegal argument exception, please add something like this:
Then use b for the angle.
Code:
public static boolean setYaw(final int a) {
int b = a;
while (b < 0 || b > 359) {
b += b < 0 ? 359 : -359;
}
}
Then use b for the angle.