예제 #1
0
        public static double DeltaAngle(double current, double target)
        {
            double num = Mathd.Repeat(target - current, 360d);

            if (num > 180.0d)
            {
                num -= 360d;
            }
            return(num);
        }
예제 #2
0
        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));
        }
예제 #3
0
 public static double PingPong(double t, double length)
 {
     t = Mathd.Repeat(t, length * 2d);
     return(length - Mathd.Abs(t - length));
 }