0

I have read this post in https://mathoverflow.net/questions/268106/generating-random-curves-with-fixed-length-and-endpoint-distance The main task is drawing a continuous curve between two fixed points that has also a fixed length.

I wondered how can I implement it in python? I was looking for creating it in pytorch, but opencv and scikit image also works for me. I was unable to find even a relatively close implementation anywhere. Do you have any suggestion what function from what package can make it work?

Yousef
  • 23
  • 4
  • 1
    What about `cubic bezier curves`? There you have 4 points. 2 end points and 2 control points. If you could calculate the length of the curve you maybe can change the control points to have right length. – MSH Nov 04 '21 at 13:17
  • Thank you @MSH, that's a great idea; however, I want to let the curve be as random as possible, so if it wants to make a loop on its path. – Yousef Nov 04 '21 at 14:08
  • What happens if you put the second control before the first one? – Micka Nov 04 '21 at 19:32
  • See thee example here: https://www.oreilly.com/library/view/html5-canvas-2nd/9781449335847/ch05s03s05.html you could also use a spline with a random number of control points – Micka Nov 04 '21 at 19:34
  • It is possible to mimic what I want by putting together multiple curves together. – Yousef Nov 04 '21 at 20:15

0 Answers0