Vector.GetElement Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
GetElement(Vector2, Int32) | |
GetElement(Vector3, Int32) | |
GetElement(Vector4, Int32) | |
GetElement<T>(Vector<T>, Int32) |
Gets the element at the specified index. |
public:
[System::Runtime::CompilerServices::Extension]
static float GetElement(System::Numerics::Vector2 vector, int index);
public static float GetElement(this System.Numerics.Vector2 vector, int index);
static member GetElement : System.Numerics.Vector2 * int -> single
<Extension()>
Public Function GetElement (vector As Vector2, index As Integer) As Single
Parameters
- vector
- Vector2
- index
- Int32
Returns
Applies to
.NET 10
Product | Versions |
---|---|
.NET | 10 |
public:
[System::Runtime::CompilerServices::Extension]
static float GetElement(System::Numerics::Vector3 vector, int index);
public static float GetElement(this System.Numerics.Vector3 vector, int index);
static member GetElement : System.Numerics.Vector3 * int -> single
<Extension()>
Public Function GetElement (vector As Vector3, index As Integer) As Single
Parameters
- vector
- Vector3
- index
- Int32
Returns
Applies to
.NET 10
Product | Versions |
---|---|
.NET | 10 |
public:
[System::Runtime::CompilerServices::Extension]
static float GetElement(System::Numerics::Vector4 vector, int index);
public static float GetElement(this System.Numerics.Vector4 vector, int index);
static member GetElement : System.Numerics.Vector4 * int -> single
<Extension()>
Public Function GetElement (vector As Vector4, index As Integer) As Single
Parameters
- vector
- Vector4
- index
- Int32
Returns
Applies to
.NET 10
Product | Versions |
---|---|
.NET | 10 |
- Source:
- Vector.cs
- Source:
- Vector.cs
Gets the element at the specified index.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static T GetElement(System::Numerics::Vector<T> vector, int index);
public static T GetElement<T>(this System.Numerics.Vector<T> vector, int index);
static member GetElement : System.Numerics.Vector<'T> * int -> 'T
<Extension()>
Public Function GetElement(Of T) (vector As Vector(Of T), index As Integer) As T
Type Parameters
- T
The type of the elements in the vector.
Parameters
- vector
- Vector<T>
The vector to get the element from.
- index
- Int32
The index of the element to get.
Returns
The value of the element at index
.
Exceptions
index
was less than zero or greater than the number of elements.
The type of vector
(T
) is not supported.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | 8, 9, 10 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: