But let’s start with a related picture, one with only two circles:

Again, the circles have unit radius. What are the dimensions of the rectangle?

The key to figuring this out is that if you have two lines through a point both tangent to a circle, then the line segments from the intersection point to the tangent points are congruent. We know the distance from the top right corner of the rectangle to the top tangent point on the yellow circle is 3. We don’t know the distance from the bottom right corner of the rectangle to the left tangent point on the yellow circle; call it x. Then the length of the diagonal is 3+x. By Pythagoras,

whose solution is x=2. So the height of the rectangle is 3, its width is 4, and its diagonal is 5: the diagonal and two sides make a 3:4:5 triangle, where 3:4:5 is a Pythagorean triple.

You can do the 3-circle problem the same way; here the length of the diagonal is 5+x, the equation is

whose solution is x=3/2. The rectangle then is 2.5 by 6 with diagonal 6.5. Those three numbers are in the proportion 5:12:13, another Pythagorean triple!

Coincidence? No. Of course if x is rational then the lengths of the sides and diagonal are in the proportion of a Pythagorean triple. But in general, with n circles, does x have to be rational? You might expect not. However, the solution for n circles is given by

whose solution is

So the rectangle height:width:diagonal is

: :

or

: :

which is the integer proportion : : , scaled by . That’s a Pythagorean triple, and in particular it’s a triple in which the hypotenuse is one greater than the longer side. For four circles, for example, the triple is 7:24:25 and the rectangle’s dimensions are 7/3 by 8.

Unusually for a Lego model (or for a real world building, for that matter) the structure is at an angle relative to the base. Of course you can do that sort of thing by covering the base with flat tiles, except for one single stud:

Then the structure can be at any angle, rotating around that stud. For that matter you could cover the entire base with flat tiles and just put the structure on top in any position or orientation, but that’s rather susceptible to jostling, isn’t it? So is the single stud connection, though less so.

(There also are Lego pieces with built in angles, such as this one:

But let’s just consider normal rectilinear bricks and plates for now.)

But maybe you want a rigid connection. If you happen to want an angle of, oh, I don’t know, let’s say 36.87°, you can do that, Make a base with two studs three rows and four columns apart:

The distance in stud units between the two studs is , an integer, so for instance a 1 by 6 brick can be placed on the two studs. If you want other angles you can look for other primitive Pythagorean triples to use. (Primitive meaning it’s not just another triple scaled up: (6, 8, 10), for instance, is a triple, but it’s just twice (3, 4, 5), and makes the same angle.)

The angles you get have rational values for their sine, cosine, and tangent. If you want 45°, you’re out of luck; sin(45°) is irrational. You can get pretty close, though, with for instance the triple (20, 21, 29). That gives an angle of 43.60°.

But if you want a small angle, like the Swim Center model, what do you do? Another way to think about it is, you want a triangle where the long side is nearly as long as the hypotenuse. With Pythagorean triples, the best you can get is a hypotenuse 1 unit longer than the long side.

A general formula for triples is where and are coprime and opposite parity (one even, one odd). Here obviously the smallest difference between and is 2, so we want . So and . The first several of these are:

u

a

b

c

angle

1

3

4

5

36.87°

2

5

12

13

22.62°

3

7

24

25

16.26°

4

9

40

41

12.68°

You can see you have to make a fairly large model if you want a rigid angle of less than 10° — more than 40 studs wide, if you use conventional plates and bricks. There are “jumper” plates, though, that give access to half integer spacing, meaning you’d need only half the width.

You can get smaller angles by stacking triples. For instance, you can mount a plate at 36.87° to the base using (3, 4, 5), then mount a plate to that at -16.26° using (7, 24, 25), then mount a plate on top of that also at -16.26° giving a net angle of 4.35°. The stacked plates can hide inside the structure so all you see is the base and the structure rotated 4.35°.

The ground floor of the Swim Center is 24 studs wide, meaning the largest distance between stud receivers is 46 half studs, accommodating no triples with angles smaller than 12.68°. The actual angle of the model is about 5°. So maybe Little Brick Root used angled Lego pieces (I don’t know of any with that small an angle, but maybe) or stacked triples, or maybe (mostly likely is my guess) only a single stud connection to the base. But not a rigid connection based on a single triple, that’s for sure.

We need a triangle with one side 65 mm (we’ll work in millimeters to make everything an integer), another side a+b, and another side c+d such that the following are Pythagorean triples:

56, a, c+d

56, b, 65

60, c, a+b

60, d, 65

So immediately we have b = 33 and d = 25. Now we just scan a table of Pythagorean triples for ones with 56 as one leg and a as the other, where a+33 is the hypotenuse of a Pythagorean triple which has 60 as a leg. We find 56, 42, 70; 42+33 = 75 is the hypotenuse of the triple 45, 60, 75. So the triangle’s other two sides (in cm) are 7.0 and 7.5.

I can’t see an easy way to do this by hand, but it can be done in a spreadsheet; the key is to figure out the needed formula.

Consider just the upper right quadrant; of course the number of cells crossed for the whole circle will be 4 times the number for the quadrant. Now consider each increment along the x axis from 0 to 1 to 2 to … to r, the radius. When x goes to (x+1), y goes from √(r^{2}–x^{2}) to √(r^{2}–(x+1)^{2}). The number of cells passed through in this column is 1 greater than the number of times the circle crosses a horizontal line (not counting lines started or ended on). Think about it hard enough and you realize the number of cells crossed in the file starting at x is:

^{⌈}√(r^{2}–x^{2})^{⌉}–_{⌊}√(r^{2}–(x+1)^{2})_{⌋}

where ^{⌈}x^{⌉}and _{⌊}x_{⌋}are respectively the ceiling and floor functions. Multiply that by 4 and sum over all x from 0 to r–1and you have the number of cells crossed.

So put that into a spreadsheet and graph the result:

For a radius of less than 50, the only place the number of cells decreases when the radius increases is in going from radius 24 (188 cells) to 25 (180 cells).

If a is a north-south side of the park and b is the length of a path then a and b are a side and hypotenuse of a right triangle. Call its other side x. Likewise b and c, where c is an east-west side of the park, must be a side and hypotenuse of another right triangle. Now, if you draw a perpendicular to the south side of the park through the path intersection, then the second of these triangles is split into two. All these triangles are similar and in fact the one in the southeast corner is congruent to the one in the northwest, so that perpendicular line segment must also be x and c, not a, is the long side of the park: c = a + 25.Then the southwest triangle has sides x and 25. Call its hypotenuse (the distance from the southwest corner to the path intersection) y.

Summarizing, the sides of these three similar triangles are:

a : x : b

x : 25 : y

b : y : a+25

a and b must be integers (but nothing says x or y must be).

From similarity of the first two triangles we get x^{2} = 25a. From the Pythagorean Theorem applied to the first triangle, b^{2} – a^{2} = x^{2} = 25a. If we write b = a + δ then 2δ+δ^{2}/a = 25. δ then must be an integer in the range [1, 12] and of these only 12 and 10 give integer values for a in that equation, namely 144 and 20, with corresponding values for b of 156 and 30.

Then x = 60 or 10√5 respectively. Using the Pythagorean Theorem for the second triangle, y = 65 or 15√5 ~ 33.54 respectively. But for the path intersection to be inside the park we need y < b. So the only solution that works is: a = 144, b = 156:

Joe remembered a puzzle he solved years ago. In an alley, two ladders, each with their feet against the base of a wall, were leaning against the opposite wall. The distances (whole numbers of centimetres) above the ground where they touched the walls were given, and Joe had to calculate how high above the ground the ladders crossed. He also calculated that the ladders could have been 315 centimetres and 261 centimetres long. What was the width of the alley?

They’re on a real Pythagorean triples kick lately. At least I think the width of the alley is supposed to be a whole number of centimeters, otherwise the problem has no unique solution, does it?

But if the alley is required to be a whole number of centimeters wide then what we have are two Pythagorean triangles, one with hypotenuse 315 and one with hypotenuse 261, and both having one side the same.

Well, this is easy, if you remember the hypotenuse of a Pythagorean triangle has length a(u^{2}+v^{2}) with u>v. The prime factors of 315 are 5, 7, and 9, so a can be 1, 5, 7, 9, 35, 45, 63, or 315. Testing these we find a=63, u=2, v=1 or equivalently a=7, u=6, v=3 and no other possibilities. Then the other two sides of the triangle are a(u^{2}–v^{2}) and 2auv which are 189 and 252. One of these must be the width of the alley. Now testing 261^{2}–189^{2} and 261^{2}–252^{2}, the first gives 180^{2} while the other doesn’t give us an integer root. So the two triangles are 189, 252, 315 and 189, 180, 261, with 189 the width of the alley.

From a point on one side of a rectangular sheet of paper I drew two straight lines, one of them to a point on one adjacent side and the other to a point on the other adjacent side. My sheet of paper was now divided into two triangles and a pentagon. The lengths of the sides of the triangles were all integers, the lengths of the sides of the pentagon were, in some order, five consecutive integers, each less than 50.

What were the dimensions of the sheet of paper?

Another Pythagorean triples problem. There may be some way to cut down the solution space more easily than I did, but I still got this fairly quickly.

You can look at a list of Pythagorean triples, or just generate all the ones with numbers less than 50 if you remember the formula for doing so. (I did the latter and then checked it with the former.) From that you can find all the possible pairs of hypotenuses which differ by no more than 4. I found 21 such pairs,or 23 if you count length 25 twice, since it is the hypotenuse of two triples: 15, 20, 25 and 7, 24, 25.

Then look through the possible triples and pick out the ones where a side of one triangle plus a side of the other differs by no more than 4 (but more than 0) from both the hypotenuses. For instance the pair 5, 12, 13 and 8, 15, 17 is eliminated because 5+8=17 is equal to one of the hypotenuses, while 5+15, 12+8, and 12+15 all differ from 13 by more than 4. Then look at the remaining two sides; they have to differ by no more than 4 (but more than 0).

I found four pairs of triples that meet those requirements:

7, 24, 25 and 20, 21, 29

10, 24, 26 and 20, 21, 29

16, 30, 34 and 21, 28, 35

12, 35, 37 and 24, 32, 40

Try the first of these:

The two unlabelled line segments would have to be 26 and 28, but these differ by 2 while 24 and 21 differ by 3, so the two rectangle sides come out unequal. So this doesn’t work. The only pair that does is 16, 30, 34 and 21, 28, 35. The right side of the rectangle is 16+21=37 so one of the remaining line segments must be 36 while the other is either 33 or 38. Since 28 and 30 differ by 2 the remaining line segments must differ by 2 as well, so must be 36 and 38. The rectangle is