public double StandartDistanceStructDouble(PointStructDouble pointOne, PointStructDouble pointTwo) { double x = pointOne.X - pointTwo.X; double y = pointOne.Y - pointTwo.Y; return(Math.Sqrt((x * x) + (y * y))); }
public BechmarkClass() { Random random = new Random(); int[] vs = new int[20]; // должно быть кратно 4 for (int i = 0; i < vs.Length; i++) { vs[i] = random.Next(0, 50); } int length = vs.Length / 2; pointClasses = new PointClass[length]; pointStruct_Doubles = new PointStructDouble[length]; pointStruct_Floats = new PointStructFloat[length]; for (int i = 0; i < length; i++) { pointClasses[i] = new PointClass() { X = vs[i * 2], Y = vs[i * 2 + 1] }; pointStruct_Doubles[i] = new PointStructDouble() { X = vs[i * 2], Y = vs[i * 2 + 1] }; pointStruct_Floats[i] = new PointStructFloat() { X = vs[i * 2], Y = vs[i * 2 + 1] }; } }