Nez.Portable/Utils/Extensions/Vector2Ext.cs
/// <summary>
/// Apply transformation on vectors within array of <see cref="Vector2"/> by the specified <see cref="Matrix"/> and places the results in an another array.
/// </summary>
/// <param name="sourceArray">Source array.</param>
/// <param name="sourceIndex">The starting index of transformation in the source array.</param>
/// <param name="matrix">The transformation <see cref="Matrix"/>.</param>
/// <param name="destinationArray">Destination array.</param>
/// <param name="destinationIndex">The starting index in the destination array, where the first <see cref="Vector2"/> should be written.</param>
/// <param name="length">The number of vectors to be transformed.</param>
Apply transformation on vectors within array of  by the specified  and places the results in an another array.
Apply transformation on vectors within array of by the specified and places the results in an another array .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static void transform(
            Vector2[] sourceArray,
            int sourceIndex,
            ref Matrix2D matrix,
            Vector2[] destinationArray,
            int destinationIndex,
            int length)
        {
            for (var i = 0; i < length; i++)
            {
                var position = sourceArray[sourceIndex + i];
                var destination = destinationArray[destinationIndex + i];
                destination.X = (position.X * matrix.M11) + (position.Y * matrix.M21) + matrix.M31;
                destination.Y = (position.X * matrix.M12) + (position.Y * matrix.M22) + matrix.M32;
                destinationArray[destinationIndex + i] = destination;
            }
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public static void transform ( Vector2 [ ] sourceArray , int sourceIndex , ref Matrix2D matrix , Vector2 [ ] destinationArray , int destinationIndex , int length ) { for ( var i = 0 ; i < length ; i ++ ) { var position = sourceArray [ sourceIndex + i ] ; var destination = destinationArray [ destinationIndex + i ] ; destination . X = ( position . X * matrix . M11 ) + ( position . Y * matrix . M21 ) + matrix . M31 ; destination . Y = ( position . X * matrix . M12 ) + ( position . Y * matrix . M22 ) + matrix . M32 ; destinationArray [ destinationIndex + i ] = destination ; } }
Apply transformation on vectors within array of  by the specified  and places the results in an another array.
Apply transformation on vectors within array of by the specified and places the results in an another array .
sourceArray
Vector2[]
None
sourceIndex
int
The starting index of transformation in the source array.
The starting index of transformation in the source array .
Matrix2D
ref
destinationArray
Vector2[]
None
destinationIndex
int
The starting index in the destination array, where the first  should be written.
The starting index in the destination array where the first should be written .
length
int
The number of vectors to be transformed.
The number of vectors to be transformed .
matrix
The transformation .
The transformation .