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 - Math.Abs(t - length)); }