In geometry, a Heronian triangle (or Heron triangle) is a triangle whose side lengths , , and and area are all positive integers. Heronian triangles are named after Heron of Alexandria, based on their relation to Heron's formula which Heron demonstrated with the example triangle of sides and area .

Heron's formula implies that the Heronian triangles are exactly the positive integer solutions of the Diophantine equation

that is, the side lengths and area of any Heronian triangle satisfy the equation, and any positive integer solution of the equation describes a Heronian triangle.The sides and area of any triangle satisfy the Diophantine equation obtained by squaring both sides of Heron's formula; see . Conversely, consider a solution of the equation where are all positive integers. It corresponds to a valid triangle if and only if the triangle inequality is satisfied, that is, if the three integers and are all positive. This is necessarily true in this case: if any of these sums were negative or zero, the other two would be positive and the right-hand side of the equation would thus be negative or zero and could not possibly equal the left-hand side which is positive.

If the three side lengths are setwise coprime (meaning that the greatest common divisor of all three sides is 1), the Heronian triangle is called primitive.

Triangles whose side lengths and areas are all rational numbers (positive rational solutions of the above equation) are sometimes also called Heronian triangles or rational triangles; in this article, these more general triangles will be called rational Heronian triangles. Every (integral) Heronian triangle is a rational Heronian triangle. Conversely, every rational Heronian triangle is geometrically similar to exactly one primitive Heronian triangle.

In any rational Heronian triangle, the three altitudes, the circumradius, the inradius and exradii, and the sines and cosines of the three angles are also all rational numbers.

Scaling to primitive triangles Scaling a triangle with a factor of consists of multiplying its side lengths by ; this multiplies the area by and produces a similar triangle. Scaling a rational Heronian triangle by a rational factor produces another rational Heronian triangle.

Given a rational Heronian triangle of side lengths the scale factor produces a rational Heronian triangle such that its side lengths are setwise coprime integers. It is proved below that the area is an integer, and thus the triangle is a Heronian triangle. Such a triangle is often called a primitive Heronian triangle.

In summary, every similarity class of rational Heronian triangles contains exactly one primitive Heronian triangle. A byproduct of the proof is that exactly one of the side lengths of a primitive Heronian triangle is an even integer.

Proof: One has to prove that, if the side lengths of a rational Heronian triangle are coprime integers, then the area is also an integer and exactly one of the side lengths is even.

The Diophantine equation given in the introduction shows immediately that is an integer. Its square root is also an integer, since the square root of an integer is either an integer or an irrational number.

If exactly one of the side lengths is even, all the factors in the right-hand side of the equation are even, and, by dividing the equation by , one gets that and are integers.

As the side lengths are supposed to be coprime, one is left with the case where one or three side lengths are odd. Supposing that is odd, the right-hand side of the Diophantine equation can be rewritten

with and even. As the square of an odd integer is congruent to modulo , the right-hand side of the equation must be congruent to modulo . It is thus impossible, that one has a solution of the Diophantine equation, since must be the square of an integer, and the square of an integer is congruent to or modulo .

Examples Any Pythagorean triangle is a Heronian triangle. The side lengths of such a triangle are integers, by definition. In any such triangle, one of the two shorter sides has even length, so the area (the product of these two sides, divided by two) is also an integer.

Examples of Heronian triangles that are not right-angled are the isosceles triangle obtained by joining a Pythagorean triangle and its mirror image along a side of the right angle. Starting with the Pythagorean triple this gives two Heronian triangles with side lengths and and area .

More generally, given two Pythagorean triples and with largest entries and , one can join the corresponding triangles along the sides of length (see the figure) to get a Heronian triangle with side lengths and area

There are Heronian triangles that cannot be obtained by joining Pythagorean triangles. For example, the Heronian triangle of side lengths and area 72, since none of its altitudes is an integer. Such Heronian triangles are known as . However, every Heronian triangle can be constructed from right triangles with rational side lengths, and is thus similar to a decomposable Heronian triangle. In fact, at least one of the altitudes of a triangle is inside the triangle, and divides it into two right triangles. These triangles have rational sides, since the cosine and the sine of the angles of a Heronian triangle are rational numbers, and, with notation of the figure, one has and where is the left-most angle of the triangle.

Rationality properties

Many quantities related to a Heronian triangle are rational numbers. In particular:

All the altitudes of a Heronian triangle are rational. This can be seen from the fact that the area of a triangle is half of one side times its altitude from that side, and a Heronian triangle has integer sides and area. Some Heronian triangles have three non-integer altitudes, for example the acute (15, 34, 35) with area 252 and the obtuse (5, 29, 30) with area 72. Any Heronian triangle with one or more non-integer altitudes can be scaled up by a factor equalling the least common multiple of the altitudes' denominators in order to obtain a similar Heronian triangle with three integer altitudes. All the interior perpendicular bisectors of a Heronian triangle are rational: For any triangle these are given by and where the sides are and the area is ;Mitchell, Douglas W. (2013), "Perpendicular Bisectors of Triangle Sides", Forum Geometricorum 13, 53−59: Theorem 2. in a Heronian triangle all of , , , and are integers. Every interior angle of a Heronian triangle has a rational sine. This follows from the area formula , in which the area and the sides and are integers, and equivalently for the other interior angles. Every interior angle of a Heronian triangle has a rational cosine. This follows from the law of cosines, , in which the sides , , and are integers, and equivalently for the other interior angles. Because all Heronian triangles have all interior angles' sines and cosines rational, this implies that the tangent, cotangent, secant, and cosecant of each interior angle is either rational or infinite. Half of each interior angle has a rational tangent because , and equivalently for other interior angles. Knowledge of (at least two of) these half-angle tangent values is sufficient to reconstruct the side lengths of a primitive Heronian triangle (see below). For any triangle, the angle spanned by a side as viewed from the center of the circumcircle is twice the interior angle of the triangle vertex opposite the side. Because the half-angle tangent for each interior angle of a Heronian triangle is rational, it follows that the quarter-angle tangent of each such central angle of a Heronian triangle is rational. (Also, the quarter-angle tangents are rational for the central angles of a Brahmagupta quadrilateral and for all known Robbins pentagons, but it is an unsolved problem whether this is true for all Robbins pentagons generally.) The reverse is true for all cyclic polygons generally; if all such central angles have rational tangents for their quarter angles then the cyclic polygon can be scaled to simultaneously have integer area, sides, and diagonals (connecting any two vertices). There are no Heronian triangles whose three internal angles form an arithmetic progression. This is because all plane triangles with interior angles in an arithmetic progression must have one interior angle of 60°, which does not have a rational sine.Zelator, K., "Triangle Angles and Sides in Progression and the diophantine equation x+3y=z", Cornell Univ. archive, 2008 Any square inscribed in a Heronian triangle has rational sides: For a general triangle the inscribed square on side of length has length where is the triangle's area;Bailey, Herbert, and DeTemple, Duane, "Squares inscribed in angles and triangles", Mathematics Magazine 71(4), 1998, 278–284. in a Heronian triangle, both and are integers. Every Heronian triangle has a rational inradius (radius of its inscribed circle): For a general triangle the inradius is the ratio of the area to half the perimeter, and both of these are rational in a Heronian triangle. Every Heronian triangle has a rational circumradius (the radius of its circumscribed circle): For a general triangle the circumradius equals one-fourth the product of the sides divided by the area; in a Heronian triangle the sides and area are integers. In a Heronian triangle the distance from the centroid to each side is rational because, for all triangles, this distance is the ratio of twice the area to three times the side length.Clark Kimberling, "Trilinear distance inequalities for the symmedian point, the centroid, and other triangle centers", Forum Geometricorum, 10 (2010), 135−139. http://forumgeom.fau.edu/FG2010volume10/FG201015index.html This can be generalized by stating that all centers associated with Heronian triangles whose barycentric coordinates are rational ratios have a rational distance to each side. These centers include the circumcenter, orthocenter, nine-point center, symmedian point, Gergonne point and Nagel point.Clark Kimberling's Encyclopedia of Triangle Centers Every Heronian triangle can be placed on a unit-sided square lattice with each vertex at a lattice point. As a corollary, every rational Heronian triangle can be placed into a two-dimensional Cartesian coordinate system with all rational-valued coordinates. Every positive integer is the area of some rational Heronian triangle. By contrast, there is no proved criterion for deciding whether a positive integer is the area of a rational right triangle; this is the congruent number problem.

Properties of side lengths Here are some properties of side lengths of Heronian triangles, whose side lengths are and area is . Every primitive Heronian triangle has one even and two odd sides (see ). It follows that a Heronian triangle has either one or three sides of even length, and that the perimeter of a primitive Heronian triangle is always an even number. There are no equilateral Heronian triangles, since a primitive Heronian triangle has one even side length and two odd side lengths. The area of a Heronian triangle is always divisible by 6.Proof. One can suppose that the Heronian triangle is primitive. The right-hand side of the Diophantine equation can be rewritten as If an odd length is chosen for , all squares are odd, and therefore of the form and the two differences are multiple of . So is multiple of , and is even. For the divisibility by three, one chooses as non-multiple of (the triangle is supposed to be primitive). If one of and is not a multiple of , the corresponding factor is a multiple of (since the square of a non-multiple of has the form ), and this implies that is a divisor of Otherwise, would divide both and and the right-hand side of the Diophantine would not be the square of as being congruent to minus times a square modulo . So, this last case is impossible.