Exemple #1
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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 public static Vector2d Lerp(Vector2d from, Vector2d to, double t)
 {
     t = Mathd.Clamp01(t);
     return(new Vector2d(from.x + (to.x - from.x) * t, from.y + (to.y - from.y) * t));
 }
Exemple #4
0
 public static double SmoothStep(double from, double to, double t)
 {
     t = Mathd.Clamp01(t);
     t = (-2.0 * t * t * t + 3.0 * t * t);
     return(to * t + from * (1.0 - t));
 }
Exemple #5
0
 public static double Lerp(double from, double to, double t)
 {
     return(from + (to - from) * Mathd.Clamp01(t));
 }
Exemple #6
0
 public static Vector3Double Lerp(Vector3Double from, Vector3Double to, double t)
 {
     t = Mathd.Clamp01(t);
     return(new Vector3Double(from.x + (to.x - from.x) * t, from.y + (to.y - from.y) * t, from.z + (to.z - from.z) * t));
 }
Exemple #7
0
 public static DVector2 Lerp(DVector2 from, DVector2 to, double t)
 {
     t = Mathd.Clamp01(t);
     return(new DVector2(from.x + (to.x - from.x) * t, from.y + (to.y - from.y) * t));
 }
Exemple #8
0
 public static float SmoothStep(float from, float to, float t)
 {
     t = Mathd.Clamp01(t);
     t = (-2.0f * t * t * t + 3.0f * t * t);
     return(to * t + from * (1.0f - t));
 }
Exemple #9
0
 public static float Lerp(float from, float to, float t)
 {
     return(from + (to - from) * Mathd.Clamp01(t));
 }
Exemple #10
0
 public static DVector3 Lerp(DVector3 from, DVector3 to, double t)
 {
     t = Mathd.Clamp01(t);
     return(new DVector3(from.x + (to.x - from.x) * t, from.y + (to.y - from.y) * t, from.z + (to.z - from.z) * t));
 }