The answer to your question is f(L) = 2Rsin^{2}(L/(2R)) where L changes from 0 to 2Rπ. One solution I can think of uses cylindrical coordinates.

Best Regards

70793859