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

DistanceTo() 공개 메소드

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

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