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