Smallest angle among two lines in $n \times n$ grid

270 Views Asked by At

Given an $n \times n$ grid, what is the minimum angle between any two distinct lines, each going through some grid point $p$ and at least one other grid point?

My guess is the minimum is attained by the line through $(0,0), (n,1)$ and the line through $(0,0), (n,0)$ but how can I show that this is the optimal line pair?

2

There are 2 best solutions below

0
On BEST ANSWER

I think the smallest angle is between lines $(0,0)-(n-1, n)$ and $(0,0) - (n-2,n-1)$. For these two directional vectors we have

$$ \det \begin{pmatrix} n-1 & n-2 \\ n & n-1 \end{pmatrix} = 1 $$

and so for the angle $\alpha$ we have

$$ \sin(\alpha) = \frac{1}{||(n-1, n)|| \cdot ||(n-2, n-1)||} < \frac{1}{2(n-1)^2}. $$

Among all the vectors in the grid, only the following are longer than $(n-2, n-1)$:

$$ (n-3,n), (n, n-3), (n-2, n), (n, n-2), (n-1, n), (n, n-1), (n-1, n-1), (n,n) $$

The pair given above has the smallest (positive) angle in this set.

1
On

That is not the optimal pair.

Compare the angle between the lines through $(0,0),(4,1)$ and $(0,0),(4,0)$ [about $14^\circ$] with the angle between the lines through $(0,0),(4,3)$ and $(0,0),(3,2)$ [about $3.2^\circ$].