Vector3.Create Method

Definition

Overloads

Create(ReadOnlySpan<Single>)

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

Create(Single)

Creates a new Vector3 object whose three elements have the same value.

Create(Vector2, Single)

Creates a new Vector3 object from the specified Vector2 object and a Z component.

Create(Single, 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 3 elements.

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

Parameters

values
ReadOnlySpan<Single>

The span of elements to assign to the vector.

Returns

A new Vector3 whose elements have the specified values.

Applies to

.NET 9
Product Versions
.NET 9

Create(Single)

Creates a new Vector3 object whose three elements have the same value.

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

Parameters

value
Single

The value to assign to all three elements.

Returns

A new Vector3 whose three elements have the same value.

Applies to

.NET 9
Product Versions
.NET 9

Create(Vector2, Single)

Creates a new Vector3 object from the specified Vector2 object and a Z component.

C#
public static System.Numerics.Vector3 Create(System.Numerics.Vector2 vector, float z);

Parameters

vector
Vector2

The vector to use for the X and Y components.

z
Single

The Z component.

Returns

A new Vector3 from the specified Vector2 object and a Z component.

Applies to

.NET 9
Product Versions
.NET 9

Create(Single, Single, Single)

Creates a vector whose elements have the specified values.

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

Parameters

x
Single

The value to assign to the X field.

y
Single

The value to assign to the Y field.

z
Single

The value to assign to the Z field.

Returns

A new Vector3 whose elements have the specified values.

Applies to

.NET 9
Product Versions
.NET 9