/// <summary>Constructs a vector from the given <see cref="ReadOnlySpan{Single}" />. The span must contain at least 2 elements.</summary> /// <param name="values">The span of elements to assign to the vector.</param> public Vector2(ReadOnlySpan <float> values) { if (values.Length < 2) { Vector.ThrowInsufficientNumberOfElementsException(2); } this = Unsafe.ReadUnaligned <Vector2>(ref Unsafe.As <float, byte>(ref MemoryMarshal.GetReference(values))); }