Straight-line ("as the crow flies") great-circle distance in km, via the haversine formula — cheap, no API call, but it can rank a beach across a bay/headland as "nearby" when it's actually a long drive or not reachable at all without a boat (confirmed on real data: Icaraí/Camboinhas in Niterói show up within 15km of Arpoador, straight across Guanabara Bay).
Straight-line ("as the crow flies") great-circle distance in km, via the haversine formula — cheap, no API call, but it can rank a beach across a bay/headland as "nearby" when it's actually a long drive or not reachable at all without a boat (confirmed on real data: Icaraí/Camboinhas in Niterói show up within 15km of Arpoador, straight across Guanabara Bay).