Vector2.Create Method

Definition

Overloads

Create(ReadOnlySpan<Single>)

Constructs a vector from the given ReadOnlySpan<T>. The span must contain at least 2 elements.

Create(Single)

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

Create(Single, Single)

Creates a vector whose elements have the specified values.

Create(ReadOnlySpan<Single>)

Constructs a vector from the given ReadOnlySpan<T>. The span must contain at least 2 elements.

C#
public static System.Numerics.Vector2 Create(ReadOnlySpan<float> values);

Parameters

values
ReadOnlySpan<Single>

The span of elements to assign to the vector.

Returns

A new Vector2 whose elements have the specified values.

Applies to

.NET 9
Product Versions
.NET 9

Create(Single)

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

C#
public static System.Numerics.Vector2 Create(float value);

Parameters

value
Single

The value to assign to all two elements.

Returns

A new Vector2 whose two elements have the same value.

Applies to

.NET 9
Product Versions
.NET 9

Create(Single, Single)

Creates a vector whose elements have the specified values.

C#
public static System.Numerics.Vector2 Create(float x, float y);

Parameters

x
Single

The value to assign to the X field.

y
Single

The value to assign to the Y field.

Returns

A new Vector2 whose elements have the specified values.

Applies to

.NET 9
Product Versions
.NET 9