/// <summary>
 /// Returns a point in barycentric coordinates, using specified 2-D vectors.
 /// </summary>
 /// <param name="v1">Source TGCVector2.</param>
 /// <param name="v2">Source TGCVector2.</param>
 /// <param name="v3">Source TGCVector2.</param>
 /// <param name="f">Weighting factor.</param>
 /// <param name="g">Weighting factor.</param>
 /// <returns>A TGCVector2 in barycentric coordinates.</returns>
 public static TGCVector2 BaryCentric(TGCVector2 v1, TGCVector2 v2, TGCVector2 v3, float f, float g)
 {
     return(new TGCVector2(Vector2.BaryCentric(v1.ToVector2(), v2.ToVector2(), v3.ToVector2(), f, g)));
 }
 /// <summary>
 /// Adds two 2-D vectors.
 /// </summary>
 /// <param name="v">Source TGCVector2.</param>
 public void Add(TGCVector2 v)
 {
     this.dxVector2.Add(v.ToVector2());
 }
 /// <summary>
 /// Adds two 2-D vectors.
 /// </summary>
 /// <param name="left">Source TGCVector2.</param>
 /// <param name="right">Source TGCVector2.</param>
 /// <returns>Sum of the two source TGCVector2.</returns>
 public static TGCVector2 Add(TGCVector2 left, TGCVector2 right)
 {
     return(new TGCVector2(Vector2.Add(left.ToVector2(), right.ToVector2())));
 }
 /// <summary>
 /// Subtracts two 2-D vectors.
 /// </summary>
 /// <param name="left">Source TGCVector2 to the left of the subtraction operator.</param>
 /// <param name="right">Source TGCVector2 to the right of the subtraction operator.</param>
 /// <returns>A TGCVector2 that is the result of the operation.</returns>
 public static TGCVector2 Subtract(TGCVector2 left, TGCVector2 right)
 {
     return(new TGCVector2(Vector2.Subtract(left.ToVector2(), right.ToVector2())));
 }
 /// <summary>
 /// Transforms the 2-D vector normal by a given matrix.
 /// </summary>
 /// <param name="source">Source TGCVector2.</param>
 /// <param name="sourceMatrix">Source TGCMatrix.</param>
 /// <returns>A TGCVector2 that contains the results of this method.</returns>
 public static TGCVector2 TransformNormal(TGCVector2 source, TGCMatrix sourceMatrix)
 {
     return(new TGCVector2(Vector2.TransformNormal(source.ToVector2(), sourceMatrix.ToMatrix())));
 }
 /// <summary>
 /// Scales a 2-D vector.
 /// </summary>
 /// <param name="source">Source TGCVector2.</param>
 /// <param name="scalingFactor">Scaling value.</param>
 /// <returns>A TGCVector2 that is the scaled vector.</returns>
 public static TGCVector2 Scale(TGCVector2 source, float scalingFactor)
 {
     return(new TGCVector2(Vector2.Scale(source.ToVector2(), scalingFactor)));
 }
 /// <summary>
 /// Subtracts two 2-D vectors.
 /// </summary>
 /// <param name="source">Source TGCVector2 to subtract from the current TGCVector2 instance.</param>
 public void Subtract(TGCVector2 source)
 {
     this.dxVector2.Subtract(source.ToVector2());
 }
 /// <summary>
 /// Multiplies the current 2-D vector with a single value.
 /// </summary>
 /// <param name="source">Source TGCVector2.</param>
 /// <param name="s">Source float value.</param>
 /// <returns>A TGCVector2 that is the result of the source parameter multiplied by the s parameter.</returns>
 public static TGCVector2 Multiply(TGCVector2 source, float s)
 {
     return(new TGCVector2(Vector2.Multiply(source.ToVector2(), s)));
 }
 /// <summary>
 /// Returns the normalized version of a 2-D vector.
 /// </summary>
 /// <param name="source">Source TGCVector2.</param>
 /// <returns>A Vector2 that is the normalized version of the vector.</returns>
 public static TGCVector2 Normalize(TGCVector2 source)
 {
     return(new TGCVector2(Vector2.Normalize(source.ToVector2())));
 }
Beispiel #10
0
 /// <summary>
 /// Returns a 2-D vector that is made up of the smallest components of two 2-D vectors.
 /// </summary>
 /// <param name="source">Source TGCVector2.</param>
 public void Minimize(TGCVector2 source)
 {
     this.dxVector2.Minimize(source.ToVector2());
 }
Beispiel #11
0
 /// <summary>
 /// Returns a 2-D vector that is made up of the smallest components of two 2-D vectors.
 /// </summary>
 /// <param name="left">Source TGCVector2.</param>
 /// <param name="right">Source TGCVector2.</param>
 /// <returns>A TGCVector2 that is made up of the smallest components of the two vectors.</returns>
 public static TGCVector2 Minimize(TGCVector2 left, TGCVector2 right)
 {
     return(new TGCVector2(Vector2.Minimize(left.ToVector2(), right.ToVector2())));
 }
Beispiel #12
0
 /// <summary>
 /// Performs a linear interpolation between two 2-D vectors.
 /// </summary>
 /// <param name="left">Source TGCVector2.</param>
 /// <param name="right">Source TGCVector2.</param>
 /// <param name="interpolater">Parameter that linearly interpolates between the vectors.</param>
 /// <returns></returns>
 public static TGCVector2 Lerp(TGCVector2 left, TGCVector2 right, float interpolater)
 {
     return(new TGCVector2(Vector2.Lerp(left.ToVector2(), right.ToVector2(), interpolater)));
 }
Beispiel #13
0
 /// <summary>
 /// Returns the square of the length of a 2-D vector.
 /// </summary>
 /// <param name="source">Source TGCVector2.</param>
 /// <returns>Vector's squared length.</returns>
 public static float LengthSq(TGCVector2 source)
 {
     return(Vector2.LengthSq(source.ToVector2()));
 }
Beispiel #14
0
 /// <summary>
 /// Performs a Hermite spline interpolation using specified 2-D vectors.
 /// </summary>
 /// <param name="position">Source TGCVector2 that is a position vector.</param>
 /// <param name="tangent">Source TGCVector2 that is a tangent vector.</param>
 /// <param name="position2">Source TGCVector2 that is a position vector.</param>
 /// <param name="tangent2">Source TGCVector2 that is a tangent vector.</param>
 /// <param name="weightingFactor">Weighting factor.</param>
 /// <returns>A TGCVector2 that is the result of the Hermite spline interpolation.</returns>
 public static TGCVector2 Hermite(TGCVector2 position, TGCVector2 tangent, TGCVector2 position2,
                                  TGCVector2 tangent2, float weightingFactor)
 {
     return(new TGCVector2(Vector2.Hermite(position.ToVector2(), tangent.ToVector2(), position2.ToVector2(), tangent2.ToVector2(), weightingFactor)));
 }
Beispiel #15
0
 /// <summary>
 /// Determines the dot product of two 2-D vectors.
 /// </summary>
 /// <param name="left">Source TGCVector2.</param>
 /// <param name="right">Source TGCVector2.</param>
 /// <returns>Dot product.</returns>
 public static float Dot(TGCVector2 left, TGCVector2 right)
 {
     return(Vector2.Dot(left.ToVector2(), right.ToVector2()));
 }
Beispiel #16
0
 /// <summary>
 /// Performs a Catmull-Rom interpolation using specified 2-D vectors.
 /// </summary>
 /// <param name="position1">Source TGCVector2 that is a position vector.</param>
 /// <param name="position2">Source TGCVector2 that is a position vector.</param>
 /// <param name="position3">Source TGCVector2 that is a position vector.</param>
 /// <param name="position4">Source TGCVector2 that is a position vector.</param>
 /// <param name="weightingFactor">Weighting factor.</param>
 /// <returns></returns>
 public static TGCVector2 CatmullRom(TGCVector2 position1, TGCVector2 position2, TGCVector2 position3,
                                     TGCVector2 position4, float weightingFactor)
 {
     return(new TGCVector2(Vector2.CatmullRom(position1.ToVector2(), position2.ToVector2(), position3.ToVector2(), position4.ToVector2(), weightingFactor)));
 }