Enter/Exit of unit cube representable as 4 numbers? In the paper Real-time Reflection using Ray Tracing with Geometry Field
, it mentions this:


  A ray is represented
  by its two intersection points (in,out) with the bounding box
  of the surface. Hence, the geometry field is a 4 dimensional
  function.


Having two $3D$ points gives 6 values: $A=(A_x,A_y,A_z), B = (B_x, B_y, B_z)$.

How is it that those 6 values, which are on the surface of a unit cube, can be represented with only 4 numbers?

Edit: the best I can think of is to convert each point to spherical coordinates and throw away the length, effectively converting these points to points on a unit sphere.  That way involves some trig operations though. Is there a better way that uses less computation?
3D object surface is 2D domain and can thus be parametrized with a 2D function. In case of a unit cube you could parametrize the surface for example by mapping each 6 faces to a 2D image strip. So if you know two points of the ray that intersects the cube, you can define it with 4D function using the parametrization