Hermite() public static method

public static Hermite ( double value1, double tangent1, double value2, double tangent2, double amount ) : double
value1 double
tangent1 double
value2 double
tangent2 double
amount double
return double
コード例 #1
0
        public static double SmoothStep(double value1, double value2, double amount)
        {
            // It is expected that 0 < amount < 1
            // If amount < 0, return value1
            // If amount > 1, return value2
            double result = Utils.Clamp(amount, 0f, 1f);

            return(Utils.Hermite(value1, 0f, value2, 0f, result));
        }
コード例 #2
0
        public static float SmoothStep(float value1, float value2, float amount)
        {
            // It is expected that 0 < amount < 1
            // If amount < 0, return value1
            // If amount > 1, return value2
            float result = Utils.Clamp(amount, 0f, 1f);

            return(Utils.Hermite(value1, 0f, value2, 0f, result));
        }