# Math Help - Find point given lati/long offset, heading and distance

1. ## Find point given lati/long offset, heading and distance

Hi all,

Given a start point (in latitude/longitude), initial heading (0 - 360 degrees), and distance (in meters), I am trying to find a second point, B. I've tried several solutions, amongst the closest being:
Code:
lat = asin(sin(lat1)*cos(distance)+cos(lat1)*sin(distance)*cos(heading))
IF (cos(lat)=0)
lon=lon1
ELSE
ENDIF
(obtained from Aviation Formulary V1.45)

The above didn't work, returning a wrong co-ordinate (e.g. if point B is due north, it would appear NW or NE etc)

After googling extensively, I managed to piece together the following (again without avail):
Code:
 heading = toRadians(heading);

newLat = asin(
sin(lat) * cos(angularDistance)
+ cos(lat) * sin(angularDistance) * cos(heading));

dlon = atan2(
sin(bearing) * sin(angularDistance) * cos(lat),
cos(angularDistance) - sin(lat) * sin(newLat));

newLong = ((lon + dlon + PI) % (PI * 2)) - PI;
I'm sure that the problem is a simple one, however given how long it has been since I last did geometry....
Any suggestions?

2. Anybody? :s

3. Hi suntzu,
Why don't you give lat and long + distance in km and heading.

bjh

4. Hi bjh,

Sorry, I'm confused. Could you clarify what you meant by "Why don't you give lat and long + distance in km and heading."? Do you mean why I don't give the distance in KM? The heading is an angular measurement, so I can only give that in 0 - 360 degrees...sorry, I don't quite understand what you meant by this...

5. Hi suntzu,

Latitude = ? Longitude =? Heading like 60 degrees true=? Distance traveled in km or m =?

Unconfused ?

bjh

6. I probably sound very stupid now, but: you want me to post a sample result?

Much more confused...sorry

7. Hi again suntzu,
If you are looking for a general equation in spherical trigonometry I think you are in the wrong forum.There is another method using a Mercator Chart for a limited area on which you would plot a straight line from P to Q at a designated heading and distance and quickly determine a new lat ,long position

bjh