Exemple #1
0
 public void BechmarkClassFloat()
 {
     for (int i = 0; i < SIZE - 1; i++)
     {
         PointClassFloat.PointDistance(pointClassFloatArray[i], pointClassFloatArray[i + 1]);
     }
 }
Exemple #2
0
        public static float PointDistance(PointClassFloat pointOne, PointClassFloat pointTwo)
        {
            float x = pointOne.X - pointTwo.X;
            float y = pointOne.Y - pointTwo.Y;

            return(MathF.Sqrt((x * x) + (y * y)));
        }
Exemple #3
0
        public BenchmarkClass()
        {
            Random rnd = new Random();

            for (int i = 0; i < SIZE; i++)
            {
                int x = rnd.Next(1, 100);
                int y = rnd.Next(1, 100);
                pointClassFloatArray[i]   = new PointClassFloat(x, y);
                pointStructFloatArray[i]  = new PointStructFloat(x, y);
                pointStructDoubleArray[i] = new PointStructDouble(x, y);
            }
        }