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

Barycentric() public static method

Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
public static Barycentric ( Vector2 &value1, Vector2 &value2, Vector2 &value3, float amount1, float amount2, Vector2 &result ) : void
value1 Vector2 A Vector2 containing the 2D Cartesian coordinates of vertex 1 of the triangle.
value2 Vector2 A Vector2 containing the 2D Cartesian coordinates of vertex 2 of the triangle.
value3 Vector2 A Vector2 containing the 2D Cartesian coordinates of vertex 3 of the triangle.
amount1 float Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).
amount2 float Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).
result Vector2 [OutAttribute] The 2D Cartesian coordinates of the specified point are placed in this Vector2 on exit.
return void
        public static void Barycentric(ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, float amount1, float amount2, out Vector2 result)
        {
            result.X = value1.X + amount1 * (value2.X - value1.X) + amount2 * (value3.X - value1.X);
            result.Y = value1.Y + amount1 * (value2.Y - value1.Y) + amount2 * (value3.Y - value1.Y);
        }
        /// <summary>Interpolates between two values using a cubic equation.</summary>

Same methods

Vector2::Barycentric ( Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2 ) : Vector2