(pos, height, vel, angle, gravity=1.)
| 16 | |
| 17 | |
| 18 | def sample_trajectory(pos, height, vel, angle, gravity=1.): |
| 19 | hit, hit_time, height, vel_x, vel_y = simulate_hit(pos, height, vel, angle, gravity) |
| 20 | def y(x): |
| 21 | t = (x.vector[0] - pos) / vel_x |
| 22 | y_ = height + vel_y * t - gravity / 2 * t ** 2 |
| 23 | return math.where((y_ > 0) & (t > 0), y_, math.NAN) |
| 24 | return CenteredGrid(y, x=2000, bounds=Box(x=(min(pos.min, hit.min), max(pos.max, hit.max)))) |
| 25 | |
| 26 | |
| 27 | BACKENDS = phi.detect_backends() |
no test coverage detected