Geometry: Find a point at a certain distance between two points

This is similar to this question , but vice versa.

I have two geographical points (latitude, longitude) A and B. Let them say that they are at a distance of 40 nautical miles from each other. I would like to calculate the coordinates of point 10 nautical miles from point A, on the line between A and B. I am sure that this is a very simple math, but it was YEARS, since I had to do such math (some other kinds that I use daily ), so I'm stuck. Any pointers would be greatly appreciated. My code for this project is in Python, but the math is language independent, so this doesn't really bother me - I just want to know the formula.

+6
math geometry geospatial
source share
3 answers

You have two position vectors (latitude, longitude). From these, you can calculate your bearing from point A to point B (if you still do not know this). With bearing and distance, you can calculate your new latitude and longitude.

All the math you need to know is mentioned here: http://www.movable-type.co.uk/scripts/latlong.html . I deal with this material, so it rarely happens that this link has been saved somewhere (read: printed).

+7
source share

So this is something like:

x B (x2,y2) \ \ \ \ x C (x3, y3) \ \ \ XA (x1,y1) 

As I would do this, first find the angle of this line:

 angle_A_B = arctan((y2-y1)-(x2-x1)) 

then the specified distance between A and C is known (let's call it distance_A_C):

 sin(angle_A_B) = delta_x_A_C / distance_A_C delta_x_A_C = distance_A_C * sin(angle_A_B) 

so:

 x3 = x1+delta_x_A_C 

for y3 value:

 delta_y_A_C = distance_A_C * cos(angle_A_B) 

so:

 y3 = y1+delta_y_A_C 

Maybe I got the mix characters, so if it doesn't work, change the + value to - .

+4
source share

I believe that Haversine Formula can be applied here . If this helps, I implemented it in C #, Java and Javascript?

0
source share

All Articles