## The Math Behind LEGO Building Techniques – Volume 1

Have you come across a LEGO technique used in an official set or a MOC that left you wondering “how does that even work ?”. It turns out there is a pretty good explanation for every technique out there as long as you don’t mind getting your hands dirty with a little math. In this new series of posts, I will try to use math to explain how some of these techniques work (suggestions are always welcome for the techniques I should cover next).

Let’s start first with the latest modular building set from LEGO – the Boutique Hotel 10297 which was released on January 1, 2022. The first thing that draws your attention to this modular building is its unusual triangular shape. LEGO as we know is based on a regular square grid of stud locations and so how did they pull this shape off and can we figure out the math behind it ?

If you read my post on angled walls, you will see that the trick to placing LEGO pieces at any angle other than 0 or 90 degrees relative to the LEGO grid is by ensuring that the studs at the two ends of the brick or plate line up with studs on the LEGO grid. This only works when the resulting right angled triangle satisfies the Pythagorean theorem (a2+b2=c2). The smallest Pythagorean triple (set of numbers that satisfies the theorem) is (3, 4, 5) and that is the one the Boutique Hotel uses. But it uses the triple in a way that is not immediately apparent. In fact, if you look at the angled walls in this build, you can count not one but 6 separate (3, 4, 5) triangles including two (4 and 6) that even intersect each other.

Given that the hypotenuses (longest sides) of triangles 1-4 are in a straight line connected together using long plates, we don’t even need to connect the outer ends of the triangles 1 and 4. The hypotenuses of triangles 5 and 6 are at right angles to the line connecting the hypotenuses of triangles 1-4.

Even more interesting is the fact that the floor sections separating the 3 levels of the building as well as the roof section are built using regular plates and wedge plates and somehow their angled sides line up perfectly with the angled walls of the building. Coincidence ? I think not. We will need to get into some basic trigonometry to explain this.

In a right angled triangle for either of the smaller angles, the ratio of the length of the side opposite the angle to the side adjacent to it is called the tangent and this ratio is fixed for a given angle regardless of the size of the triangle. If we already know the ratio, we can figure out the angle using the inverse of the tangent function or arctan (available in most scientific calculators). In a (3, 4, 5) triangle, the tangent of the smallest angle is 3/4 = 0.75 and the arctan of that is 36.8 degrees.

If you look at one of the floor sections or the roof section of the Boutique Hotel, you will see that they use two mirrored 6×3 wedge plates to create the angled side. Each wedge plate has a right triangle with a tangent of 2/6 = 0.333 and the arctan of that is 18.4 degrees. So it makes sense that two of these wedge plates would give us a combined angle of 36.8 degrees matching what we have on the angled wall.

We can confirm this using the formula to calculate the tangent of twice a given angle.

Plugging in the numbers, we see that the tangent of twice the angle created by the wedge plate is (2 x 1/3) / (1 – 1/9) = 2/3 x 9/8 = 3/4 which matches the tangent of the angle created by the (3, 4, 5) Pythagorean triple. Pretty neat, eh ?

The way the wedge plates are used here is a common application of the “mirrored hypotenuse” technique also covered in my post on angled walls. This gets around the fact that for an arbitrary right triangle, the length of the hypotenuse is not always a whole number. The hypotenuse for the triangle created by the 6×3 wedge plate is √(6² + 2²) = 6.32 studs. Even though we cannot place a LEGO element along the hypotenuse, we can create an angled wall by mirroring the right triangle along the hypotenuse and placing LEGO elements along the other two sides of the second triangle. The two triangles have to be held together using hinge plates and this is exactly what is done in the Boutique Hotel set.

The next technique we will be looking at is one that Jason Pyett from Playwell Bricks came up with. He stumbled upon a very interesting way of putting pieces together to create what he calls the Magic Circle and there is definitely something magical about how everything meshes together so nicely with no visible gaps. But how does it work ?

While Jason’s entire build is pretty ingenious, let us focus on how the 8 identical sections of the magic circle fit together so perfectly. If you take a closer look, you will see that the sloped portion of a 45 degree slope piece in section A matches the height of a brick and the little lip on the 45 degree slope sitting above it in section B.

All LEGO slope pieces have a lip at the base of the slope that is about half a plate high. It has been suggested that this lip stems from limitations in the injection molding process used to manufacture LEGO bricks and that may very well be the case. But the half plate lip also makes a lot of sense geometrically speaking, at least for the 45 degree slope (which has been around since the earliest days of LEGO).

A right angled triangle with a 45 degree angle is called the special right triangle. This is because the third angle is also a 45 degree angle and the two sides that make up the right angle are of equal length. In a 45 degree slope piece, if you think of the sloped portion as the hypotenuse (longest side) of a special right triangle, the other two sides have to be of equal length. One of the sides is a stud (or 2.5 plates) wide horizontally and so the other has to be 2.5 plates measured vertically. Given that a brick is 3 plates tall, that leaves us with a lip that is 3 – 2.5 = 0.5 plate tall.

Referring to the Pythagorean theorem (a2+b2 = c2) if two sides of the right triangle are 1 stud each, the length of the hypotenuse (or the angled side) c = (a2+b2) = √2 studs or 1.414 x 0.8 = 1.13 cm. That is how long the sloped portion of the 45 degree slope piece in section A would be. On the other side in section B, is a brick height which is 3 plates or 0.96 cm plus the half plate lip which is 0.32/2 = 0.16 cm for a total of 1.12 cm. These two numbers are very close to each other which explains why the magic circle works as well as it does.

Stay tuned for the next installment in this series. Until then, happy building !