Share via


Vector2 Structure (Microsoft.DirectX)

Describes and manipulates a vector in two-dimensional (2-D) space.

Definition

Visual Basic Public Structure Vector2
C# public struct Vector2 
C++ public value class Vector2 sealed 
JScript In JScript, you can use structures, but you cannot define your own.

Members Table

The following table lists the members exposed by the object.

Fields

Field Description
X Retrieves or sets the x component of a 2-D vector.
Y Retrieves or sets the y component of a 2-D vector.

Methods

Method Description
Add Adds two 2-D vectors.
static (Shared in Visual Basic) BaryCentric Returns a point in barycentric coordinates, using specified 2-D vectors.
static (Shared in Visual Basic) CatmullRom Performs a Catmull-Rom interpolation using specified 2-D vectors.
static (Shared in Visual Basic) Ccw Returns the z component by calculating the cross product of two 2-D vectors.
static (Shared in Visual Basic) Dot Determines the dot product of two 2-D vectors.
Equals Returns a value that indicates whether the current instance is equal to a specified object.
GetHashCode Returns the hash code for the current instance.
static (Shared in Visual Basic) Hermite Performs a Hermite spline interpolation using specified 2-D vectors.
Length Returns the length of a 2-D vector.
LengthSq Returns the square of the length of a 2-D vector.
static (Shared in Visual Basic) Lerp Performs a linear interpolation between two 2-D vectors.
Maximize Returns a 2-D vector that is made up of the largest components of two 2-D vectors.
Minimize Returns a 2-D vector that is made up of the smallest components of two 2-D vectors.
Multiply Multiplies the current 2-D vector with a single value.
Normalize Returns the normalized version of a 2-D vector.
static (Shared in Visual Basic) op_Addition Adds two 2-D vectors.
static (Shared in Visual Basic) op_Equality Compares the current instance of a class to another instance to determine whether they are the same.
static (Shared in Visual Basic) op_Inequality Compares the current instance of a class to another instance to determine whether they are different.
static (Shared in Visual Basic) op_Multiply Determines the product of a single value and a 2-D vector.
static (Shared in Visual Basic) op_Subtraction Subtracts two 2-D vectors.
static (Shared in Visual Basic) op_UnaryNegation Negates the vector.
Scale Scales a 2-D vector.
Subtract Subtracts two 2-D vectors.
ToString Obtains a string representation of the current instance.
static (Shared in Visual Basic) Transform Transforms a 2-D vector or an array of 2-D vectors by a given matrix.
TransformCoordinate Transforms a 2-D vector or an array of 2-D vectors by a given matrix, projecting the result back into w = 1.
TransformNormal Transforms the 2-D vector normal by a given matrix.
Vector2 Initializes a new instance of the Vector2 class.

Properties

Property Description
static (Shared in Visual Basic) Empty Retrieves an empty 2-D vector.

Structure Information

Namespace Microsoft.DirectX
Assembly Microsoft.DirectX (microsoft.directx.dll)
Strong Name Microsoft.DirectX,  Version=1.0.900.0,  Culture=neutral,  PublicKeyToken=d3231b57b74a1492

See Also