Code covered by the BSD License  

Highlights from

5.0 | 8 ratings Rate this file 74 Downloads (last 30 days) File Size: 3.26 KB File ID: #34871 Version: 1.0
image thumbnail



John D'Errico (view profile)


Compute the arclength of a general curve in any number of dimensions

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

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.


This file inspired Export Figure To 3 D Interactive Pdf and Jdugge/Xy2sn.

Required Products MATLAB
MATLAB release MATLAB 7.12 (R2011a)
Other requirements Will work in older releases too, as far back as quadgk exists. Older releases could substitute a call to quad or quadl for quadgk.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
11 Jun 2013 Daniel

Daniel (view profile)

13 Feb 2013 Narjes

Narjes (view profile)

I have a project for measuring Retinal vessel tortuosity and the length of them.
Can any body help me? thank you

Comment only
01 Feb 2013 Charles Nelatury  
28 Sep 2012 William

Excellent software. Works exactly as stated, and linear algorithm is alarmingly fast.

29 Jun 2012 Dr. Siva Srinivas Kolukula  
29 Jun 2012 Dr. Siva Srinivas Kolukula

Thanks God.....I got it... at last..

28 Jun 2012 Mark Shore

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).

28 Jun 2012 Dr. Siva Srinivas Kolukula  
28 Jun 2012 Dr. Siva Srinivas Kolukula  

Contact us