示例#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));