3D Billiard Loop in a Rectangular Box

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

This Demonstration shows a path of a billiard ball in a 3D box that returns to its starting point, hitting each face once.


This is equivalent to a light beam looping inside a mirror box.


Contributed by: Franz Pichler (November 2012)
Suggested by: Stan Wagon
Open content licensed under CC BY-NC-SA



To ensure a closed path in a rectangular box, the direction from the starting point (red point) needs to be parallel to a space diagonal.

Since the path does not depend on the coordinate system, all parts of the path are parallel to one space diagonal.

The length of the path is twice the length of a space diagonal.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.