code wiki / _hdl_build / nx_geo_eqarea.nx
nx_geo_eqarea.nx
buildroot/runtime/_hdl_build/nx_geo_eqarea.nx
about
nx_geo_eqarea.nx -- GEO-005 (other half): EQUAL-AREA cells, the fix for the geohash's CELL-SIZE
weakness. A lat/lon grid (geohash) partitions latitude by equal Δlat, but a cell's GROUND AREA =
Δlon * (sin(lat_hi) - sin(lat_lo)) shrinks by cos(lat) toward the poles -- so a "uniform" geohash
grid actually has cells ~7x smaller near the poles than at the equator (density bias). The
CYLINDRICAL-EQUAL-AREA fix: project lat -> y = sin(lat) and partition by equal Δy. Because the
spherical area element is exactly dlon * d(sin lat), equal Δlon*Δsin rectangles have EQUAL ground
area at every latitude. Composes the Hilbert ordering (nx_geo_hilbert) -> equal-area cells in
Hilbert order = the S2/H3 cell-uniformity target. REUSES fx.nx CORDIC sin (no float, no reinvention).
EXCEED is MEASURED: lat/lon band areas vary >2x (via real fx_sin) while equal-area bands are uniform.
dependencies 3 imports · 0 importers
imports: fx.nxnx_itoa_lib.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 14 | func ea_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 19 | func ea_n(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 21 | func ea_deg_q16(deg: i64) -> i64 { return deg * FX_TWO_PI / 360 } called by 1: main |
| 22 | func main(argc: i64, argv: *i64) -> i64 |