[−][src]Module smartcore::math::distance::euclidian
Euclidean Distance is the straight-line distance between two points in Euclidean spacere that presents the shortest distance between these points.
Euclidian Metric Distance
The Euclidean distance (L2) between two points \( x \) and \( y \) in n-space is defined as
\[ d(x, y) = \sqrt{\sum_{i=1}^n (x-y)^2} \]
Example:
use smartcore::math::distance::Distance; use smartcore::math::distance::euclidian::Euclidian; let x = vec![1., 1.]; let y = vec![2., 2.]; let l2: f64 = Euclidian{}.distance(&x, &y);
Structs
Euclidian | Euclidean distance is a measure of the true straight line distance between two points in Euclidean n-space. |