code wiki / _hdl_build / nx_geo_area_gate.nx
nx_geo_area_gate.nx
buildroot/runtime/_hdl_build/nx_geo_area_gate.nx
about
nx_geo_area_gate.nx -- GATE for GEO-010 polygon area + orientation (integer-exact shoelace). Proves:
square CCW : 1deg x 1deg square (side 1e6) -> signed doubled area = +2e12, orientation = +1
square CW : same square reversed -> signed doubled area = -2e12, orientation = -1
triangle : legs 2e6, area 2e12 -> signed doubled area = +4e12
degenerate : 3 collinear points -> doubled area EXACTLY 0, orientation = 0 (the exceed)
micro-apex : base 2e6, apex 1 microdeg up -> doubled area EXACTLY 2e6 (1-microdeg resolution)
All comparisons are EXACT equality (no tolerance): the shoelace is pure-integer, so the answers are
reproducible to the bit -- the property float libs cannot promise on these edge cases.
Evidence -> knowledge/status/geo_area.log (GEOAREAGATE authored=organ ... verdict=GREEN).
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_geo_area.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
| 15 | const GA_LOG: *u8 = "knowledge/status/geo_area.log" |
functions
| 17 | func ga_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 } |
| 18 | func ga_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 } |
| 20 | func ga_set(p: *i64, i: i64, lat: i64, lon: i64) -> i64 { p[i * 2] = lat; p[i * 2 + 1] = lon; return 0 } called by 1: main |
| 22 | func ga_emit(fd: i64, sq: i64, sqo: i64, sqcw: i64, sqcwo: i64, tri: i64, deg: i64, dego: i64, mic: i64, ok: i64) -> i64 |
| 35 | func main() -> i64 |