Exemple #1
0
 /// <summary>
 /// Creates a new <see cref="Vector2D"/> that contains linear interpolation of the specified vectors.
 /// </summary>
 /// <param name="value1">The first vector.</param>
 /// <param name="value2">The second vector.</param>
 /// <param name="amount">Weighting value(between 0.0 and 1.0).</param>
 /// <returns>The result of linear interpolation of the specified vectors.</returns>
 public static Vector2D Lerp(Vector2D value1, Vector2D value2, double amount)
 {
     return(new Vector2D(
                MathHelperD.Lerp(value1.X, value2.X, amount),
                MathHelperD.Lerp(value1.Y, value2.Y, amount)
                ));
 }
Exemple #2
0
 /// <summary>
 /// Creates a new <see cref="Vector2D"/> that contains linear interpolation of the specified vectors.
 /// </summary>
 /// <param name="value1">The first vector.</param>
 /// <param name="value2">The second vector.</param>
 /// <param name="amount">Weighting value(between 0.0 and 1.0).</param>
 /// <param name="result">The result of linear interpolation of the specified vectors as an output parameter.</param>
 public static void Lerp(
     ref Vector2D value1,
     ref Vector2D value2,
     double amount,
     out Vector2D result
     )
 {
     result.X = MathHelperD.Lerp(value1.X, value2.X, amount);
     result.Y = MathHelperD.Lerp(value1.Y, value2.Y, amount);
 }