Vector.GetElement Method

Definition

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.

Overloads

GetElement(Vector2, Int32)

C#
public static float GetElement(this System.Numerics.Vector2 vector, int index);

Parameters

vector
Vector2
index
Int32

Returns

Applies to

.NET 10
Product Versions
.NET 10

GetElement(Vector3, Int32)

C#
public static float GetElement(this System.Numerics.Vector3 vector, int index);

Parameters

vector
Vector3
index
Int32

Returns

Applies to

.NET 10
Product Versions
.NET 10

GetElement(Vector4, Int32)

C#
public static float GetElement(this System.Numerics.Vector4 vector, int index);

Parameters

vector
Vector4
index
Int32

Returns

Applies to

.NET 10
Product Versions
.NET 10

GetElement<T>(Vector<T>, Int32)

Source:
Vector.cs
Source:
Vector.cs

Gets the element at the specified index.

C#
public static T GetElement<T>(this System.Numerics.Vector<T> vector, int index);

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

T

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