Esempio n. 1
0
 /// <summary>
 /// Creates a new <see cref="Vector2D"/> that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 2d-triangle.
 /// </summary>
 /// <param name="value1">The first vector of 2d-triangle.</param>
 /// <param name="value2">The second vector of 2d-triangle.</param>
 /// <param name="value3">The third vector of 2d-triangle.</param>
 /// <param name="amount1">Barycentric scalar <c>b2</c> which represents a weighting factor towards second vector of 2d-triangle.</param>
 /// <param name="amount2">Barycentric scalar <c>b3</c> which represents a weighting factor towards third vector of 2d-triangle.</param>
 /// <param name="result">The cartesian translation of barycentric coordinates as an output parameter.</param>
 public static void Barycentric(
     ref Vector2D value1,
     ref Vector2D value2,
     ref Vector2D value3,
     double amount1,
     double amount2,
     out Vector2D result
     )
 {
     result.X = MathHelperD.Barycentric(value1.X, value2.X, value3.X, amount1, amount2);
     result.Y = MathHelperD.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2);
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a new <see cref="Vector2D"/> that contains the cartesian coordinates of a vector specified in barycentric coordinates and relative to 2d-triangle.
 /// </summary>
 /// <param name="value1">The first vector of 2d-triangle.</param>
 /// <param name="value2">The second vector of 2d-triangle.</param>
 /// <param name="value3">The third vector of 2d-triangle.</param>
 /// <param name="amount1">Barycentric scalar <c>b2</c> which represents a weighting factor towards second vector of 2d-triangle.</param>
 /// <param name="amount2">Barycentric scalar <c>b3</c> which represents a weighting factor towards third vector of 2d-triangle.</param>
 /// <returns>The cartesian translation of barycentric coordinates.</returns>
 public static Vector2D Barycentric(
     Vector2D value1,
     Vector2D value2,
     Vector2D value3,
     double amount1,
     double amount2
     )
 {
     return(new Vector2D(
                MathHelperD.Barycentric(value1.X, value2.X, value3.X, amount1, amount2),
                MathHelperD.Barycentric(value1.Y, value2.Y, value3.Y, amount1, amount2)
                ));
 }