The top rated answer was math, but it ignored the possibility that a section of track would be under tension to avoid intersecting with itself. For a mathematical curve that’s no issue, but physical objects add additional constraints to the problem.