"""Eratosthenes' measurement of the Earth, as Cleomedes reports it, against the modern value.""" import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[1])) from labkit import Q, versions # noqa: E402 print("measured: the numbers Cleomedes reports for Eratosthenes (c. 240 BC); source.json names the source") print("computed:", versions()) print() angle = Q(7.2, "degree") fraction = (angle / Q(360, "degree")).to("dimensionless").magnitude distance_stadia = 5000 print(f"Shadow angle at Alexandria at noon on the solstice: {angle.magnitude} degrees") print(f" as a fraction of a full circle: 7.2 / 360 = 1/{1 / fraction:.0f}") print(f"Alexandria to Syene: {distance_stadia:,} stadia") circumference_stadia = distance_stadia / fraction print(f" circumference = {distance_stadia:,} x {1 / fraction:.0f} = {circumference_stadia:,.0f} stadia") print() modern = Q(40_008, "km") # the Earth measured round the poles (WGS 84 meridian, 40,007.86 km) print("Nobody knows exactly which stadion he used; the candidates:") print(" stadion circumference vs modern 40,008 km") for name, metres in (("Messenian", 160), ("Delphic", 177), ("Pan-Hellenic", 180), ("Attic", 185), ("Olympic", 191), ("Ptolemaic", 210)): km = (circumference_stadia * Q(metres, "m")).to("km") print(f" {name:<12} {metres} m {km.magnitude:>9,.0f} km {100 * (km / modern - 1).to('dimensionless').magnitude:>+7.2f}%") print() print("The shortest candidate lands within a fiftieth of a percent; the longest is about a third too big.")