The arclength function computes the length of a general space curve. This is not too difficult if the curve is assumed to be piecewise linear (a one liner) but if the curve is to be a smoothly interpolated spline, then the problem becomes more difficult.
A nice way to solve this problem for the cubic case is to formulate it as a numerical integration, whereupon the solution can be gained from quadgk. Carefully written code breaks the problem into a series of integrals between each pair of breaks on the curve to avoid the derivative singularities one would find otherwise.
John D'Errico (2020). arclength (https://www.mathworks.com/matlabcentral/fileexchange/34871-arclength), MATLAB Central File Exchange. Retrieved .
Saved my day (and year) for my university project
John - I wish to thank you for your many submissions, and for sharing your work and your brainpower. So very appreciated. May God richly bless you, sir.
I would like to plot the function being integrated as a check. How can I do this? Thanks!
Does not appear to work for the parametric spline approximation method. Throws error: The data sites should be distinct.
I have a project for measuring Retinal vessel tortuosity and the length of them.
Can any body help me? thank you
Excellent software. Works exactly as stated, and linear algorithm is alarmingly fast.
Thanks God.....I got it... at last..
I must say it's strange to see a D'Errico contribution receive 2 stars.
So I'll repost my original rating (lost when John temporarily removed this contribution last year).
Inspired: Export figure to 3D interactive PDF, jdugge/xy2sn, Cumulative Arcwise Significance of Global Wavelet Power and Global Coherence Spectra, Matlab to Ansys ICEM/Fluent and Spline Drawing Toolbox