Here you can find the source of interpolateYawDegrees(float angle1, float ratio1, float angle2, float ratio2)
public static float interpolateYawDegrees(float angle1, float ratio1, float angle2, float ratio2)
//package com.java2s; //License from project: Open Source License public class Main { public static float interpolateYawDegrees(float angle1, float ratio1, float angle2, float ratio2) { if (Math.abs(angle1 - angle2) > 180) { if (angle2 > angle1) { angle2 -= 360;/*w w w .j ava 2s.c om*/ } else { angle1 -= 360; } } return angle1 * ratio1 + angle2 * ratio2; } }