src/Colourful/Difference/EuclideanDistanceColorDifference.cs
/// <summary>
/// Computes distance between two color vectors as euclidean distance.
/// </summary>
Computes distance between two color vectors as euclidean distance.
Computes distance between two color vectors as euclidean distance .
public double ComputeDifference(in TColor x, in TColor y)
        {
            var distanceSquared = 0d;
            var vectorSize = Min(x.Vector.Length, y.Vector.Length);
            for (var i = 0; i < vectorSize; i++)
            {
                var xi = x.Vector[i];
                var yi = y.Vector[i];
                var xyiDiff = xi - yi;
                distanceSquared += xyiDiff * xyiDiff;
            }
            var distance = Sqrt(distanceSquared);
            return distance;
        }
public double ComputeDifference ( in TColor x , in TColor y ) { var distanceSquared = 0d ; var vectorSize = Min ( x . Vector . Length , y . Vector . Length ) ; for ( var i = 0 ; i < vectorSize ; i ++ ) { var xi = x . Vector [ i ] ; var yi = y . Vector [ i ] ; var xyiDiff = xi - yi ; distanceSquared += xyiDiff * xyiDiff ; } var distance = Sqrt ( distanceSquared ) ; return distance ; }
Computes distance between two color vectors as euclidean distance.
Computes distance between two color vectors as euclidean distance .
TColor
in