Hi Paul, This is what we use (given WGS84 coordinates) T3GeoTools class>>#distanceBetween: firstPosition and: secondPosition "T3GeoTools distanceBetween: 5.33732@50.926 and: 5.49705@50.82733" | c | c := (firstPosition y degreeSin * secondPosition y degreeSin) + (firstPosition y degreeCos * secondPosition y degreeCos * (secondPosition x degreesToRadians - firstPosition x degreesToRadians) cos). c := c >= 0 ifTrue: [ 1 min: c ] ifFalse: [ -1 max: c ]. ^ c arcCos * 6371000 Sven
On 05 Oct 2016, at 23:28, Paul DeBruicker <pdebruic@gmail.com> wrote:
umm ... here is a good place to start
http://forum.world.st/Geo-coordinates-operations-td4732373.html#a4732441
Paul DeBruicker wrote
I've got a few objects with latitude and longitude and want to be able to find the nearest from a collection
Thanks
Paul
-- View this message in context: http://forum.world.st/Is-there-any-library-to-calculate-the-geographic-dista... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.