File Exchange

image thumbnail

Catenary - hanging rope between two points

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


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.

for a full description of the catenary curve.

Cite As

Yuval (2021). 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);

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

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

Best, Hendrik

Joseph Flaherty


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!