A Space & astronomy forum. SpaceBanter.com

Go Back   Home » SpaceBanter.com forum » Astronomy and Astrophysics » Amateur Astronomy
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

compute lat/long given lat/long plus distance and bearing



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 24th 08, 04:36 AM posted to comp.os.linux.development.apps,sci.astro.amateur
Eric[_29_]
external usenet poster
 
Posts: 10
Default compute lat/long given lat/long plus distance and bearing

Has anyone got a formula that:
given a lat/long starting point plus a distance and bearing
will output the new lat/long position?

I found this but it doesnt seem to work right

double curLat=40.12345;
double curLong=-122.12345;
double bearing=90; // east
double dist=1609.344; // 1 mile in meters

d_lat = asin(sin(curLat)* cos(dist)+ cos(curLat)* sin(dist)*cos(bearing));
d_lon = atan2(sin(bearing)*sin(dist)*cos(curLat),
cos(dist)-sin(altitude)*sin(curLat));
d_long = fmod( curLong - d_lon + pi, 2*pi )- pi;

printf("new coordinates: %lg x %lg\n", d_lat, d_long);

my results look like this:
new coordinates: -0.384715 x -6.1364

Thanks
Eric
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for software compute lat and long of features on solar system bodies canopus56 Amateur Astronomy 2 August 20th 06 06:04 PM
How to compute a Hubble distance? Steve Willner Research 0 April 1st 06 09:54 AM
High Schoolers Have Long-Distance Chat With Station Crew Jacques van Oene Space Station 0 November 15th 05 11:45 PM
High Schoolers Have Long-Distance Chat With Station Crew Jacques van Oene News 0 November 15th 05 11:44 PM
School Makes a Super-Long Distance Call Jacques van Oene Space Station 1 January 4th 05 05:55 PM


All times are GMT +1. The time now is 06:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 SpaceBanter.com.
The comments are property of their posters.