Limits of the Simulation

Hello,

your drawing looks great! That is exactly what I mean.

I used a set of short straight line as trajectory. I start with a rough trajectory and smoothed it every time using splines (for example libeigen provides these kind of functions). After the train movement is pretty good.

To calculate the intersections is easy actually. You can find a lot of equations on the internet. The problem is just you will get two solutions, because of the circle equation (x² + y² = r²). So you have to walk in the right direction on your trajectory :stuck_out_tongue:

By the way, that approach works in 3D too. The only thing have to change is a sphere equations has to be used. But the algorithm is exactly the same.

Greetings