Pure Nix Trigonometric Library: Ditching Python for Performance
2025-04-17

To calculate network latency between his 17 VPS nodes without manual ping tests, the author attempted to approximate latency by calculating the physical distance between node coordinates using Nix. Lacking native trigonometric functions in Nix, he implemented sin, cos, tan, arctan, and sqrt functions in pure Nix and used the Haversine formula to calculate distances and latencies. This project avoids external dependencies like Python, improving efficiency and reproducibility.
Development
Trigonometry