public static double DeltaAngle(double current, double target) { double num = Mathd.Repeat(target - current, 360d); if (num > 180.0d) { num -= 360d; } return(num); }
public static double LerpAngle(double a, double b, double t) { double num = Mathd.Repeat(b - a, 360d); if (num > 180.0d) { num -= 360d; } return(a + num * Mathd.Clamp01(t)); }
public static double PingPong(double t, double length) { t = Mathd.Repeat(t, length * 2d); return(length - Mathd.Abs(t - length)); }