Function static_aabb2d_index::hilbert_xy_to_index[][src]

pub fn hilbert_xy_to_index(x: u16, y: u16) -> u32

Maps 2d space to 1d hilbert curve space.

2d space is x: [0 -> n-1] and y: [0 -> n-1], 1d hilbert curve value space is d: [0 -> n^2 - 1], where n = 2^16, so x and y must be between 0 and u16::MAX (65535 or 2^16 - 1).