Android examples for java.lang:Math Trigonometric Function
Normalize an angle so that it is between 0 and 360.
//package com.java2s; public class Main { /**/* w w w.jav a 2 s . co m*/ * Normalize an angle so that it is between 0 and 360. * * @param angle Angle in degrees to normalize * @return Normalized angle. */ public static float normalize(final float angle) { return (angle >= 0 ? angle : (360 - ((-angle) % 360))) % 360; } }