I'm a PhD student in image processing, where I've stumbled into a problem that seems to be essentially number theory. I've hunted around online and while I've found many results on similar problems, this particular problem I cannot find a solution for:
Given a line in the plane passing through the origin making angle theta with the x-axis, I am trying to determine the closest nonzero Gaussian integer $n+im$ to the line obeying $|n+im| \le r$.
I have a conjecture which is backed up by numerous computer tests, but no proof. The conjecture is as follows:
Let $\Theta(r) = \{\theta_1,\theta_2,...,\theta_N\}$ denote the set of angles representable using Gaussian integers of this form. That is, each $\theta_i=Arg(n+im)$ for some Gaussian integer $n+im$ of norm at most $r$.
Find $\theta_i, \theta_{i+1}$ straddling $\theta$, i.e. $\theta_i \le \theta < \theta_{i+1}$. Let $n+im$ be the Gaussian integer that solves our minimization problem. Then either $Arg(n+im)=\theta_i$ or $Arg(n+im)=\theta_{i+1}$.