From this diagram we can see that \(x=b\cos\alpha\) and \(y=a\cos\beta\) so we can express x and y as follows using the cosine rule: \[x = \frac{b^2+c^2-a^2} {2c}\quad\text{and}\quad y=\frac{a^2+c^2-b^2}{2c}\] Adding \(x\) and \(y\) gives \(x+y=c\), which shows that this construction can be applied irrespective of the shape of the original triangle. The requirement for two equal perimeters must hence provide the constraint necessary for a solution.

We can now obtain the perimeters of the two triangular pieces as \[b+\frac{b^2+c^2-a^2}{2c}=\frac{(b+c)^2-a^2}{2c}\quad\text{and}\quad a+\frac{a^2+c^2-b^2}{2c}=\frac{(a+c)^2-b^2}{2c}\] Since the perimeter of the quadrilateral is \((a+b)\), we can express the ratios of the lengths of the three perimeters by multiplying them all by \(2c\) to give \[2(a+b)c \quad : \quad(a+c)^2-b^2\quad : \quad (b+c)^2-a^2\] which is the form used in the following Python program:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from itertools import count, permutations fs = 'The triangle has sides of {0[0]:}, {0[1]:} and {0[2]:} cm.' # start with the minimum length side for a in count(1): # try the other two sides (a + 1 and a + 2) in either order for b, c in permutations((a + 1, a + 2)): # calculate the three perimeters (each multiplied by 2 * c) t = 2 * (a + b) * c, (a + c) ** 2 - b ** 2, (b + c) ** 2 - a ** 2 # and look for a situation in which two are of the same length if len(set(t)) == 2: print(fs.format(tuple(sorted((a, b, c))))) break else: continue break |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# generate all possible triangles with sides of consecutive # whole numbers up to a given range x = 10 while x < 1000: sideA = x + 10 sideB = x + 20 sideC = x + 30 # calculate cosine of angle between sideA and sideB (cosA) cosA = (sideA ** 2 + sideB ** 2 - sideC ** 2) / (2 * sideA * sideB) # and cosine of angle between sideB and sideC (cosB) cosB = (sideB ** 2 + sideC ** 2 - sideA ** 2) / (2 * sideB * sideC) x = x + 10 # the first cut starts halfway down sideA creating a triangle with # length on one side of sideA / 2 a2 = sideA / 2 # I then pick a point on sideB which I call datum, which is # where the saw cut would end datum = 0 # this is increased in 0.1cm increments looking for the point at # which the length of the resulting cut would equal sideA/2 # this would mean that one equal-sided isoceles triangle had been created while datum < sideB: datum = datum + 1 cut1 = a2 ** 2 + datum ** 2 w = 2 * a2 * datum * cosA cut1 = cut1 - w cut1 = cut1 ** 0.5 cut1 = round(cut1, 2) if cut1 > a2: continue if cut1 == a2: # once this point has been found, check if the cut from point datum # to a point halfway along sideC would also make an isoceles triangle c2 = sideC / 2 b2 = sideB - datum cut2 = c2 ** 2 + b2 ** 2 w = 2 * b2 * c2 * cosB cut2 = cut2 - w cut2 = cut2 ** 0.5 cut2 = round(cut2, 1) # if two isosceles triangles have been created then the other shape # must be a kite with two pairs of equal sides, then all pieces could # be inverted without changing their shape if cut2 == c2: # check if any two perimeters match perimeter1 = a2 + cut1 + datum perimeter2 = a2 + cut1 + c2 + cut2 perimeter3 = b2 + cut2 + c2 if (perimeter1 == perimeter2 or perimeter2 == perimeter3 or perimeter1 == perimeter3): print('triangle measures', sideA / 10, sideB / 10, sideC / 10, 'the two cuts end at a point', datum / 10, 'cm along sideB') |