Well if those are the only distances that you need to calculate, it's much easier to get the coordinate of Heathrow and Gatwick in OSGB36 coordinates. These are, using this web form https://www.ordnancesurvey.co.uk/gps...ormation/batch to convert
to
To calculate your distances:
To check, I calculate the distance from the first point converted in #12 to both airports using GPS coordinates and then compare to the distances calculated using OSGB36 coordinates:
As you can see, the distances are pretty close.
Code:
51.470020,W,0.454295 51.14806,W,0.19028
Code:
507457.462 175694.047 526676.516 140312.403
Code:
clear input str7 pcd str6 oseast1m str7 osnrth1m str9 ctry "AB1 0AA" "385386" "0801193" "S92000003" "AB1 0AB" "385177" "0801314" "S92000003" "AB1 0AD" "385053" "0801092" "S92000003" "AB1 0AE" "384600" "0799300" "S92000003" "AB1 0AF" "384460" "0800660" "S92000003" end destring oseast1m, gen(oseast) destring osnrth1m, gen(osnrth) local easting 507457.462 local northing 175694.047 gen d_heathrow = sqrt((oseast-`easting')^2+(osnrth-`northing')^2) / 1000 local easting 526676.516 local northing 140312.403 gen d_gatwick = sqrt((oseast-`easting')^2+(osnrth-`northing')^2) / 1000
Code:
. geodist 57.101459 -2.2428581 51.470020 -0.454295 WGS 1984 ellipsoid(6378137,298.257223563) distance = 637.50746 km . geodist 57.101459 -2.2428581 51.14806 -0.19028 WGS 1984 ellipsoid(6378137,298.257223563) distance = 676.02503 km . list in 1 +-----------------------------------------------------------------------------------+ | pcd oseast1m oseast osnrth1m osnrth ctry d_heat~w d_gatw~k | |-----------------------------------------------------------------------------------| 1. | AB1 0AA 385386 385386 0801193 801193 S92000003 637.2993 675.8152 | +-----------------------------------------------------------------------------------+ .
Comment