/// <summary>
 /// Transform the vectors in the given array and put the result in another array.
 /// </summary>
 /// <param name="vectors">An array of vectors to transform.</param>
 /// <param name="transformation">The transformation.</param>
 /// <param name="result">An array of vectors to put the transformation results in (should be empty).</param>
 public static void TransformArray(Vector4DArrayList vectors, Matrix4D transformation, Vector4DArrayList result)
 {
     for (int i = 0; i < vectors.Count; i++)
     {
         result.Add(transformation * vectors[i]);
     }
 }
 public static Vector4DArrayList CreateRandomVector4DArray(int count, IDoubleRandomNumberGenerator r)
 {
     Vector4DArrayList result  = new Vector4DArrayList(count);
     for(int i = 0; i < count; i++)
     {
         result.Add(new Vector4D(r.NextDouble(),r.NextDouble(), r.NextDouble(),r.NextDouble()));
     }
     return result;
 }