Over the years, I have seen this question, it would seem, a huge number of times. So I wrote a small tool that will do just that. Draw a piecewise linear or even curvilinear (spline) arc in the total number of measurements so that consecutive points are at an even or predetermined distance along this arc.
In the case of using only piecewise linear arcs, this is quite easy. You sum the total length of the arc of the curve, then interpolate along the length of the arc, but since this is known to be piecewise linear, it only requires linear interpolation along this length as a function of the cumulative length of the arc.
In the case of a curved arc, it is easiest to do as a solution to a system of ordinary differential equations by observing events along this path. ODE45 does it beautifully.
You can use interparc as described in MATLAB Central File Exchange to do this for you, or if you want to learn how to do it yourself for a simple piecewise linear case, read the first part of the code, where I do piecewise linear interpolation of the arc length. It is good that the linear case is executed in a fully vectorized form, so explicit loops are not needed.
user85109
source share