MATLAB: Calculating arc length of a curve

arc lengthfilterMATLABplot

I have the trajectory for an object moving on a plane as shown in the figure. Can any one give me an idea to calculate the arc length of this curve? Sample data along with the trajectory plot is attached.

Best Answer

Use Pythagoras' theorem:
n = numel(x);
length = 0.0;
for i = 1:n-1
length = length + sqrt( (x(i+1)-x(i))^2 + (y(i+1)-y(i))^2 );
end
Related Question