Flash Games

 FAQ   Search   Members   Groups   User Control Panel      Login 

It is currently Fri Jan 09, 2009 4:09 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: program that finds bearing and distance from lat & Long
PostPosted: Mon Feb 19, 2007 11:37 am 
Offline

Joined: Mon Feb 19, 2007 8:46 am
Posts: 0
Hi there programmers, I am trying to write as part of a package a routine that will find bearing and distance from a given latitude and longitude.
I have found this formula but am unable to make it work, is there anybody out there who maybe able to help me with this problem?

Thanks Chris
minchin@mailme.ae

:!:

Worked Examples:

Suppose point 1 is LAX: (33deg 57min N, 118deg 24min W)
Suppose point 2 is JFK: (40deg 38min N, 73deg 47min W)
In radians LAX is

lat1=(33+57/60)*pi/180=0.592539, lon1=(118+24/60)*pi/180=2.066470
and JFK is

(lat2=0.709186,lon2=1.287762)
The distance from LAX to JFK is

d = 2*asin(sqrt((sin((lat1-lat2)/2))^2+
cos(lat1)*cos(lat2)*(sin((lon1-lon2)/2)^2))
= 2*asin(sqrt((sin(0.592539-0.709186)/2))^2+
cos(0.592539)*cos(0.709186)*(sin((2.066470-1.287762)/2)^2))
= 2*asin(sqrt((-0.05829)^2 +0.829525*0.758893*0.379591^2))
= 2*asin(0.306765)
= 0.623585 radians
= 0.623585*180*60/pi=2144nm
or

d = acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2))
= acos(sin(0.592539)*sin(0.709186)+
cos(0.592539)*cos(0.709186)*cos(0.778708))
= acos(0.811790)
= 0.623585 radians
= 0.623585*180*60/pi=2144nm


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review

Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User:
Pass:
Log me on automatically each visit: