RSS feed for blog Linkin Skype Mail Me Twitter


a freebe you never knew you wanted

hi, this code is really only any use to the UK lot (and quite frankly might be boring to even those), but who recognises this calculation

PointALat = Doc.latitudeA(0) / 57.29577951
PointALong = Doc.longitudeA(0) / 57.29577951
PointBLat = Doc.latitudeB(0) / 57.29577951
PointBLong = Doc.longitudeB(0) / 57.29577951
DistTemp = Sin( PointALat ) * Sin(PointBLat) + Cos(PointALat) * Cos(PointBLat) * Cos(PointBLong - PointALong)
Distance = 3963 * Acos(DistTemp) ‘to get distance in miles
Distance = 6371 * Acos(DistTemp) ‘to get distance in kilometers

yes, you guessed it, its that well known and loved calculation to determine the distance between 2 objects on the earths surface
(i should point out that this is a straight line calculation, and assumes the earth is a sphere, but as far as the UK is concerned it makes barely any difference)

At the moment this is stuff is no use at all, as people dont know their current longitude and latitude (the slackers), what we need is a lookup table, so that you could determine the distance between two real places such as towns and postcodes, but those bunnies cost a fortune and change all the time, the truth is no they don’t, towns/counties/and the first part of the UK post code are really pretty much static and also public domain, so here is it, all the uk towns/counties/and first part of post codes for you to use in a notes database, have fun (yeah right!!!)

Leave Your Comments

blog comments powered by Disqus
Latest Blogs