Click or drag to resize

Vector2 Structure

Defines a two component vector.

A default constructed one is Zero.

Namespace:  Microsoft.DirectX
Assembly:  Demo3D.Common (in Demo3D.Common.dll) Version: 15.0.2.11458
Syntax
C#
[SerializableAttribute]
public struct Vector2 : IEquatable<Vector2>

The Vector2 type exposes the following members.

Constructors
  NameDescription
Public methodVector2(Vector2)
Initializes a new instance of the Vector2 struct.
Public methodVector2(Double, Double)
Initializes a new instance of the Vector2 struct.
Public methodVector2(Single, Single)
Initializes a new instance of the Vector2 struct.
Top
Properties
  NameDescription
Public propertyNormalized
Vector2 normalization - make its length be 1
Public propertyX
Gets or sets the X component of the Vector2 as a Single.
Public propertyXD
Gets or sets the X component of the Vector2 as a Double.
Public propertyY
Gets or sets the Y component of the Vector2 as a Single.
Public propertyYD
Gets or sets the Y component of the Vector2 as a Double.
Top
Methods
  NameDescription
Public methodAdd(Vector2)
Add Vector2 to this Vector2
Public methodStatic memberAdd(Vector2, Vector2)
Vector2 addition
Public methodCcw(Vector2)
Cross product of two Vector2s
Public methodStatic memberCcw(Vector2, Vector2)
Cross product of two Vector2s
Public methodCcwD(Vector2)
Cross product of two Vector2s
Public methodStatic memberCcwD(Vector2, Vector2)
Cross product of two Vector2s
Public methodDot(Vector2)
Dot product of two Vector2s
Public methodStatic memberDot(Vector2, Vector2)
Dot product of two Vector2s
Public methodDotD(Vector2)
Dot product of two Vector2s
Public methodStatic memberDotD(Vector2, Vector2)
Dot product of two Vector2s
Public methodEquals(Object)
Vector2 exact equality - see EQ(Vector2, Vector2) for alternative
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Vector2)
Vector2 exact equality - see EQ(Vector2, Vector2) for alternative
Public methodGetHashCode
Returns the hash code for the current Vector2.
(Overrides ValueTypeGetHashCode.)
Public methodLength
Length of Vector2
Public methodStatic memberLength(Vector2)
Length of Vector2
Public methodLengthD
Length of Vector2
Public methodStatic memberLengthD(Vector2)
Length of Vector2
Public methodLengthSq
Length squared of Vector2
Public methodStatic memberLengthSq(Vector2)
Length squared of Vector3
Public methodLengthSqD
Length squared of Vector2
Public methodStatic memberLengthSqD(Vector2)
Length squared of Vector3
Public methodLerp(Vector2, Double)
Linear interpolation between this Vector2 and another Vector2

This is most commonly used to find a point some fraction of the way along a line between two endpoints When t = 0 returns this. When t = 1 returns b. When t = 0.5 returns the point midway between this and b.

Public methodStatic memberLerp(Vector2, Vector2, Double)
Linear interpolation between two Vector2s

This is most commonly used to find a point some fraction of the way along a line between two endpoints When t = 0 returns a. When t = 1 returns b. When t = 0.5 returns the point midway between a and b.

Public methodStatic memberLerp(Vector2, Vector2, Single)
Linear interpolation between two Vector2s

This is most commonly used to find a point some fraction of the way along a line between two endpoints When t = 0 returns a. When t = 1 returns b. When t = 0.5 returns the point midway between a and b.

Public methodMaximize(Vector2)
Vector2 maximization - combination of the largest components
Public methodStatic memberMaximize(Vector2, Vector2)
Vector2 maximization - combination of the largest components
Public methodMinimize(Vector2)
Vector2 minimization - combination of the smallest components
Public methodStatic memberMinimize(Vector2, Vector2)
Vector2 minimization - combination of the smallest components
Public methodMultiply(Double)
Scale the X, and Y components of Vector2
Public methodMultiply(Single)
Scale the X, and Y components of Vector2
Public methodMultiply(Vector2)
Scale the X and Y components of Vector2.
Public methodStatic memberMultiply(Vector2, Vector2)
Scale the X and Y components of Vector2 .
Public methodStatic memberMultiply(Vector2, Double)
Scale the X and Y components of Vector2
Public methodStatic memberMultiply(Vector2, Single)
Scale the X and Y components of Vector2
Public methodStatic memberMultiplyAdd
Combined multiplication and addition
Public methodNegate
Vector2 in-place negation.
Public methodNormalize
Vector2 normalization - make its length be 1
Public methodStatic memberNormalize(Vector2)
Vector2 normalization - make its length be 1
Public methodScale(Double)
Scale the X and Y components of Vector2
Public methodScale(Single)
Scale the X and Y components of Vector2
Public methodScale(Vector2)
Scale the X and Y components of Vector2.
Public methodStatic memberScale(Vector2, Vector2)
Scale the X and Y components of Vector2 .
Public methodStatic memberScale(Vector2, Double)
Scale the X and Y components of Vector2
Public methodStatic memberScale(Vector2, Single)
Scale the X and Y components of Vector2
Public methodSubtract(Vector2)
Vector2 subtraction
Public methodStatic memberSubtract(Vector2, Vector2)
Vector2 subtraction
Public methodToString
Returns a string that represents the current Vector2.
(Overrides ValueTypeToString.)
Public methodStatic memberTransform
Transforms a Vector2 by the given Matrix
Public methodTransformCoordinate(Matrix)
Transform this Vector2 coordinate by Matrix
Public methodStatic memberTransformCoordinate(Vector2, Matrix)
Transform Vector2 coordinate by Matrix
Public methodTransformNormal(Matrix)
Transform this Vector2 normal by Matrix
Public methodTransformNormal(Quaternion)
Transform this Vector2 normal by Quaternion
Public methodStatic memberTransformNormal(Vector2, Matrix)
Transform Vector2 normal by Matrix
Public methodStatic memberTransformNormal(Vector2, Quaternion)
Transform Vector2 normal by Quaternion
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Vector2 addition
Public operatorStatic memberEquality
Vector2 exact equality - see EQ(Vector2, Vector2) for alternative
Public operatorStatic memberInequality
Vector2 exact inequality - see EQ(Vector2, Vector2) for alternative
Public operatorStatic memberMultiply(Double, Vector2)
Scale the X and Y components of Vector2
Public operatorStatic memberMultiply(Single, Vector2)
Scale the X and Y components of Vector2
Public operatorStatic memberMultiply(Vector2, Double)
Scale the X and Y components of Vector2
Public operatorStatic memberMultiply(Vector2, Single)
Scale the X and Y components of Vector2
Public operatorStatic memberSubtraction
Vector2 subtraction
Public operatorStatic memberUnaryNegation
Vector2 unary negation
Top
Fields
  NameDescription
Public fieldStatic memberEmpty
A Vector2 with all of its components set to zero.
Public fieldStatic memberMaxValue
A Vector2 with the maximum value
Public fieldStatic memberMinValue
A Vector2 with the minimum value
Public fieldStatic memberOne
A Vector2 with all of its components set to one.
Public fieldStatic memberOrigin
A Vector2 with all of its components set to zero.
Public fieldStatic memberXAxis
A Vector2 representing the unit X-Axis
Public fieldStatic memberYAxis
A Vector2 representing the unit Y-Axis
Public fieldStatic memberZero
A Vector2 with all of its components set to zero.
Top
See Also