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 float DeltaAngle(float current, float target) { float num = Mathd.Repeat(target - current, 360f); if (num > 180.0d) { num -= 360f; } return(num); }
public static float LerpAngle(float a, float b, float t) { float num = Mathd.Repeat(b - a, 360f); if (num > 180.0f) { num -= 360f; } 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)); }
public static float PingPong(float t, float length) { t = Mathd.Repeat(t, length * 2f); return(length - Mathd.Abs(t - length)); }