I am looking for a method to determine the hypercubes that intersect a line between two points in a high dimensional space. I think what I want is the supercover of a line in high dimensional space. For example, if we are working in a 5D bounded space and have points P and Q with coordinates (p1, p2, p3, p4, p5) and (q1, q2, q3, q4, q5), I want to know which points with integer coordinates in 5D intersect the line through P and Q. I do not have experience working in higher dimensional spaces, so my question and approach are naive. The strategy I am employing thus far:
- Use a parametric form of an equation for a line in 3D as the basis for an equation of the line in 5D:
<p1 p2 p3 p4 p5> + t * <q1 q2 q3 q4 q5> - Determine where the line PQ crosses the boundaries of the space in each dimension by setting the values of a point A to the minimum and maximum values for each dimension using the equation in step 1.
- Iterate over the integer values of points in each dimension separately using the boundaries computed in step 2. This generates a set of points that are on the line.
- Filter the results of step 3 so we have a unique set of points that are on the line, and within the boundaries of the space.
Questions:
- Will the approach I am taking result in the complete supercover of the line in this space?
- Is a more efficient way to perform this computation?