0

Say I have two points: Point1 and Point2

I am currently using Google Maps, but this can be applicable to any language. So my points are defined as: google.maps.LatLng(..)

The two points form a line. Now if I travel X meters along the line from Point1, how can I get the latitude/longitude of this new point.

(The distance between Point1 and Point2 would only ever be a some km)

Any help would be greatly appreciated.

user600314
  • 662
  • 1
  • 5
  • 17
  • Maybe: http://stackoverflow.com/questions/27928/how-do-i-calculate-distance-between-two-latitude-longitude-points – Bashwork Dec 09 '11 at 16:45

1 Answers1

2

You need to compute the bearing between the two points. Then, with the distance, you can calculate the destination point (lat/lon) based on distance and bearing. See here for formulas: http://www.movable-type.co.uk/scripts/latlong.html

TreyA
  • 3,339
  • 2
  • 20
  • 26
  • Ended up using google.maps.geometry.spherical.computeDistanceBetween(t2, t1) and working with ratios ! Thanks – user600314 Dec 12 '11 at 13:39