This is a simulation of a hanging chain. You can move the endpoints.

The algorithm solves a non-linear system of equations with local descent parallel to the axis. This is not the fastest possible approach, but works quite well and reliable.

Source