Using Latitude and Longitude

Status
Not open for further replies.

Naveed_eng

Newbie level 5
Joined
Sep 20, 2008
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,338
Dears i m doing final yr prjct..
i want to calculate the distance between two latitude and longitude....

for this i found this fomula
Haversine formula:
R = earth’s radius (mean radius = 6,371km)
Δlat = lat2− lat1
Δlong = long2− long1
a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2)
c = 2.atan2(√a, √(1−a))
d = R.c

but lat1,lat2,long1,long2 which i m getting from GPS is in degree,min,sec format..ie: 542345N , 682233E

what should i do to convert it...

or if u have any formula or code , then plz send me

thx in advance
 

If you're just trying to convert from Degrees, Minutes, and Seconds to a decimal number then you do this;

decimal_value = Degrees + Minutes/60 + Seconds/3600

You may also need to convert the decimal value of degrees to radians...

radian_value = decimal_value * PI() / 180

Regards, Mike
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…