[Helix][perf] Write replacement distance function for inlining
[Helix][perf] Precalculate spoke line segments