This put up will reveal the connection between my two earlier posts: one on the Star Trek lemma and one on Pythagorean triples.
Within the means of writing the latter, I seemed on the Wikipedia article on Pythagorean triples and seen this curious paragraph.
In each Pythagorean triangle, the radius of the incircle and the radii of the three excircles are optimistic integers. Particularly, for a primitive triple the radius of the incircle is r = n(m − n), and the radii of the excircles reverse the perimeters m2 − n2, 2mn, and the hypotenuse m2 + n2 are respectively m(m − n), n(m + n), and m(m + n).
The quotation for the paragraph above was the e book by my former officemate, which led to the put up on the Star Trek lemma. The passage in Arthur Baragar’s e book that Wikipedia cites is Train 15.3.
Let ΔABC be a proper angle triangle with sides of integer size. Show that the inradius r and the exradii ra, rb, and rc are all integers.
I don’t know whether or not Arthur found this theorem, however I’ll name it Baragar’s theorem for this put up.
Incircles and excircles
To unpack Baragar’s theorem, let’s begin by saying what incircles and excircles are. Incircles are extra acquainted. The incircle of a triangle is the biggest circle that may be inscribed contained in the triangle, and the radius of this circle is the inradius.
Since an incircle is an inscribed circle, you may anticipate an excircle to be a circumscribed circle, however that’s not it. There are three excircles, one for all sides. To seek out the excircle for a facet, lengthen the opposite two sides and discover the circle tangent to the facet and the 2 extensions. The radius of an excircle is its exradius.
Proof
Baragar’s theorem follows straight from Euclid’s components for Pythagorean triples talked about within the earlier put up
and formulation for the inradius r and the exradii ra, rb, and rc.
Right here Okay is the realm of the triangle, which in our case is ab/2, and s is the semiperimeter, half the perimeter.
Expressing the radii by way of m and n offers the values cited by Wikipedia above.
Illustrating the theory
I’d like to jot down a Python script as an instance the theory, and figuring out the radii of the circles assist, however we additionally have to know the facilities of the circles.
The middle of the incircle is the weighted common of the vertices, with weights given by the lengths of the alternative sides. That’s, if the vertices are A, B, and C, and the perimeters reverse these vertices are a, b, and c, the the incenter is
The facilities for the excircles have remarkably comparable expressions. For the incenter of the circle reverse a vertex, flip the signal of the corresponding facet.
Python code
Placing all of it collectively, right here’s an illustrate the theory.

And right here’s the code that produced it. Notice that every thing on this part works for proper triangles generally, not simply Pythagorean triangles.
import numpy as np
import matplotlib.pyplot as plt
def join(A, B):
plt.plot([A[0], B[0]], [A[1], B[1]], "C0")
def draw_circle(c, r, colour):
t = np.linspace(0, 2*np.pi)
plt.plot(r*np.cos(t) + c[0], r*np.sin(t) + c[1], colour=colour)
a, b, c, = 3, 4, 5
A = np.array([0, b])
B = np.array([-a, 0])
C = np.array([0, 0])
s = (a + b + c)/2
Okay = a*b/2
r = Okay/s
ra = Okay/(s - a)
rb = Okay/(s - b)
rc = Okay/(s - c)
I = (a*A + b*B + c*C)/(a + b + c)
Ia = (-a*A + b*B + c*C)/(-a + b + c)
Ib = (a*A - b*B + c*C)/(a - b + c)
Ic = (a*A + b*B - c*C)/(a + b - c)
draw_circle(I, r, "C1")
draw_circle(Ia, ra, "C2")
draw_circle(Ib, rb, "C3")
draw_circle(Ic, rc, "C4")
plt.plot([-2*rc, 2*rb], [0, 0], "C0")
plt.plot([0, 0], [-2*ra, 2*rc], "C0")
plt.plot([(-2*ra - b)*a/b, 2*rb], [-2*ra, 2*rb*b/a + b], "C0")
plt.gca().set_aspect("equal")
plt.present()
