Exemple #1
0
        public static double PointDistanceDouble(PointStruct pointOne, PointStruct pointTwo)
        {
            double x = pointOne.X - pointTwo.X;
            double y = pointOne.Y - pointTwo.Y;

            return(Math.Sqrt((x * x) + (y * y)));
        }
Exemple #2
0
        public static float PointDistanceShort(PointStruct pointOne, PointStruct pointTwo)
        {
            float x = pointOne.X - pointTwo.X;
            float y = pointOne.Y - pointTwo.Y;

            return((x * x) + (y * y));
        }
Exemple #3
0
        public static PointStruct giveMeThat()
        {
            var         rnd   = new Random();
            double      xD    = rnd.NextDouble();
            double      yD    = rnd.NextDouble();
            PointStruct point = new PointStruct()
            {
                X = (float)xD,
                Y = (float)yD
            };

            return(point);
        }