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

SquaredDistanceTo() 공개 메소드

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

            return dx * dx + dy * dy;
        }