Esempio n. 1
0
        public static double dist(KCPoint p1, KCPoint p2)
        {
            double dist = Math.Sqrt((p1.X - p2.X) * (p1.X - p2.X) + (p1.Y - p2.Y) * (p1.Y - p2.Y));

            //Console.WriteLine(dist);
            return(dist);
        }
Esempio n. 2
0
        public void dist()
        {
            KCPoint p1 = new KCPoint();

            p1.X = 0;
            p1.Y = 0;
            KCPoint p2 = new KCPoint();

            p2.X = 10;
            p2.Y = 10;

            double dist = Math.Sqrt(100 + 100);

            Assert.AreEqual(dist, Mathhelper.dist(p1, p2));
        }