Microsoft.Xna.Framework.Vector2.SmoothStep C# (CSharp) Method

SmoothStep() public static method

Interpolates between two values using a cubic equation.
public static SmoothStep ( Vector2 value1, Vector2 value2, float amount ) : Vector2
value1 Vector2 Source value.
value2 Vector2 Source value.
amount float Weighting value.
return Vector2
        public static Vector2 SmoothStep(Vector2 value1, Vector2 value2, float amount)
        {
            amount = ((amount > 1f) ? 1f : ((amount < 0f) ? 0f : amount));
            amount = amount * amount * (3f - 2f * amount);
            Vector2 result;
            result.X = value1.X + (value2.X - value1.X) * amount;
            result.Y = value1.Y + (value2.Y - value1.Y) * amount;
            return result;
        }
        /// <summary>Interpolates between two values using a cubic equation.</summary>

Same methods

Vector2::SmoothStep ( Vector2 &value1, Vector2 &value2, float amount, Vector2 &result ) : void