## Class EuclideanDistanceMetric

• All Implemented Interfaces:
Serializable, DistanceMetric

```public class EuclideanDistanceMetric
extends SquaredEuclideanDistanceMetric```
This class implements a Euclidean distance metric. The metric calculates the distance between the given two vectors by summing the square root of the squared differences between each coordinate.

http://en.wikipedia.org/wiki/Euclidean_distance

If you don't care about the true distance and only need for comparison, `SquaredEuclideanDistanceMetric` will be faster because it doesn't calculate the actual square root of the distances.

`http://en.wikipedia.org/wiki/Euclidean_distance`, Serialized Form
• ### Constructor Summary

Constructors
Constructor and Description
`EuclideanDistanceMetric()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static EuclideanDistanceMetric` `apply()`
`double` ```distance(Vector a, Vector b)```
Returns the distance between the arguments.
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Methods inherited from interface org.apache.flink.ml.metrics.distances.DistanceMetric

`checkValidArguments`
• ### Constructor Detail

• #### EuclideanDistanceMetric

`public EuclideanDistanceMetric()`
• ### Method Detail

• #### apply

`public static EuclideanDistanceMetric apply()`
• #### distance

```public double distance(Vector a,
Vector b)```
Description copied from interface: `DistanceMetric`
Returns the distance between the arguments.

Specified by:
`distance` in interface `DistanceMetric`
Overrides:
`distance` in class `SquaredEuclideanDistanceMetric`
Parameters:
`a` - a Vector defining a multi-dimensional point in some space
`b` - a Vector defining a multi-dimensional point in some space
Returns:
a scalar double of the distance