4

inradius = $5$ possible triangle sides $(25, 20, 15)$ $(37, 35, 12) (39, 28, 17)$ ...

Find formula to find other possible sides of triangles.

Intelligenti pauca
  • 50,470
  • 4
  • 42
  • 77
user2173372
  • 143
  • 7

1 Answers1

4

Let $a$, $b$, $c$ be the integer lengths of the triangle sides, and $r$ the inradius, which I suppose to be integer too. It is well known that $r(a+b+c)$ is twice the area of triangle, so by squaring Heron's formula we have: $$ r^2(a+b+c)={1\over4}(a+b-c)(a-b+c)(-a+b+c). $$ The three factors in parentheses on the right hand side of that equation must be all even or all odd, because the sum of any two of them is twice the length of a side. But their product must be divisible by $4$, so they are all even numbers and we can set: $$ 2x=(a+b-c),\quad 2y=(a-b+c),\quad 2z=(-a+b+c). $$ After substitution, the equation becomes $$ r^2(x+y+z)=xyz, $$ where $x$, $y$, $z$ are positive integers and $a=x+y$, $b=x+z$, $c=y+z$. We can solve for $z$ to get: $$ z={r^2(x+y)\over xy-r^2}. $$ All solutions can be obtained from that formula, by choosing $x$ and $y$ such that $xy>r^2$ and $z$ is integer. If we suppose, without loss of generality, that $z\ge x$ and $z\ge y$, then $2z\ge x+y$, which entails $xy\le 3r^2$. So we must check only a limited number of cases.

A complete search in the case $r=5$ can be readily carried out and the only solutions for $(a,b,c)$ are the following:

(11, 60, 61),   (12, 35, 37),   (12, 153, 159), (13, 68, 75),  (15, 20, 25), 
(15, 377, 388), (17, 28, 39),   (17, 87, 100),  (27, 29, 52),  (27, 676, 701), 
(28, 351, 377), (31, 156, 185), (36, 91, 125),  (39, 76, 113), (51, 52, 101).
Intelligenti pauca
  • 50,470
  • 4
  • 42
  • 77
  • What about the values I suggested for r=5 in question like (25,20,15) (25,20,15) (37,35,12) (39,28,17)? – user2173372 Dec 30 '16 at 05:29
  • They are there, listed in lexicographic order: (15, 20, 25) and so on. – Intelligenti pauca Jan 02 '17 at 12:30
  • Is there a way to apply further constraint to the possible values of $x$ and $y$ without knowing $z$. I wrote a program that implements this method to work out all the triangles however it tests a wide range of numbers. For example when the InRadius is $5$ it loops all the values of x and y for multipling. Ie Multiply all x values between $1$ and $3r^2$ (aka $75$) by all y values between $1$ and $3r^2$ (aka $75$) – Dan Feb 14 '17 at 13:06
  • @Dan Of course you don't want duplicate triangles, so you could set for instance $x\le y\le z$ and loop over $1\le x\le \sqrt3 r$, $x\le y\le3r^2/x$. – Intelligenti pauca Feb 14 '17 at 15:03
  • 1
    @Dan Even better: $1\le x<\sqrt3 r$ and $\lfloor r^2/x\rfloor<y\le 3r^2/x$. – Intelligenti pauca Feb 14 '17 at 15:16
  • @Aretino Thank you again for your help. That sped things up an awful lot. It cut down the time for doing the search for $r = 100$ from $1.38s$ to $0.09s$ :) – Dan Feb 14 '17 at 16:15