### Problem:

---

Given two locations:

**L1 = (latitude1, longitude1, timestamp1)**, **L2 = (latitude2, longitude2, timestamp2)**,

and a configurable, but constant, movement speed:

**v = 1.39 meters per second** (for instance).

How can we interpolate between these two locations to estimate a users location as he travels from **L1** to **L2**?

---

I have been searching for solutions to this problem and so far I have found, that for small distances (away from the poles) linear interpolation can be used. So, I looked up [linear interpolation](https://en.wikipedia.org/wiki/Linear_interpolation) on Wikipedia and found this:

```
// Imprecise method which does not guarantee v = v1 when t = 1,
// due to floating-point arithmetic error.
float lerp(float v0, float v1, float t) {
    return v0 + t*(v1-v0);
}

```

So I am thinking of using this lerp function to interpolate latitude and longitude between **L1** and **L2**. That was the easy part. How do I calculate **t**? I'm guessing I have to calculate some time deltas, but how do I factor in the movement speed?

---

### Edit:

I'm testing various methods for collecting GPS-locations. For this purpose, I am recording waypoint-locations throughout a walk. I need to interpolate between these waypoints, using the movement speed, to estimate my position along the walk. Then I can compare my results to the estimates to see how well they are faring.

Example:

[![map](https://i.stack.imgur.com/aGDdh.png)](https://i.stack.imgur.com/aGDdh.png)