Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Vector2 Methods

The Vector2 type exposes the following members.

  Name Description
Public method Static member Add(Vector2, Vector2) Adds two vectors.
Public method Static member Add(Vector2, Vector2, Vector2) Adds two vectors.
Public method Static member Barycentric(Vector2, Vector2, Vector2, Single, Single) Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
Public method Static member Barycentric(Vector2, Vector2, Vector2, Single, Single, Vector2) Returns a Vector2 containing the 2D Cartesian coordinates of a point specified in barycentric (areal) coordinates relative to a 2D triangle.
Public method Static member CatmullRom(Vector2, Vector2, Vector2, Vector2, Single) Performs a Catmull-Rom interpolation using the specified positions.
Public method Static member CatmullRom(Vector2, Vector2, Vector2, Vector2, Single, Vector2) Performs a Catmull-Rom interpolation using the specified positions.
Public method Static member Clamp(Vector2, Vector2, Vector2) Restricts a value to be within a specified range.
Public method Static member Clamp(Vector2, Vector2, Vector2, Vector2) Restricts a value to be within a specified range.
Public method Static member Distance(Vector2, Vector2) Calculates the distance between two vectors.
Public method Static member Distance(Vector2, Vector2, Single) Calculates the distance between two vectors.
Public method Static member DistanceSquared(Vector2, Vector2) Calculates the distance between two vectors squared.
Public method Static member DistanceSquared(Vector2, Vector2, Single) Calculates the distance between two vectors squared.
Public method Static member Divide(Vector2, Vector2) Divides the components of a vector by the components of another vector.
Public method Static member Divide(Vector2, Single) Divides a vector by a scalar value.
Public method Static member Divide(Vector2, Vector2, Vector2) Divides the components of a vector by the components of another vector.
Public method Static member Divide(Vector2, Single, Vector2) Divides a vector by a scalar value.
Public method Static member Dot(Vector2, Vector2) Calculates the dot product of two vectors. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
Public method Static member Dot(Vector2, Vector2, Single) Calculates the dot product of two vectors and writes the result to a user-specified variable. If the two vectors are unit vectors, the dot product returns a floating point value between -1 and 1 that can be used to determine some properties of the angle between two vectors. For example, it can show whether the vectors are orthogonal, parallel, or have an acute or obtuse angle between them.
Public method Equals(Object) Determines whether the specified Object is equal to the current Vector2. (Overrides ValueType.Equals(Object).)
Public method Equals(Vector2) Determines whether the specified Vector2 is equal to the current Vector2.
Public method GetHashCode Gets the hash code of the vector object. (Overrides ValueType.GetHashCode().)
Public method Static member Hermite(Vector2, Vector2, Vector2, Vector2, Single) Performs a Hermite spline interpolation.
Public method Static member Hermite(Vector2, Vector2, Vector2, Vector2, Single, Vector2) Performs a Hermite spline interpolation.
Public method Length Calculates the length of the vector.
Public method LengthSquared Calculates the length of the vector squared.
Public method Static member Lerp(Vector2, Vector2, Single) Performs a linear interpolation between two vectors.
Public method Static member Lerp(Vector2, Vector2, Single, Vector2) Performs a linear interpolation between two vectors.
Public method Static member Max(Vector2, Vector2) Returns a vector that contains the highest value from each matching pair of components.
Public method Static member Max(Vector2, Vector2, Vector2) Returns a vector that contains the highest value from each matching pair of components.
Public method Static member Min(Vector2, Vector2) Returns a vector that contains the lowest value from each matching pair of components.
Public method Static member Min(Vector2, Vector2, Vector2) Returns a vector that contains the lowest value from each matching pair of components.
Public method Static member Multiply(Vector2, Vector2) Multiplies the components of two vectors by each other.
Public method Static member Multiply(Vector2, Single) Multiplies a vector by a scalar value.
Public method Static member Multiply(Vector2, Vector2, Vector2) Multiplies the components of two vectors by each other.
Public method Static member Multiply(Vector2, Single, Vector2) Multiplies a vector by a scalar value.
Public method Static member Negate(Vector2) Returns a vector pointing in the opposite direction.
Public method Static member Negate(Vector2, Vector2) Returns a vector pointing in the opposite direction.
Public method Normalize() Turns the current vector into a unit vector. The result is a vector one unit in length pointing in the same direction as the original vector.
Public method Static member Normalize(Vector2) Creates a unit vector from the specified vector. The result is a vector one unit in length pointing in the same direction as the original vector.
Public method Static member Normalize(Vector2, Vector2) Creates a unit vector from the specified vector, writing the result to a user-specified variable. The result is a vector one unit in length pointing in the same direction as the original vector.
Public method Static member Reflect(Vector2, Vector2) Determines the reflect vector of the given vector and normal.
Public method Static member Reflect(Vector2, Vector2, Vector2) Determines the reflect vector of the given vector and normal.
Public method Static member SmoothStep(Vector2, Vector2, Single) Interpolates between two values using a cubic equation.
Public method Static member SmoothStep(Vector2, Vector2, Single, Vector2) Interpolates between two values using a cubic equation.
Public method Static member Subtract(Vector2, Vector2) Subtracts a vector from a vector.
Public method Static member Subtract(Vector2, Vector2, Vector2) Subtracts a vector from a vector.
Public method ToString Retrieves a string representation of the current object. (Overrides ValueType.ToString().)
Public method Static member Transform(Vector2, Matrix) Transforms the vector (x, y, 0, 1) by the specified matrix.
Public method Static member Transform(Vector2, Quaternion) Transforms a single Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.
Public method Static member Transform(Vector2, Matrix, Vector2) Transforms a Vector2 by the given Matrix.
Public method Static member Transform(Vector2, Quaternion, Vector2) Transforms a Vector2, or the vector normal (x, y, 0, 0), by a specified Quaternion rotation.
Public method Static member Transform(Vector2[], Matrix, Vector2[]) Transforms an array of Vector2 instances by a specified Matrix.
Public method Static member Transform(Vector2[], Quaternion, Vector2[]) Transforms an array of Vector2 instances by a specified Quaternion.
Public method Static member Transform(Vector2[], Int32, Matrix, Vector2[], Int32, Int32) Transforms a specified range in an array of Vector2 instances by a specified Matrix and places the results in a specified range in a destination array.
Public method Static member Transform(Vector2[], Int32, Quaternion, Vector2[], Int32, Int32) Transforms a specified range in an array of Vector2 instances by a specified Quaternion and places the results in a specified range in a destination array.
Public method Static member TransformNormal(Vector2, Matrix) Transforms a 2D vector normal by a matrix.
Public method Static member TransformNormal(Vector2, Matrix, Vector2) Transforms a 2D vector normal by a matrix.
Public method Static member TransformNormal(Vector2[], Matrix, Vector2[]) Transforms an array of Vector2 vector normals by a specified Matrix.
Public method Static member TransformNormal(Vector2[], Int32, Matrix, Vector2[], Int32, Int32) Transforms a specified range in an array of Vector2 vector normals by a specified Matrix and places the results in a specified range in a destination array.
Top

Community Additions

ADD
Show:
© 2015 Microsoft