Pythagorean triples numbers generator
Note: All triple pythagorian numbers that containes values of k > 1 are not primitive.
Pythagoras triples summary
The Pythagorean theorem states that in a right triangle, the lengths of the sides are related by the equation:
A Pythagorean triple is a set of three integer numbers that satisfies this equation.
For example, the set a = 3, b = 4, c = 5 are a Pythagorean triple.
One method to find these triple values is by using Euclid's formula. This formula expresses the sides
a, b, and c in terms of two integers, m and n , where m > n > 0
(see example bellow)..
Where k is a positive integer (k=2,3,4,…). If m − n is odd, k=1, and m and n are coprime (meaning they have no common
factors other than 1), then the generated Pythagorean triple is primitive.
Verification of Euclid's formula
Pythagorean right angle triangle sides equation
After arranging terms we get
Left side can be written by algebra laws as
Dividing both sides by (c − a) we obtain
Dividing both sides by b we obtain
(1)
We can now determine the relationship between the ratios c/b and a/b. To do so, let
(c − a) = n and b = m Substituting these definitions into the
reciprocal of the right-hand side of Equation (1) gives:
Substitute equation (2) into the left side of equation (1) gives:
Substitute equation (3) into equation (2) to get the value of (c/b):
From equations (3) and (4) we have the values of a, b and c:
Notice that the values of m and n should be: m > n > 0
(5)
Example 1 - Right triangle sides calculation
If one side of a right triangle is equal to 8. Find the other sides b and c. Assume that all the sides are integers.
Notic that all sides must be integer values otherwise there are infinite number of solutions.
The solution of this question is a Pythagorean triple number, the development of the resulting numbers can be
found in equation (5).
We can assume that n is equal to 1, this case yields the shorten Pythagorean triple numbers,
see the equations above.
The sides are defined by the integer number m, and is equal to:
a = 2 * m = 8
hence
m = 4
Once m is found the side b is equal to:
b = m2 − 1 = 42 − 1 = 15
And the third side c is equal to:
b = m2 + 1 = 42 + 1 = 17
And the sides of the triangle will be 8, 15 and 17 (these numbers are Pythagorean triple numbers).