I have a particle bouncing in a rigid box, my code is this:
L = 5;
L2 = 8;
L3 = 10;
a[x_] := 1 - 2 Boole@OddQ@Quotient[x, L];
a2[x_] := 1 - 2 Boole@OddQ@Quotient[x, L2];
a3[x_] := 1 - 2 Boole@OddQ@Quotient[x, L3];
dir = Normalize[{1, 2, 3}];
x0 = {0, L2/2, L3/2};
x[t_] := (t*dir + x0).{1, 0, 0};
x2[t_] := (t*dir + x0).{0, 1, 0};
x3[t_] := (t*dir + x0).{0, 0, 1};
P[t_] := {Mod[a[x[t]] x[t], L] , Mod[a2[x2[t]] x2[t], L2],Mod[a3[x3[t]]x3[t], L3]};
ParametricPlot3D[P[t], {t, 0, 30}, PlotRange -> {{0, L}, {0, L2}, {0, L3}}]
Now i want to calculate the time needed to the particle to reach a little square of 1x1 of area at the top of the box, something like a "Findroot" but with an interval as entry. Any susgestions please?


