| 1 | // Calculate the position based on the current position, speed and time: |
| 2 | // https://www.wolframalpha.com/input/?i=x+%3D+2+*+t+%5E+3+-+3+*+t+%5E+2+%2B+1+from+t+%3D+0+to+t+%3D+1 |
| 3 | const position = (x0, v0, t1, t) => { |
| 4 | const a = (v0 * t1 + 2 * x0) / t1 ** 3; |