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.
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 .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
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