I'm looking for a method to find the smallest $x$ as a function of $a_1$, $b_1$, $c_1$, $a_2$, $b_2$, $c_2$ and $r$ that satisfies the equation.
$$\left(\lfloor a_{1}+x\cdot\left(b_{1}-a_{1}\right)\rfloor-c_{1}\right)^{2}+\left(\lfloor a_{2}+x\cdot\left(b_{2}-a_{2}\right)\rfloor - c_{2}\right)^{2}<r^{2}$$
$a_1$, $b_1$, $c_1$, $a_2$, $b_2$, $c_2$ and $r$ are integer.
I am able to solve the equation using iterative methods, having first reduced the search interval. But I wanted to know if it was possible to solve it analytically.
This equation comes from a problem where a point moves on a discrete grid and the objective is to find the first point where it lies in a circle.

If it's possible to solve this analytically, would it be possible to give me some advice ? Or perhaps there is another, simpler way of finding this point ?