如何计算并获得下一个纬度 - 经度,该时间间隔是每10分钟两个点之间的时间估算的,具有起点和终点? [关闭]

如何计算并获得下一个纬度 - 经度,该时间间隔是每10分钟两个点之间的时间估算的,具有起点和终点?  [关闭]

问题描述:

I need help I have the following 2 points on the map point A lat1/long1 and point B lat2/long2 in google map I have distance, arrived_time, bearingradians and speed.

With these data how can I get a estimated latitude longitude (google map format) to the next point on 10 minutes,20,30 and 40 minutes ?, having start and end point.

Point A 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 I need you to calculate the nexts points, I going to use PHP, or where should I start

Thank you

我需要帮助我在地图上有以下2点A lat1 / long1和B点lat2 / long2 in 谷歌地图我有距离,到达时间,轴承距离和速度。 p>

使用这些数据,如何在10分钟,20,30获得估计纬度经度(谷歌地图格式)到下一个点 和40分钟?,有起点和终点。 p>

A点 lat1 = 37.78472 lon1 = -122.39913 p>

B点 lat2 = 37.78240 lon2 = -121.23208 p>

bearingradians = 270 p>

距离= 102 KM p>

arri_time = 50分钟

速度= 122公里/小时 p>

示例: http://hmarina.sytes.net/mapagoogle.jpg p>

我需要你计算nexts点,我将使用PHP, 或者我应该从哪里开始 p>

谢谢 p> div>

There are multiple ways to calculate this. Some of them are quite complex.

You could use Vincenty's formula, which is often used for bearing and distance calculations. The formula needs Long/Lat of the starting point, the bearing and a distance. I doubt, that you want to reimplement this algo, so here you go: Implementing Vincenty's Formula in PHP

Another solution could be to use vectors to calculate the destination points along a great-circle given distance and bearing from start point. This approach might be a bit easier, then to work with spherical trigonometry. http://www.movable-type.co.uk/scripts/latlong-vectors.html and https://*.com/a/1739066/1163786

Another one is to calculate the intermediate points on a great-circle. http://williams.best.vwh.net/avform.htm#Intermediate


Let's use Vincenty here and re-calc your end-point, given a starting-point, bearing and distance:

  • a starting point: Point A lat1=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 is pretty close your Point B.


Now, you want to determine the future position (lang/lat) by calculating the distance you will travel based on your current speed and your known time interval. In other words, your next point is 10 minutes from the starting point given speed 122 km/h and 89 bearing.

Calculate new distance: 122 km/h = 2033.33 m/min, so in 10 minutes: 20333.33 m = 20,333 km approx.

You new data for the formula:

  • a starting point, here: Point A lat1=37.78472; lon1=-122.39913;
  • the bearing: approx. 89
  • the distance: 20,333 km

And re-run vincenty with these values to get Lat/Long...


This might be of help:

You have: speed = 122Km/h => You can calculate 10 minute walked (n _km)

You can calculate distance with 2 point distance

sqrt((lat1 - lat2)^2 + (lng1-lng2)^2);

you have distance and lat1, how to calculate lat2:

Read more in picture :)