
Calculating distance travelled along a flight trajectory

LaMP
I have a series of longitude, latitude, and altitude points corresponding to a flight trajectory (attached). I would like to calculate the distance (m/km) travelled at each point along the flight trajectory from a fixed point (e.g. the center of Paris 48.85 N, 2.34E). Is this possible to do this with IGOR?
Thank you in advance.
That in mind, I don't understand the part of your question, "from a fixed point." Wouldn't you just want to calculate the distance between each point, and then add them all up to get the total distance? Or are you saying you want the distance from an a priori point to each of the points in your track?
August 25, 2014 at 05:45 pm - Permalink
Thank you for your comment and suggestions.
""That in mind, I don't understand the part of your question, "from a fixed point." Wouldn't you just want to calculate the distance between each point, and then add them all up to get the total distance? Or are you saying you want the distance from an a priori point to each of the points in your track?""
I would like to calculate the distance that the plane has travelled from the centre of Paris, which could be calculated by adding the distances between each point and add them together.
Someone had given me a bit of IGOR code a few years ago that did this, but I unfortunately cannot find it. I do not think that I could write this code myself.
I will keep searching...
August 26, 2014 at 06:30 am - Permalink
If you wanted to modify this to do it from a fixed point each time, then you would set a
Variable LAT_ORIGIN = [value]
andVariable LON_ORIGIN = [value]
, change the LAT[i] and LON[i] to those origin variables, changei+1
toi
, and run it. You'd want to get rid of the do-while loop in that case, using Igor's matrix notation, but again, without that it'd still get the job done.August 26, 2014 at 04:20 pm - Permalink
Yes, it works very well. Thank you very much! I really appreciate that.
August 27, 2014 at 06:53 am - Permalink
I think that in this relation Distance[i] = 2*atan2(sqrt(Distance[i]),sqrt(1-Distance[i])) we need to multiply by the earth radius as well (as it is mentioned here http://en.wikipedia.org/wiki/Haversine_formula).
June 9, 2015 at 02:37 am - Permalink
Hi
While searching for a solution to this myself I came across this thread. I'll add my own solutions here for completeness if anyone has need for it.
Firstly, a function that takes lat,lon, plus optional start and end points, and altitude. The total distance can be calculated in 3 ways:
1. total distance over WGS-84 ellipsoid
2. total distance over WGS-84 ellipsoid accounting for altitude using simple pythagorean theorem - beware this works OK if you have high time resolution positional data, but not necessarily if you have two points far apart.
3. total spherical distance
Secondly there is code to calculate total spherical distance using the Haversine formula
Thirdly there is code to calculate the distance over a ellipsoid using Vincenty's formula, with optional complication of accounting for altitude.
Some of this is converted from elsewhere and different languages and I take no credit for it.
September 22, 2020 at 06:21 am - Permalink