Any situation where you have repeating, aka periodic, movements, they can be calculated mathematically. In the case of eclipses you have two sets of periodic movements that are independent to one another, 1) that of the sun and 2) that of the moon. When those periodic movements intersect is when you get eclipses. It doesn't matter whether the moon is 263,00 miles away and the sun is 93.000,000 miles away or whether you don't know the distances or whether you had them "wrong", such as when it the distance of the sun has been revised at least a dozen times, or when first they claimed that the orbit of the earth around the sun was a perfect circle and then changed it to elliptical. None of that matters, as long as there's repetition and a consistent repetition over time, they can be calculated.
Babylonians, who had a Flat Earth cosmology, were the first to predict eclipses using the Saros cycle, which can then be extrapolated to different places on earth to get the "path" of the eclipse as well. That's probably why the ancients had these solar observatories everywhere, things like Stonehenge, the pyramids, all kinds of megalithic strucutres, which were all solar/lunar observatories.
Being able to mathematically predict eclipses and their paths has absolutely nothing to do with the physical shape and dimensions of the universe, as the modern dimensions are relatively recent. Early Greeks had it at 1 million miles away, then it became 5, then it was 20, then 50, then 100, and finally settled on 93, to which was added an elliptical dimension so that it now allegedly varies between 91.4 and 94.5. And yet throughout all this, they continued to accurately predict eclipses. Why? Because of what I wrote above. With repeating cycles of movement, i.e. periodicity, with the moon and the sun, you can do the math. Babylonians came up with the Saros cycle, which involves some extremely complex math, and this was used to accurately predict eclipses until the most modern times.