[Math] How to find the vertices with integral coordinates of a triangle knowing that center and inradius

geometry

I want to find the length of the sides of a triangle (not right triangle) with center $C(1; 2)$ and inradius $R=5$. How can I do?
I tried.

  • Write the equation of the circle with center $C(1; 2)$ and inradius $R=5$;
  • Choose three points $A(-3,-1)$, $B(4,6), $C(5,5) lies on circle;
  • Write the equation of the tangents at the point $A$, $B$, $C$;
  • This tangents cut at three points $M$, $N$, $P$.
    A problem is opened, how to find the vertices with integral coordinates?

Best Answer

To make this question easier, I'll put the center of the incircle in the origin. Any integral solution can be easily transferred to the location you indicated. Let $M,N,P$ be the corners of the triangle, as used in your question. Let the coordinates of $M$ be $(M_x,M_y)\in\mathbb Z^2$. One important quantity in your scenario is

$$d:=M_x^2+M_y^2-25$$

As you can see, as long as $M$ is outside the circle, that quantity will be positive. Its square root can be used to describe the tangents from $M$ to the circle:

\begin{align*} t_1 &= \left\{(x,y)\;\middle\vert\; (5M_x+\sqrt dM_y)x + (5M_y-\sqrt dM_x)y = 5\left(M_x^2+M_y^2\right) \right\} \\ t_2 &= \left\{(x,y)\;\middle\vert\; (5M_x-\sqrt dM_y)x + (5M_y+\sqrt dM_x)y = 5\left(M_x^2+M_y^2\right) \right\} \end{align*}

The way I obtained these tangents is by performing the dual of a conic-line intersection, as described in section 11.3 of Perspectives on Projective Geometry by Richter-Gebert.

If these tangents are to cross any points with integer coordinates, their slopes have to be rational (or $\infty$ for vertical lines). These slopes are

$$-\frac{5M_x\pm\sqrt dM_y}{5M_y\mp\sqrt dM_x}$$

There are two conceivable ways these slopes might be rational: either because $\sqrt d$ is rational, or because numerator and denominator are rational multiples of the same irrational number. If one treats $\mathbb Q[\sqrt d]$ as a two-dimensional $\mathbb Q$-vectorspace, then this translates into the requirement that the two vectors have to be linearily dependent, which here means

$$\det\begin{pmatrix} 5M_x & \pm M_y \\ 5M_y & \mp M_x \end{pmatrix}=\mp5\left(M_x^2+M_y^2\right)=0$$

So the only other way would mean $M$ is the origin, which is of course impossible. So we are left with the requirement that $\sqrt d$ be rational, so $d$ must be a square number.

Now one possible way to tackle this problem is iterating over all integral coordinates in a given range, and checking whether the resulting $d$ is square. One can build up a collection of possible corner points, and using the coordinates of the tangents, one can see which corners could belong to the same triangle. The $t_1$ of one point must match the $t_2$ of the other edge, but scalar multiples of the coefficients describe the same line. I've implemented such an enumeration. Many results contain $5$ as one of the coordinates of one of the points. But not all do, so one of the more interesting results is

\begin{align*} M&=(-11, -2) & N&=( 1, 7) & P&=( 13, -9) \end{align*}

After moving $C$ back to where you defined it, this becomes

\begin{align*} M&=(-10, 0) & N&=( 2, 9) & P&=( 14, -7) \end{align*}

Illustration of one possible right-angled solution

However, the solution above has aright angle at $N$, so as your question asks for a slution without a right angle, this one is not acceptable. Thanks to @coffeemath for making me aware of this condition. It seems that at least if the absolute value of the coordinates is restricted to no more than $1000$, then all solution without a right angle neccessarily have either a horizontal or a vertical tangent. So here is another go, again first in the untranslated situation:

\begin{align*} M&=(-11, -10) & N&=( -3, 5) & P&=( 25, 5) \end{align*}

After moving $C$ back to where you defined it, this becomes

\begin{align*} M&=(-10, -8) & N&=( -2, 7) & P&=( 26, 7) \end{align*}

Illustration of solution without right angle

I also adapted my program to filter out the right-angled triangles automatically. There are still many possible solutions remaining, but none with all coordinates less than $25$ in absolute value, in the coordinate system where the circle center is the origin.