[−][src]Function moore_hilbert::coordinates_float_compare
pub fn coordinates_float_compare(coord1: &[f64], coord2: &[f64]) -> Ordering
Determine which of two points lies further along the Hilbert curve
Arguments
coord1
- Slice of coordinates using floatscoord2
- Slice of coordinates using floats
Returns
- Ordering result that indicates the comparison of coord1 and coord2
use std::cmp::Ordering; let coords = vec![ vec![1.0, 2.0, 3.0], vec![1.0, 2.0, 4.0], ]; assert_eq!(moore_hilbert::coordinates_float_compare(&coords[0], &coords[0]), Ordering::Equal); assert_eq!(moore_hilbert::coordinates_float_compare(&coords[0], &coords[1]), Ordering::Greater); assert_eq!(moore_hilbert::coordinates_float_compare(&coords[1], &coords[0]), Ordering::Less);