What is the Quickest method for determining which postcode is 2 miles north of original postcode?
For instant L17.
I know how to determine the distance between 2 points as below, but the above formulae eludes me.
Code:
public static final double PI = 3.14159265;
public static final double deg2radians = PI/180.0;
double lat1 = latitude1 * deg2radians;
double lat2 = latitude2 * deg2radians;
double lon1 = longitude1 * deg2radians;
double lon2 = longitude2 * deg2radians;
radd=2*Math.asin(Math.sqrt(Math.pow(Math.sin((lat1-lat2)/2),2.0) +
Math.cos(lat1)*Math.cos(lat2)*Math.pow(Math.sin((lon1-lon2)/2)
,2.0)));