Here you can find the source of LerpDegrees(float start, float end, float amount)
public static float LerpDegrees(float start, float end, float amount)
//package com.java2s; //License from project: Open Source License public class Main { public static float LerpDegrees(float start, float end, float amount) { float difference = Math.abs(end - start); if (difference > 180) { // We need to add on to one of the values. if (end > start) { // We'll add it on to start... start += 360;/*from w w w . j ava2s. c o m*/ } else { // Add it on to end. end += 360; } } // Interpolate it. float value = (start + ((end - start) * amount)); // Wrap it.. float rangeZero = 360; if (value >= 0 && value <= 360) return value; return (value % rangeZero); } }