code wiki / _hdl_build / nx_viz_trig.nx
nx_viz_trig.nx
buildroot/runtime/_hdl_build/nx_viz_trig.nx
about
nx_viz_trig.nx -- the TRIG layer of the sovereign Nishi viz library (hardware-rung-up: pure INTEGER sin/cos,
no FPU, no lookup table). Bhaskara I's sine approximation: sin(d deg) ~= 4d(180-d) / (40500 - d(180-d)),
accurate to ~0.16% -- exact at 0/30/90/150/180. Output scaled by 10000 (sin(90)=10000). Range-reduced to
[0,360). Unlocks arc/pie shapes + radial/force layouts. license_tier: ORIGINAL
dependencies 1 imports · 7 importers
imports: nx_syscalls.nx
imported by: nx_viz_force.nxnx_viz_force_gate.nxnx_viz_geo.nxnx_viz_pack.nxnx_viz_pack_gate.nxnx_viz_shape.nxnx_viz_trig_gate.nx
structs
| none |
consts
| 6 | const K_MAGIC_40500: i64 = 40500 |
| 7 | const K_MAGIC_40000: i64 = 40000 |
functions
| 10 | func vs_sin(deg: i64) -> i64 |
| 21 | func vs_cos(deg: i64) -> i64 { return vs_sin(deg + 90) } |
| 23 | func vs_isqrt(n: i64) -> i64 |
| 30 | func main() -> i64 { return 0 } |