예제 #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));
            }
        }
예제 #2
0
 public float GetFastDistance(PointStructF other)
 => (X - other.X) * (X - other.X) + (Y - other.Y) * (Y - other.Y);
예제 #3
0
 public float GetDistance(PointStructF other)
 => MathF.Sqrt((X - other.X) * (X - other.X) + (Y - other.Y) * (Y - other.Y));