示例#1
0
        public float PointDistanceShortStruct(PointStruct pointOne, PointStruct pointTwo)
        {
            float x = pointOne.X - pointTwo.X;
            float y = pointOne.Y - pointTwo.Y;

            return((x * x) + (y * y));
        }
示例#2
0
        public IEnumerable <object[]> DataPointStruct()
        {
            for (int i = 0; i < 100; i++)
            {
                arrayStructPointA[i] = new PointStruct {
                    X = rnd.Next(0, 100), Y = rnd.Next(0, 100)
                };
                arrayStructPointB[i] = new PointStruct {
                    X = rnd.Next(0, 100), Y = rnd.Next(0, 100)
                };
            }

            yield return(new object[] { arrayStructPointA, arrayStructPointB });
        }