nx_acceleration_test.nx
buildroot/runtime/nx_acceleration_test.nx
about
nx_acceleration_test.nx -- acceleration vector ops + Newton's
second-law roundtrip composition with nx_force.
Closed-form invariants (Q14 m/s² unless noted):
(a) Zero magnitude == 0.
(b) Earth gravity = (0, 0, -9.80665 m/s²) → fz_q14 ≈ -160665.
(c) Gravity magnitude ≈ 160665 Q14 (= 9.80665 m/s² × Q14_ONE).
(d) 3-4-5 triangle in acceleration space.
(e) Add: (1, 2, 3) + (4, 5, 6) = (5, 7, 9).
(f) Scale by 2.0 (32768 Q14) doubles each component.
(g) Newton's second law roundtrip: gravity × 1 kg ≈ matches
nx_force_gravity_on_kg(1 kg). Allows ±2 Q14 tolerance for
the two-step Q14 chain (mass×accel/Q14_ONE).
(h) F = ma for 5 kg at acceleration (0, 0, -10 m/s²) → F ≈ (0, 0, -50 N).
(i) Verdict name lookup non-NULL.
expect_exit: 0
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_force.nxnx_acceleration.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
| 24 | const Q14: i64 = 16384 |
functions
| 26 | func near(actual: i64, expected: i64, tol: i64) -> i64 called by 1: main |
| 33 | func main() -> i64 |