Here you can find the source of angleRadToDegClipped(final double angleRad)
public static int angleRadToDegClipped(final double angleRad)
//package com.java2s; //License from project: Open Source License public class Main { public static int angleRadToDegClipped(final double angleRad) { final int degUnclipped = (int) (Math.toDegrees(angleRad) + 0.5); // Make sure return value is in [0, 360) as required by game engine. return ((degUnclipped % 360) + 360) % 360; }/*from www.j av a 2s.c om*/ }