The following formula is used to calculate the euclidean distance between points. Y1 and Y2 are the y-coordinates. A euclidean distance is defined as any length or distance found within the euclidean 2 or 3 dimensional space.
The Euclidean is often the default distance used in eg K-nearest neighbors classification or K-means clustering to find the k closest points of a particular sample point.
The second one is much easier than the first to answer. X1 and X2 are the x-coordinates. D X2-X12 Y2-Y12 Where D is the distance. Calculate the distance between each data point and cluster centers using the Euclidean distance metric as follows 3.