/// <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(Vector3DArrayList vectors, Matrix4D transformation, Vector3DArrayList result)
 {
     for (int i = 0; i < vectors.Count; i++)
     {
         result.Add(Matrix4D.Transform(transformation, vectors[i]));
     }
 }
 public static Vector3DArrayList CreateRandomVector3DArray(int count, IDoubleRandomNumberGenerator r)
 {
     Vector3DArrayList result  = new Vector3DArrayList(count);
     for(int i = 0; i < count; i++)
     {
         result.Add(new Vector3D(r.NextDouble(),r.NextDouble(), r.NextDouble()));
     }
     return result;
 }