예제 #1
0
        /// <summary>
        /// Returns the distance between this coordinate and any coordiate provided.
        /// </summary>
        public double Distance(CartesianCoordinate coordinate)
        {
            var x1 = X;
            var x2 = coordinate.X;
            var y1 = Y;
            var y2 = coordinate.Y;

            var distance = Math.Sqrt(Math.Pow(x2 - x1, 2) + Math.Pow(y2 - y1, 2));

            return(distance);
        }