summaryrefslogtreecommitdiffstats
path: root/src/euclid.rs
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-06-26 17:20:22 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-06-27 13:58:43 -0400
commite466113d70e9786259b3516b5951771b0706e5d8 (patch)
tree9abce5a134d5f437d8f1b6f70bba9669f191b82e /src/euclid.rs
parentb4e301a2a4e6e00a1b521cae8e1a015ab8fc2b54 (diff)
downloadacap-e466113d70e9786259b3516b5951771b0706e5d8.tar.xz
docs: Integrate KaTeX and add some formulas
Diffstat (limited to 'src/euclid.rs')
-rw-r--r--src/euclid.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/euclid.rs b/src/euclid.rs
index 4f2309a..0f2281e 100644
--- a/src/euclid.rs
+++ b/src/euclid.rs
@@ -47,6 +47,13 @@ impl<T: Coordinates> Coordinates for Euclidean<T> {
}
/// Compute the Euclidean distance between two points.
+///
+/// ```math
+/// \begin{aligned}
+/// \mathrm{euclidean\_distance}(x, y) &= \|x - y\|_2 \\
+/// &= \sqrt{\sum_i (x_i - y_i)^2}
+/// \end{aligned}
+/// ```
pub fn euclidean_distance<T, U>(x: T, y: U) -> EuclideanDistance<T::Value>
where
T: Coordinates,