Esempio n. 1
0
        private static void FillArrays()
        {
            Random rand = new Random();

            for (int i = 0; i < count; i++)
            {
                pointClass[i]   = new PointClass((float)(rand.NextDouble() * count), (float)(rand.NextDouble() * count));
                pointStructD[i] = new PointStructD(rand.NextDouble() * count, rand.NextDouble() * count);
                pointStructF[i] = new PointStructF((float)(rand.NextDouble() * count), (float)(rand.NextDouble() * count));
            }
        }
Esempio n. 2
0
 public float GetFastDistance(PointStructF other)
 => (X - other.X) * (X - other.X) + (Y - other.Y) * (Y - other.Y);
Esempio n. 3
0
 public float GetDistance(PointStructF other)
 => MathF.Sqrt((X - other.X) * (X - other.X) + (Y - other.Y) * (Y - other.Y));