Vector2.CopyTo 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.
Copies the elements of the vector to an array.
CopyTo(Span<Single>) |
Copies the vector to the given Span<T>.The length of the destination span must be at least 2. |
CopyTo(Single[], Int32) |
Copies the elements of the vector to a specified array starting at a specified index position. |
CopyTo(Single[]) |
Copies the elements of the vector to a specified array. |
- Source:
- Vector2.cs
- Source:
- Vector2.cs
- Source:
- Vector2.cs
Copies the vector to the given Span<T>.The length of the destination span must be at least 2.
public:
void CopyTo(Span<float> destination);
public readonly void CopyTo (Span<float> destination);
member this.CopyTo : Span<single> -> unit
Public Sub CopyTo (destination As Span(Of Single))
Parameters
Exceptions
The number of elements in the source vector is greater than the number of elements available in destination span.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | 6, 7, 8, 9 |
- Source:
- Vector2.cs
- Source:
- Vector2.cs
- Source:
- Vector2.cs
Copies the elements of the vector to a specified array starting at a specified index position.
public:
void CopyTo(cli::array <float> ^ array, int index);
public void CopyTo (float[] array, int index);
public readonly void CopyTo (float[] array, int index);
member this.CopyTo : single[] * int -> unit
Public Sub CopyTo (array As Single(), index As Integer)
Parameters
- array
- Single[]
The destination array.
- index
- Int32
The index at which to copy the first element of the vector.
Exceptions
array
is null
.
The number of elements in the current instance is greater than in the array.
index
is less than zero.
-or-
index
is greater than or equal to the array length.
array
is multidimensional.
array
is null
.
Remarks
array
must have a sufficient number of elements to accommodate the two vector elements. In other words, elements index
and index
+ 1 must already exist in array
.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |
UWP | 10.0 |
- Source:
- Vector2.cs
- Source:
- Vector2.cs
- Source:
- Vector2.cs
Copies the elements of the vector to a specified array.
public:
void CopyTo(cli::array <float> ^ array);
public void CopyTo (float[] array);
public readonly void CopyTo (float[] array);
member this.CopyTo : single[] -> unit
Public Sub CopyTo (array As Single())
Parameters
- array
- Single[]
The destination array.
Exceptions
array
is null
.
The number of elements in the current instance is greater than in the array.
array
is multidimensional.
array
is null
.
Remarks
array
must have at least two elements. The method copies the vector's elements starting at index 0.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: