Vector2 Structure

.NET Framework (current version)
 

Represents a vector with two single-precision floating-point values.

Namespace:   System.Numerics
Assembly:  System.Numerics (in System.Numerics.dll)

public value struct Vector2 : IEquatable<Vector2>, IFormattable

NameDescription
System_CAPS_pubmethodVector2(Single)

Creates a new Vector2 object whose two elements have the same value.

System_CAPS_pubmethodVector2(Single, Single)

Creates a vector whose elements have the specified values.

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticOne

Gets a vector whose 2 elements are equal to one.

System_CAPS_pubpropertySystem_CAPS_staticUnitX

Gets the vector (1,0).

System_CAPS_pubpropertySystem_CAPS_staticUnitY

Gets the vector (0,1).

System_CAPS_pubpropertySystem_CAPS_staticZero

Returns a vector whose 2 elements are equal to zero.

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAbs(Vector2)

Returns a vector whose elements are the absolute values of each of the specified vector's elements.

System_CAPS_pubmethodSystem_CAPS_staticAdd(Vector2, Vector2)

Adds two vectors together.

System_CAPS_pubmethodSystem_CAPS_staticClamp(Vector2, Vector2, Vector2)

Restricts a vector between a minimum and a maximum value.

System_CAPS_pubmethodCopyTo(array<Single>^)

Copies the elements of the vector to a specified array.

System_CAPS_pubmethodCopyTo(array<Single>^, Int32)

Copies the elements of the vector to a specified array starting at a specified index position.

System_CAPS_pubmethodSystem_CAPS_staticDistance(Vector2, Vector2)

Computes the Euclidean distance between the two given points.

System_CAPS_pubmethodSystem_CAPS_staticDistanceSquared(Vector2, Vector2)

Returns the Euclidean distance squared between two specified points.

System_CAPS_pubmethodSystem_CAPS_staticDivide(Vector2, Single)

Divides the specified vector by a specified scalar value.

System_CAPS_pubmethodSystem_CAPS_staticDivide(Vector2, Vector2)

Divides the first vector by the second.

System_CAPS_pubmethodSystem_CAPS_staticDot(Vector2, Vector2)

Returns the dot product of two vectors.

System_CAPS_pubmethodEquals(Object^)

Returns a value that indicates whether this instance and a specified object are equal.(Overrides ValueType::Equals(Object^).)

System_CAPS_pubmethodEquals(Vector2)

Returns a value that indicates whether this instance and another vector are equal.

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this instance. (Overrides ValueType::GetHashCode().)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodLength()

Returns the length of the vector.

System_CAPS_pubmethodLengthSquared()

Returns the length of the vector squared.

System_CAPS_pubmethodSystem_CAPS_staticLerp(Vector2, Vector2, Single)

Performs a linear interpolation between two vectors based on the given weighting.

System_CAPS_pubmethodSystem_CAPS_staticMax(Vector2, Vector2)

Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors.

System_CAPS_pubmethodSystem_CAPS_staticMin(Vector2, Vector2)

Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors.

System_CAPS_pubmethodSystem_CAPS_staticMultiply(Single, Vector2)

Multiplies a scalar value by a specified vector.

System_CAPS_pubmethodSystem_CAPS_staticMultiply(Vector2, Single)

Multiplies a vector by a specified scalar.

System_CAPS_pubmethodSystem_CAPS_staticMultiply(Vector2, Vector2)

Multiplies two vectors together.

System_CAPS_pubmethodSystem_CAPS_staticNegate(Vector2)

Negates a specified vector.

System_CAPS_pubmethodSystem_CAPS_staticNormalize(Vector2)

Returns a vector with the same direction as the specified vector, but with a length of one.

System_CAPS_pubmethodSystem_CAPS_staticReflect(Vector2, Vector2)

Returns the reflection of a vector off a surface that has the specified normal.

System_CAPS_pubmethodSystem_CAPS_staticSquareRoot(Vector2)

Returns a vector whose elements are the square root of each of a specified vector's elements.

System_CAPS_pubmethodSystem_CAPS_staticSubtract(Vector2, Vector2)

Subtracts the second vector from the first.

System_CAPS_pubmethodToString()

Returns the string representation of the current instance using default formatting. (Overrides ValueType::ToString().)

System_CAPS_pubmethodToString(String^)

Returns the string representation of the current instance using the specified format string to format individual elements.

System_CAPS_pubmethodToString(String^, IFormatProvider^)

Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting.

System_CAPS_pubmethodSystem_CAPS_staticTransform(Vector2, Matrix3x2)

Transforms a vector by a specified 3x2 matrix.

System_CAPS_pubmethodSystem_CAPS_staticTransform(Vector2, Matrix4x4)

Transforms a vector by a specified 4x4 matrix.

System_CAPS_pubmethodSystem_CAPS_staticTransform(Vector2, Quaternion)

Transforms a vector by the specified Quaternion rotation value.

System_CAPS_pubmethodSystem_CAPS_staticTransformNormal(Vector2, Matrix3x2)

Transforms a vector normal by the given 3x2 matrix.

System_CAPS_pubmethodSystem_CAPS_staticTransformNormal(Vector2, Matrix4x4)

Transforms a vector normal by the given 4x4 matrix.

NameDescription
System_CAPS_pubfieldX

The X component of the vector.

System_CAPS_pubfieldY

The Y component of the vector.

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticAddition(Vector2, Vector2)

Adds two vectors together.

System_CAPS_puboperatorSystem_CAPS_staticDivision(Vector2, Single)

Divides the specified vector by a specified scalar value.

System_CAPS_puboperatorSystem_CAPS_staticDivision(Vector2, Vector2)

Divides the first vector by the second.

System_CAPS_puboperatorSystem_CAPS_staticEquality(Vector2, Vector2)

Returns a value that indicates whether each pair of elements in two specified vectors is equal.

System_CAPS_puboperatorSystem_CAPS_staticInequality(Vector2, Vector2)

Returns a value that indicates whether two specified vectors are not equal.

System_CAPS_puboperatorSystem_CAPS_staticMultiply(Single, Vector2)

Multiples the scalar value by the specified vector.

System_CAPS_puboperatorSystem_CAPS_staticMultiply(Vector2, Single)

Multiples the specified vector by the specified scalar value.

System_CAPS_puboperatorSystem_CAPS_staticMultiply(Vector2, Vector2)

Multiplies two vectors together.

System_CAPS_puboperatorSystem_CAPS_staticSubtraction(Vector2, Vector2)

Subtracts the second vector from the first.

System_CAPS_puboperatorSystem_CAPS_staticUnaryNegation(Vector2)

Negates the specified vector.

The Vector2 structure provides support for hardware acceleration.

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: