Random Walk in a Periodic Box

For background see Wikipedia article Random Walk.
Simulates the brownian dynamics of a single particle in a periodic box.
The displacement of the particle is shown by a red line. The full trajectory is shown by an orange line with a red tracer. The periodic trajectory is shown by a blue line with a teal tracer.
See plot at the bottom for analysis of RMS displacement.