Accord.DoublePoint.DistanceTo C# (CSharp) 메소드

DistanceTo() 공개 메소드

Calculate Euclidean distance between two points.
public DistanceTo ( DoublePoint anotherPoint ) : double
anotherPoint DoublePoint Point to calculate distance to.
리턴 double
        public double DistanceTo(DoublePoint anotherPoint)
        {
            double dx = X - anotherPoint.X;
            double dy = Y - anotherPoint.Y;

            return System.Math.Sqrt(dx * dx + dy * dy);
        }