Monthly Archives: January 2014

What a wonderful thing is the mind

Our grandchildren came to stay, which was a delight. They overflowed with new toys at Christmas.

Around new year, I sat and watched Gabe, aged three, complete a jigsaw puzzle. He needed no help and finished it, to his obvious satisfaction, in about 5 minutes. It was quite a complicated little puzzle, this one from Melissa And Doug:

Melissa & Doug Farm Cube Puzzle
That picture must be copyright of their site, but since I’m being nice about the puzzle and linking to their buy-it-now page, I hope they won’t mind!

The puzzle has 16 cubes arranged as a 4 by 4 grid. Arranging the blocks correctly gives one of 6 different pictures to complete. Every block has a unique image on every face.

While Gabe was doing the puzzle, I was doing some mental arithmetic.

There are 16 cubes. Starting in the top right and moving across and down the grid, one can choose the first cube in 16 ways, the second in 15, the third in 14, … giving a total of 16 * 15 *14 * … *1, or 16! ways to arrange the cubes in the grid. That’s 20,922,789,888,000 ways! ((No, I’m not that good at mental arithmetic. Wolfram Alpha has a fine calculator for large numbers.)) 2.1*1016.

Each cube has 6 faces, and once the face is chosen, there are 4 orientations for the image, so there are 24 ways of arranging each cube in its position. So, once the cubes are positioned in the grid, there are 24 * 24 * … * 24 ways of arranging the faces without rearranging the cubes. That’s 2416 ways, 1.2*1022, or 12,116,574,790,945,106,558,976 ways.

That makes a total of 2416 * 16! ways of arranging the cubes and faces, every one of which will produce a unique total picture. There are 6 “correct” total pictures, and each of those can be presented in 4 orientations, making 24 “correct” ways of completing the puzzle. (I later watched Gabe complete the puzzle upside-down, apparently because that was more fun!)

2416 * 16! is 2.54*1035 different solutions, 253512548513181989475225528434688000.

Just 24 of those are “correct”, and 253512548513181989475225528434687976 are wrong. Just one in 10563022854715916228134397018112000, 1.06*1034 of the possible solutions is the one Gabe was looking for.

Gabe, aged three, discarded all those wrong answers and found the one he was looking for in 5 minutes.

Isn’t that wonderful?

How to hang a rising gate – in 3D!

I was looking for a way to put a true, opening gate on the web as a 3D model – I was thinking about fancy SVG. But, poking around, I tripped over Sketchfab. They provide a free service (with paid-for upgrades) to upload a 3D model and host a version of it that can be seen on a 2D browser. It took just a few minutes to sign up and upload the Sketchup gate model. I love the modern web, it provides free and easy technology that once would have been so hard. Thank you, Sketchlab!

The rising gate model can be seen, using a modern desktop browser, here. You can move around it and zoom in. In that model, there are two gates, one in the closed position, one in the fully open. I’ve actually forgotten quite what dimensions that model was designed to model, but it looks OK to me.

I’m still looking for a way of putting a real working 3D opening gate on the web, so please let me know if you find one.

Better help info

I added some 2D pictures of Sketchup models, with annotation, to try to explain how the calculator worked more clearly. It was a difficult day waiting for downloads and phone calls, so I filled in the time adding a random-woodworking-aphorism feature to the rising gate calculator. Some of the sayings are my own, and some are from here and here and here.

The source for the Rising Gate Calculator is released under an MIT licence at Github. I may be foolish for releasing it without trying to make any money, since I can’t see it anywhere else. However, I can’t imagine this technique hasn’t been familiar to every carpenter since the time of Pythagoras, so, for better or worse, it’s out there as free source, in all senses.

How to Hang a Rising Gate: the Calculator

Having struggled all day with dying laptops, dying software, a complete inability to understand VAT rules on intra-EU software downloads (except Ireland), and Adobe Creative Cloud (about which my opinions had better remain unexpressed), I have given up trying to do work and present…

The Rising Gate Calculator.

That’s a page that allows you to put in the gate dimensions and get out the required hinge offsets and angles to make the gate sit neatly, so it is vertical both when closed and when fully open.

That page still needs some extra help-features to explain just how it works, but it seems OK as far as it goes. It was vastly less work than the birthdate calculator!

Rising Gate Geometry 2 (Wonkish)

The previous post demonstrated that gate hinges should lie in a vertical plane normal to the bisector of the open and closed gate positions. Here’s the plan view of the hinges in the open position: (click for a bigger version)

gate5-1

Plan view of hinges, gate fully open

Triangles BFG and BFK, lying in the horizontal plane, are mirror images. So, length FK must be ONS

gate7-1

 

The points labelled here are exactly the same as the ones in the previous diagram. Length FK in the horizontal BFK plane is ONS, because triangle BFK and BFG are mirror images. Length KM is also ONS, because that’s how we made the spacer for the gate. Triangles AFK and AMK are therefore mirror images, because they are both right triangles, they share a hypotenuse and have side KM equal to side KF. So, angle KAF is equal to angle KAM. Let’s call this angle θ. And, call distance AF, the vertical distance between the hinges, OUD.

tan θ = KF / AF = ONS / OUD

θ = tan-1 (ONS / OUD)

Here’s how the gate looks when fully open.

gate8

 

The gate rises up at an angle 2θ from the horizontal. The effective length of the gate, JK, is OGATE + ONS.

JN / JK = sin (2θ)

Rise = JN = (OGATE + ONS) * sin (2θ)

Rise = (OGATE + ONS) * sin(2 * tan-1 (ONS / OUD))   ♦ Equation 2
Oddly, this doesn’t depend on β. Is that right?

So now I have some equations for the variables ONS and OWE. Here are the parameters fixed by the requirements of the gate design:

Symbol Meaning
OUD Vertical pitch between gate hinges
OGATE Width of gate when closed, measured from centre of top hinge pin to outside edge of gate
Rise Required Rise of gate when fully open
β Angle between gate open and gate closed

Here are the parameters I’m trying to determine:

Symbol Meaning
ONS Offset of bottom hinge parallel to the gate
OWE Outset of bottom hinge at right angles to the gate

And here are my equations:

OWE = ONS * tan (90° – β/2)                                       ♦ Equation 1, from previous post

Rise = (OGATE + ONS) * sin(2 * tan-1 (ONS / OUD))     ♦ Equation 2

I don’t actually know of a symbolic solution of (2) for ONS. Fortunately, that doesn’t stop me solving it numerically, which will come in a post real soon now.

 

Rising Gate Geometry (Wonkish)

This post is a geometry exercise to work out the hinge offsets needed to make a gate rise from its closed to open position, but sit vertical at both closed and open positions. Between closed and open, it won’t be vertical.

You shouldn’t need to understand all this post just to hang a gate. I’ll be posting a calculator for this later. Click any of these diagrams for a bigger version.

gate1

Plan view of hinges, gate fully closed.

The diagram above shows a view looking down on the top of the gatepost when the gate is closed. Point A is the top hinge pin and point B is the bottom hinge pin. The gate is exactly vertical, although B is not directly below A, because the bottom hinge includes spacers to offset the hinge. The spacers offset the Hinge ONS in the north-south direction (parallel to the gate) and OWE in the east-west direction (perpendicular to the gate).

gate2

Plan view of hinges, gate half-open

This diagram shows the gate partially open, neither open nor closed, looking from above. The bottom bar of the gate, where the bottom hinge sits, is no longer directly underneath the top bar. The gate does not sit in a vertical plane. That’s OK. Only when the gate is fully open will it lie in a vertical plane again.

gate5-1

Plan view of hinges, gate fully open

The above diagram shows the gate fully open. This gate has been designed to be fully open at an angle β to its closed position. The diagram is confusing (sorry) because it’s a vertical plan view, and the gate has risen out of a 2D plane. Points B, K and F all lie in the horizontal plane through the lower hinge pin. Points M and H are in a horizontal plane raised above the plane BKF. It’s clear that M and H lie in a horizontal plane because

  • The hinge offset MH is normal to the gate plane, and
  • The gate plane is now vertical, because we’ve designed the gate plane to be vertical when the gate is open to an angle β

The line MH has a length OWE when the gate is closed and MH is horizontal in the same plane as hinge pin B. MH is again horizontal with the gate open to angle β, so again the projection of line MH on the horizontal plane containing points BKF still has length OWE.

The projection of the line MH in the plane BKF is at right angles to the intersection of the vertical gate plane and BKF. This is true however much the gate rotates in the vertical plane containing F and J, because MH is normal to the gate plane. So, line KB, parallel to MH but in the horizontal plane BKF, is at right angles to line FK, and also has length OWE.

Triangles BFG and BFK are mirror images, because are both right triangles, they share a hypotenuse and side BG is the same length as BK. So, angle BFK is the same as angle BFG – let’s call this α.

Point G, F and L lie on a straight line:

βαα = 180°

α = 90° – β/2

or, in other words, the vertical plane containing the hinges must lie at a right angle to the vertical plane containing the bisector of the angle between the open and closed gate positions.

Or, in yet other words:

  • Draw a line midway between the open and closed position of the gate
  • Draw a line through the top hinge, at right angles to that line
  • The bottom hinge must lie somewhere on that line
  • and the further you move it out from under the top hinge, the more the gate will rise
    but the gate will always be in a vertical plane when full open.

And, equivalently,

OWE / ONS = tan α

OWE = ONS * tan (90° – β/2)   ♦ Equation 1