summaryrefslogtreecommitdiffstats
path: root/src/taxi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/taxi.rs')
-rw-r--r--src/taxi.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/taxi.rs b/src/taxi.rs
index 83ebccf..f22afb0 100644
--- a/src/taxi.rs
+++ b/src/taxi.rs
@@ -44,6 +44,13 @@ impl<T: Coordinates> Coordinates for Taxicab<T> {
}
/// Compute the taxicab distance between two points.
+///
+/// ```math
+/// \begin{aligned}
+/// \mathrm{taxicab\_distance}(x, y) &= \|x - y\|_1 \\
+/// &= \sum_i |x_i - y_i|
+/// \end{aligned}
+/// ```
pub fn taxicab_distance<T, U>(x: T, y: U) -> T::Value
where
T: Coordinates,