Fit logarithmic spiral to x,y data

Fits logarithmic sprial r=a*exp(b*theta) to x,y data points.
2.2K Downloads
Updated 15 Oct 2008

View License

Logaritmic spirals often occur in nature such as the cross section of a chambered nautilus, atmospheric vortices around regions of low pressure and spiral arms of galaxies. Polar form for a log spiral with center at the origin is r=a*exp(b*theta). A general log sprial with center at xc,yc is then x=xc+r*cos(theta) and y=yc+r*sin(theta). This code fits coefficients a,b and center location xc,yc to data points along the log spiral curve. It uses the nonlinear Nedler-Mead simplex routine "fminsearch" to find the best center location and a simple linearized least-squares solution for coefficients a,b. The code provides an RMS measure for goodness-of-fit.

Cite As

H.J. Sommer (2024). Fit logarithmic spiral to x,y data (https://www.mathworks.com/matlabcentral/fileexchange/21749-fit-logarithmic-spiral-to-x-y-data), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0