Bewerken

Delen via


Vector.ToScalar Method

Definition

Overloads

ToScalar(Vector2)
ToScalar(Vector3)
ToScalar(Vector4)
ToScalar<T>(Vector<T>)

Converts the given vector to a scalar containing the value of the first element.

ToScalar(Vector2)

public:
[System::Runtime::CompilerServices::Extension]
 static float ToScalar(System::Numerics::Vector2 vector);
public static float ToScalar(this System.Numerics.Vector2 vector);
static member ToScalar : System.Numerics.Vector2 -> single
<Extension()>
Public Function ToScalar (vector As Vector2) As Single

Parameters

vector
Vector2

Returns

Applies to

ToScalar(Vector3)

public:
[System::Runtime::CompilerServices::Extension]
 static float ToScalar(System::Numerics::Vector3 vector);
public static float ToScalar(this System.Numerics.Vector3 vector);
static member ToScalar : System.Numerics.Vector3 -> single
<Extension()>
Public Function ToScalar (vector As Vector3) As Single

Parameters

vector
Vector3

Returns

Applies to

ToScalar(Vector4)

public:
[System::Runtime::CompilerServices::Extension]
 static float ToScalar(System::Numerics::Vector4 vector);
public static float ToScalar(this System.Numerics.Vector4 vector);
static member ToScalar : System.Numerics.Vector4 -> single
<Extension()>
Public Function ToScalar (vector As Vector4) As Single

Parameters

vector
Vector4

Returns

Applies to

ToScalar<T>(Vector<T>)

Source:
Vector.cs
Source:
Vector.cs

Converts the given vector to a scalar containing the value of the first element.

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static T ToScalar(System::Numerics::Vector<T> vector);
public static T ToScalar<T>(this System.Numerics.Vector<T> vector);
static member ToScalar : System.Numerics.Vector<'T> -> 'T
<Extension()>
Public Function ToScalar(Of T) (vector As Vector(Of T)) As T

Type Parameters

T

The type of the elements in the vector.

Parameters

vector
Vector<T>

The vector to get the first element from.

Returns

T

A scalar T containing the value of the first element.

Exceptions

The type of vector (T) is not supported.

Applies to