Dudeney triangle/square puzzle
Vertices of the equilateral triangle
In[]:=
pA={0,0}pB={1,0}pC={1/2,Sqrt[3]/2}
Out[]=
{0,0}
Out[]=
{1,0}
Out[]=
,
1
2
3
2
Midpoints of AC and BC
In[]:=
pD=(pA+pC)/2pE=(pB+pC)/2
Out[]=
,
1
4
3
4
Out[]=
,
3
4
3
4
Area and side length of square
In[]:=
a=Area[Triangle[{pA,pB,pC}]]
Out[]=
3
4
In[]:=
s=Sqrt[a]s//N
Out[]=
1/4
3
2
Out[]=
0.658037
Find Point F along AB
Assume length of EF is the side length of the square
Assume length of EF is the side length of the square
In[]:=
solnF=Solve[pE[[2]]^2+(pE[[1]]-xF)^2==a,xF]
Out[]=
xF3-3+
1
4
-3+4
,xF3
1
4
-3+4
3
In[]:=
pF={xF,0}/.solnF[[1]][[1]]pF//N
Out[]=
3-
1
4
-3+4
,03
Out[]=
{0.254508,0.}
Find Point G along AB
Assume it is at Point F + 1/2
Assume it is at Point F + 1/2
In[]:=
pG=pF+{1/2,0}pG//N
Out[]=
+3-
1
2
1
4
-3+4
,03
Out[]=
{0.754508,0.}
In[]:=
Simplify[pG]
Out[]=
5-
1
4
-3+4
,03
Slope and equation of Line FE
In[]:=
mFE=(pE[[2]]-pF[[2]])/(pE[[1]]-pF[[1]])mFE//N
Out[]=
3
4+-3+
3
4
1
4
-3+4
3
Out[]=
0.873904
In[]:=
eqFE=Expand[y-pF[[2]]==mFE(x-pF[[1]])]
Out[]=
y-++
3
3
16+-3+
3
4
1
4
-3+4
3
3(-3+4
3
)16+-3+
3
4
1
4
-3+4
3
3
x4+-3+
3
4
1
4
-3+4
3
Slope and equation of Line DH
In[]:=
mDH=-1/mFEmDH//N
Out[]=
-
4+-3+
3
4
1
4
-3+4
3
3
Out[]=
-1.14429
In[]:=
eqDH=Expand[y-pD[[2]]==mDH(x-pD[[1]])]
Out[]=
-+y(-3+4-(-3+4x
3
4
1
4
1
3
3
)1
3
3
)Get Point H by intersection and check if DH is half the side length
In[]:=
solnH=Solve[{eqFE,eqDH},{x,y}]
Out[]=
x(2+2
1
8
3
),y1
8
3
--3+4
3
In[]:=
pH={x,y}/.solnH[[1]]pH//N
Out[]=
(2+2
1
8
3
),1
8
3
--3+4
3
Out[]=
{0.466506,0.185267}
In[]:=
ArcLength[Line[{pD,pH}]]//NSimplify[ArcLength[Line[{pD,pH}]]]==s/2
Out[]=
0.329019
Out[]=
True
Slope and equation of Line GJ
In[]:=
mGJ=-1/mFEmGJ//N
Out[]=
-
4+-3+
3
4
1
4
-3+4
3
3
Out[]=
-1.14429
In[]:=
eqGJ=Expand[y-pG[[2]]==mGJ(x-pG[[1]])]
Out[]=
y-1++(-3+4-(-3+4x
3
4
5
4
1
3
3
)1
3
3
)Get Point J by intersection and check if GJ is half the side length
In[]:=
solnJ=Solve[{eqFE,eqGJ},{x,y}]
Out[]=
x10-
1
8
3
-2-3+4
,y3
1
8
-3+4
3
In[]:=
pJ={x,y}/.solnJ[[1]]pJ//N
Out[]=
10-
1
8
3
-2-3+4
,3
1
8
-3+4
3
Out[]=
{0.538001,0.247746}
In[]:=
ArcLength[Line[{pG,pJ}]]//NSimplify[ArcLength[Line[{pG,pJ}]]]==s/2
Out[]=
0.329019
Out[]=
True
Define the pieces
In[]:=
r1=Triangle[{pF,pJ,pG}];r2=Polygon[{pE,pB,pG,pJ}];r3=Polygon[{pD,pC,pE,pH}];r4=Polygon[{pA,pD,pH,pF}];
Draw the triangle with all the points
Rotate the green triangle about Point G
Rotate the orange and green pieces together about Point E
Rotate the blue, orange, and green pieces together about Point D
Rotate the square to make the sides horizontal and vertical
Show full triangle with green triangle rotated 180° and moved up to Line DE