Disclaimer: this is based on intuition only, and there's definitely a missing piece for it to be mathematically exact. However, as far as I can tell, it should be a good enough approximation for small displacement values.
The idea is that the center of each tread describes a perfect motion, without skidding. Let's draw a diagram:
O is your tank's origin, L and R are the treads' centers. Then you'd perform as follows:
- L and R are found by taking the left and right orthogonal rotations of your direction vector d, and adding them to the origin;
- L' and R' are found by applying the two lateral speeds to L and R WRT the direction vector.
i.e. L' = L + speed(L) x d and R' = R + speed(R) x d;
- O' is the middle of [L'R'], i.e. (L' + R') / 2;
- The new direction vector is orthogonal to [L'R'].
The approximation comes from the fact that L'R' > LR, that is, the tank actually stretches slightly when turning. Fixing that would require more advanced tools (some sort of curved vector ? I have no clue :p). However, as long as the speeds for each frame remain relatively small, this should be good enough.