Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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)));
        }
Ejemplo n.º 3
0
        public float PointDistanceStruct(PointStruct pointOne, PointStruct pointTwo)
        {
            float x = pointOne.X - pointTwo.X;
            float y = pointOne.Y - pointTwo.Y;

            return(MathF.Sqrt((x * x) + (y * y)));
        }
Ejemplo n.º 4
0
        public static PointStruct[] GeneratePointsStr()
        {
            PointStruct pointOne = new PointStruct {
                X = 5, Y = 7
            };
            PointStruct pointTwo = new PointStruct {
                X = 10, Y = 12
            };

            PointStruct[] points = { pointOne, pointTwo };
            return(points);
        }