trace – How to update the location of the particles with the reflection in a cuboid?

Come on omega = [0, x_max][0, y_max][0, z_max] the domain where some particles move. I have a question about updating the locations of the particles if they cross the boundaries of the domain. More precisely, I want the particles to be reflected within the Omega domain if they cross the boundaries of any axis. For example, if the new location is {0.5,0.2,1.3} with x_max = y_max = z_max = 1.0, then the location z.location is outside the limit. How to update the location of the particles in that case with reflection?
Thanks in advance
attentively
Ilhem