Hello all,
I have a series of text files with latitude/longitude data, in seperate columns, and time in another column. I would liek to use the latitude/longitude data to make a distance vs. time plot.
formula for distance based on lat/long:
R = earth’s radius (mean radius = 6,371km)Δlat = lat2− lat1Δlong = long2− long1a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2)c = 2.atan2(√a, √(1−a))d = R.c
The syntax isnt correct above as its not matlab code, just a formula on the internet.
How would I go about defining a new column of data (distance) by having it find the difference between every point of lat and long and then run the other basic operations to find distance?
the data in the text would follow this format;
Latitude Longitude 51.8885857 -2.15981330751.888588 -2.15981055151.88858751 -2.15981123751.88858772 -2.15981098151.88858774 -2.15981088751.88858765 -2.15981114451.88858779 -2.15981099151.88858747 -2.15981148951.88858758 -2.15981159751.88858755 -2.1598115851.88858725 -2.15981198551.88858732 -2.159812218
Best Answer