示例#1
0
        private static double GetManhattanDistance(ASquare a, ASquare b)
        {
            var dx = Math.Abs(a.X - b.X);
            var dy = Math.Abs(a.Y - b.Y);

            return(dx + dy);
        }
示例#2
0
 private static double GetEuclidDistance(ASquare a, ASquare b)
 {
     return(Math.Sqrt((a.X - b.X) * (a.X - b.X) + (a.Y - b.Y) * (a.Y - b.Y)));
 }