summaryrefslogtreecommitdiffstats
path: root/src/taxi.rs
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-06-27 17:17:10 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-06-27 17:40:03 -0400
commit07e61231dff21fda6da32929c0eae82fa44f6517 (patch)
tree0279b132f1b3b82f9c4e7ac581d152d052fa3c52 /src/taxi.rs
parente466113d70e9786259b3516b5951771b0706e5d8 (diff)
downloadacap-07e61231dff21fda6da32929c0eae82fa44f6517.tar.xz
docs: Update some links
Diffstat (limited to 'src/taxi.rs')
-rw-r--r--src/taxi.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/taxi.rs b/src/taxi.rs
index f22afb0..8bbe2f3 100644
--- a/src/taxi.rs
+++ b/src/taxi.rs
@@ -7,10 +7,10 @@ use num_traits::{zero, Signed};
/// A point in taxicab space.
///
-/// This wrapper equips any [coordinate space] with the [taxicab distance metric].
+/// This wrapper equips any [coordinate space] with the [taxicab distance] metric.
///
-/// [coordinate space]: [Coordinates]
-/// [taxicab distance metric]: https://en.wikipedia.org/wiki/Taxicab_geometry
+/// [coordinate space]: Coordinates
+/// [taxicab distance]: taxicab_distance
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Taxicab<T>(pub T);
@@ -43,7 +43,7 @@ impl<T: Coordinates> Coordinates for Taxicab<T> {
}
}
-/// Compute the taxicab distance between two points.
+/// Compute the [taxicab distance] between two points.
///
/// ```math
/// \begin{aligned}
@@ -51,6 +51,8 @@ impl<T: Coordinates> Coordinates for Taxicab<T> {
/// &= \sum_i |x_i - y_i|
/// \end{aligned}
/// ```
+///
+/// [taxicab distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
pub fn taxicab_distance<T, U>(x: T, y: U) -> T::Value
where
T: Coordinates,