I am looking for an elegant way is to describe the following mathematical model:
I want to create a random string-ball given only the length of the string and the diameter of the ball. Start point and endpoint do not matter that much. It does not have to be a closed-loop. Like one made out of wool which cats like to play a lot. Actually, I do not need a function. Individual equally spaced points are what I need in the end. However, having a function and then picking evenly spaced points seems the logical way to go for me. I have added an image to illustrate better what I'd like to create. The image shows an LED-band/string which is contained inside a ball.
I do not see which mathematical branch describes best what I am looking for. Probably it is related to mathematical functions, but it might be a topic of mathematical topologies, of which I do not have any prior knowledge.
My approach would be some iterative scheme. Choosing a start point, going in direction $x$ for a specific length. Then repeating this under the constraint of:
- staying inside the borders (ball)
- the first derivative before and after the previous point has to be the same
- the second derivate at the previous point has to be limited to prevent sharp bending.
I already see significant flaws in my approach, and it is not very elegant. A second approach which came to my mind is doing somewhat the opposite. First sampling random points inside the ball and then connecting them with a spline. To problem is that splines need the point in the correct order. Some heuristic might find a way to connect the points. This leads to something like a travelling salesman problem. I could imagine this might work. In my opinion, this is again a rather ugly solution.
Has there something similar already been done? I am happy if someone could point me in the right direction or help me to reformulate my problem into a domain that covers this.