Exemplo n.º 1
0
        private float PointDistance(PointClassOne pointOne, PointClassTwo pointTwo)
        {
            float x = pointOne.X - pointTwo.X;
            float y = pointOne.Y - pointTwo.Y;

            return(MathF.Sqrt((x * x) + (y * y)));
        }
Exemplo n.º 2
0
        private void SetArrays()
        {
            int size = 100;

            _arrayForPointClassOne   = new PointClassOne[size];
            _arrayForPointClassTwo   = new PointClassTwo[size];
            _arrayForPointStructOne  = new PointStructOne[size];
            _arrayForPointStructTwo  = new PointStructTwo[size];
            _arrayForPointStructOneD = new PointStructOne[size];
            _arrayForPointStructTwoD = new PointStructTwo[size];

            for (int i = 0; i < _arrayForPointStructOne.Length; i++)
            {
                _arrayForPointClassOne[i] = new PointClassOne()
                {
                    X = (float)_random.NextDouble(),
                    Y = (float)_random.NextDouble()
                };
                _arrayForPointClassTwo[i] = new PointClassTwo()
                {
                    X = (float)_random.NextDouble(),
                    Y = (float)_random.NextDouble()
                };
                _arrayForPointStructOne[i] = new PointStructOne()
                {
                    X = (float)_random.NextDouble(),
                    Y = (float)_random.NextDouble()
                };
                _arrayForPointStructTwo[i] = new PointStructTwo()
                {
                    X = (float)_random.NextDouble(),
                    Y = (float)_random.NextDouble()
                };
                _arrayForPointStructOneD[i] = new PointStructOne()
                {
                    pX = _random.NextDouble(),
                    pY = _random.NextDouble()
                };
                _arrayForPointStructTwoD[i] = new PointStructTwo()
                {
                    pX = _random.NextDouble(),
                    pY = _random.NextDouble()
                };
            }
        }