you could probably make splines using curves/bezier curves which are mathematical functions, if you're looking on making it from scratch :)). the water resistance is given by a constant in the spring function that us used for the water simulation