php - How do I calculate and get the next latitude-longitude estimated by time between two points every 10 minutes having the start and end point? -
php - How do I calculate and get the next latitude-longitude estimated by time between two points every 10 minutes having the start and end point? -
i need help have next 2 points on map point lat1/long1 , point b lat2/long2 in google map have distance, arrived_time, bearingradians , speed.
with these info how can estimated latitude longitude (google map format) next point on 10 minutes,20,30 , 40 minutes ?, having start , end point.
point lat1=37.78472 lon1=-122.39913
point b lat2=37.78240 lon2=-121.23208
bearingradians=270
distance=102 km
arrive_time=50 minutes
speed =122 km/h
example: http://hmarina.sytes.net/mapagoogle.jpg
what need calculate nexts points, going utilize php, or should start
thank you
there multiple ways calculate this. of them quite complex.
you utilize vincenty's formula, used bearing , distance calculations. formula needs long/lat of starting point, bearing , distance. doubt, want reimplement algo, here go: implementing vincenty's formula in php
another solution utilize vectors calculate destination points along great-circle given distance , bearing start point. approach might bit easier, work spherical trigonometry. http://www.movable-type.co.uk/scripts/latlong-vectors.html , http://stackoverflow.com/a/1739066/1163786
another 1 calculate intermediate points on great-circle. http://williams.best.vwh.net/avform.htm#intermediate
let's utilize vincenty here , re-calc end-point, given starting-point, bearing , distance:
a starting point: pointlat1=37.78472
; lon1=-122.39913
; the bearing: approx. 89
the distance: 102 km
result: latitude: 37°47′42″n
37.79506902
, longitude: 121°14′28″w
-121.24119021
that pretty close point b.
now, want determine future position (lang/lat) calculating distance travel based on current speed , known time interval. in other words, next point 10 minutes starting point given speed 122 km/h , 89 bearing.
calculate new distance: 122 km/h = 2033.33 m/min
, in 10 minutes: 20333.33 m = 20,333 km approx
.
you new info formula:
a starting point, here: pointlat1=37.78472
; lon1=-122.39913
; the bearing: approx. 89
the distance: 20,333 km
and re-run vincenty these values lat/long...
this might of help:
php library geo/nav calculations google maps api v3 provides navigation helper methods php google-maps math geospatial interpolation
Comments
Post a Comment