I have this line vector that represents the movement trajectory of a given animal. I would like to randomly replace this vector line within a polygon, multiple times, changing its position and orientation, but without changing the trajectory itself. Is this possible? It is OK if random trajectories intersect each other, as long as they don't fall outside the polygon. Here is an example:
The black square is the polygon, the continuous blue line is the real trajectory, and the three dotted blue lines are examples of three random placements of the trajectory within the polygon.
How can I do this on QGIS or R?
I don't have any experience with Python.