File Exchange

image thumbnail

Catenary - hanging rope between two points

version 1.0.0.0 (2.45 KB) by Yuval
Computes the catenary shape (hanging rope) of a given length between two given points.

17 Downloads

Updated 10 Oct 2012

View License

Given two points in the vertical plane and a given length of rope, the supplied function computes the trajectory of the catenary between those points. Run plot_catenary.m for an interactive demo.

See
http://en.wikipedia.org/wiki/Catenary
for a full description of the catenary curve.

Cite As

Yuval (2021). Catenary - hanging rope between two points (https://www.mathworks.com/matlabcentral/fileexchange/38550-catenary-hanging-rope-between-two-points), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Ned Qi

xinglong fang

Hendrik Wrenger

Hendrik Wrenger

Hi Yuval,

Nice work!

However, there seems to be a problem with larger coordinates:

This works fine:
[x y]=catenary([-30 0],[30 0],100,20);
figure()
plot(x,y)

This doesn't:
[x y]=catenary([-300 0],[300 0],1000,20);
figure()
plot(x,y)

Not sure where the threshold is or what the bug could be.

Best, Hendrik

Joseph Flaherty

Sam

MATLAB Release Compatibility
Created with R2012a
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!