@@ -0,0 +1,1251 @@
+#!usr/bin/python%0A'''%0A/********************************************************************************************%0AName %09%09 %09    :  dis_calc %0ADescription  %09:  calculates the distance between given two lattitude and longitude %0A%09%09%09%09         points %0AParameters   %09:  lat_1 and lng_1 are point one lattitude and longitude respectively %0A%09%09%09           lat_2 and lon_2 are point two lattitude and longitude respectively%0AReturn       %09:  This function will return the distance between given two lattitude %0A%09%09%09%09         and longitude points %0A**********************************************************************************************/%0A'''%0Aimport math%0Ag_r = 6378.137 # radius of the earth%0A%0Adef dis_calc(l_lt1,l_ln1,l_lt2,l_ln2):%09%0A%09l_lt1 = float(l_lt1)%0A%09l_ln1 = float(l_ln1)%09%0A%09l_lt2 = float(l_lt2)%0A%09l_ln2 = float(l_ln2)%0A%09l_lt1 = math.radians(l_lt1)%0A%09l_ln1 = math.radians(l_ln1)%0A%09l_lt2 = math.radians(l_lt2)%0A%09l_ln2 = math.radians(l_ln2)%0A%09c1 = float(math.cos(l_lt2))%0A%09c2 = float(math.cos(l_lt1))%0A%09s1 = float((l_lt1-l_lt2)/2)%0A%09s2 = float((l_ln1-l_ln2)/2)%0A%09si1 = float(pow(s1,2))%0A%09si2 = float(pow(s2,2))%0A%09rad = float(2*g_r)%0A%09inside = float(si1 + c1*c2*si2)%0A%09inside2 = float(math.sqrt(inside))%0A%09dis1 = float(rad*inside2)%0A%09dis1 = dis1 *1000%0A%09return dis1%0A    %0A    %0A%0A%0A

Create distance_calculation.py