 | DistanceSquaredEuclideanDistance Method |
Computes the squared Euclidean distance between two data sets.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntaxpublic static double SquaredEuclideanDistance(
DoubleVector data1,
DoubleVector data2
)
Public Shared Function SquaredEuclideanDistance (
data1 As DoubleVector,
data2 As DoubleVector
) As Double
public:
static double SquaredEuclideanDistance(
DoubleVector^ data1,
DoubleVector^ data2
)
static member SquaredEuclideanDistance :
data1 : DoubleVector *
data2 : DoubleVector -> float
Parameters
- data1 DoubleVector
- The first data set.
- data2 DoubleVector
- The second data set.
Return Value
DoubleThe distance between
data1 and
data2.
Exceptions
Remarks
This distance is computed as:
distance( x, y ) = sum ( xi - yi )^2
Squaring the simple Euclidean distance places progressively greater
weight on objects that are further apart.
Missing values are allowed. Pairs of elements are excluded from the
distance measure when their comparison returns NaN. If all pairs are
excluded, NaN is returned for the distance measure.
See Also