Unfortunately flat-Earthers are highly unlikely to be able to follow your basic reasoning, never mind comprehend the code examples you helpfully include. To flat-Earthers, your math is witchcraft. They are simple people - necessarily so, otherwise they wouldn't fall for such simple-minded nonsense in the first place. A far easier approach is to say: go to the beach and watch a tall ship sail away, using powerful binoculars. See how the ship seems to disappear by degrees, until finally only the smokestack is visible above the horizon, and then it too vanishes? Only a spherical Earth can explain that phenomenon; a flat Earth would present the ship growing smaller and smaller and smaller until it was a mere speck in your field of vision. Ergo, the Earth - by the witness of your own eyes alone, with no fancy math or difficult concepts - must be a sphere.
And if that fails, simply bludgeon them to death with a mallet. You gave them a chance and they blew it.