Closest vertices of an AABB to a ray in n-dimensions
Statement
I came across this computational geometry problem and have not been able to find a satisfactory solution for it. A ray is known to originate from within an n-dimensional hypercube (AABB) in any direction. I need to determine the vertices of the AABB closest to the ray in order of their distance to it.
The most obvious brute-force solution would be to calculate the distance of all vertices to the ray and then sort them. However, because the number of vertices is exponential (, where n is the dimension), ideally it would be an online algorithm that generates one solution at a time, already in the correct order. Each iteration should run in polynomial time, and the algorithm can be stopped after a condition is met.
Here is a graphic illustrating the concept for the 2d and 3d cases.
An approach using an infinite line instead of a ray would also be acceptable.
The ray is given as an origin point and a directional unit vector. If anyone knows of an algorithm or relevant formula that fits the description or could point me in the right direction it would be greatly appreciated.
Posed by Ood · computational-geometry
This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/mo-472428.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.
Question text by its MathOverflow author (CC BY-SA); see the link. Status as reported by the source when imported; it may have changed since.
Step 1: state it in Lean. The file your agent writes: statements/mo-472428.lean
import Mathlib /-! # Closest vertices of an AABB to a ray in n-dimensions Source: https://mathoverflow.net/questions/472428 Credit: @<your GitHub handle> State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification. Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging. -/ namespace OMA.S_mo_472428 -- definitions the statement needs (no sorry, no axiom) theorem main : sorry := by sorry end OMA.S_mo_472428