Heronian Triangle Generator

Heronian Triangle Generator
Input 3 positive integer generators:

Order will affect output dimensions/area.

A Heronian triangle is one whose side lengths and area are integers. They are named after the Greek mathematician Heron of Alexandria, whose name is also attached to the formula for triangular area in terms of side lengths (Heron's Formula).

Pythagorean triangles (right triangles whose sides are all integers) are the most prominent example of Heronian triangles, but they are not the only kind. For example, if you take two Pythagorean triangles that have a common leg length and put them together, you will create a new triangle that has integers side lengths and area. In fact, every Heronian triangle can be broken into two right triangles whose sides and areas are rational numbers.

Just as you can generate Pythagorean triangles with a two-parameter generator system, you can also find Heronian triangles with a three-parameter generator set:

Let m, n, and k be positive integers, and let

x = n(m² + k²)
y = m(n² + k²)
z = (m + n)|mn - k²|

Then x, y, and z form the sides of a Heronian triangle whose area is given by the formula

Area = mnk(m + n)|mn - k²|

The generating formula above will not generate all primitive Heronian triangles (for example, there are no values of m, n, and k that will generate the Heronian triangle with sides 5, 12, and 13), but it will generate at least one multiple of every primitive Heronian triangle. For example, if you choose m = 2, n = 3, and k = 2, you generate the triangle with sides 10, 24, and 26.

The values of m and n can be switched with no effect on the generated triangle, but if you exchange m and k, or n and k, a different Heronian triangle will be generated. For instance, choosing m = 2, n = 2, and k = 3 yields a Heronian triangle with sides 10, 26, and 26.

Here is a table of primitive Heronian triangles ordered by increasing area. See also Nearly Equilateral Heronian Triangles.

 ShortestSide LongestSide Perimeter Area 3 4 5 12 6 5 5 6 16 12 5 5 8 18 12 4 13 15 32 24 5 12 13 30 30 9 10 17 36 36 3 25 26 54 36 7 15 20 42 42 10 13 13 36 60 8 15 17 40 60 13 13 24 50 60 6 25 29 60 60 11 13 20 44 66 5 29 30 64 72 13 14 15 42 84 10 17 21 48 84 7 24 25 56 84 8 29 35 72 84 12 17 25 54 90 4 51 53 108 90 19 20 37 76 114 16 17 17 50 120 17 17 30 64 120 16 25 39 80 120 13 20 21 54 126 15 28 41 84 126 5 51 52 108 126 11 25 30 66 132 15 26 37 78 156 13 40 51 104 156 14 25 25 64 168 10 35 39 84 168 25 25 48 98 168 13 30 37 80 180 9 40 41 90 180 12 55 65 132 198 17 25 26 68 204 20 21 29 70 210 17 25 28 70 210 17 28 39 84 210 12 35 37 84 210 7 65 68 140 210 3 148 149 300 210 9 73 80 162 216 15 41 52 108 234 13 37 40 90 240 15 34 35 84 252 13 40 45 98 252 9 65 70 144 252 15 37 44 96 264 33 34 65 132 264 27 29 52 108 270 17 65 80 162 288 25 51 74 150 300 5 122 123 250 300 20 37 51 108 306 17 39 44 100 330 25 33 52 110 330 11 60 61 132 330 11 100 109 220 330 17 40 41 98 336 24 35 53 112 336 15 52 61 128 336 4 193 195 392 336 25 29 36 90 360 18 41 41 100 360 41 41 80 162 360 13 68 75 156 390 34 55 87 176 396 11 90 97 198 396 13 109 120 242 396 20 51 65 136 408 24 37 37 98 420 25 34 39 98 420 29 29 40 98 420 29 29 42 100 420 21 41 50 112 420 26 35 51 112 420 25 39 56 120 420 14 61 65 120 420 37 37 70 144 420 26 51 73 150 420 41 50 89 180 420 26 73 97 196 420 21 85 104 210 420 15 106 119 240 420 7 169 174 350 420