SVG動畫:鉸鏈和搖桿

今完成了正三角形割補正方形的動畫:

但是,僅僅做成這樣,我是不會滿意的,因為我觀察到這是一個鉸鏈結構,作為本科機械專業的我怎麼可能錯過呢?

於是我開始試驗和研究linkage鉸鏈在svg動畫的實現。

三條鉸鏈:

搖桿機構:

全部都在搖:

四連桿機構需要一些小計算,首先要拿到每個端點的初始坐標,由此得到四邊形的每個邊長及每個内角,再決定第二個搖桿的旋轉角度,然後算出第三個和第四個搖桿的旋轉角度。計算過程會用到「通過三角形兩條邊及其夾角算出第三條邊的長度、通過三角形每條邊的長度獲得每個内角」。

通過以上試驗,我搞明白了鉸鏈的實現。

但是我仍然需要弄懂:去掉transform之後的初始狀態不同的元素如何聯動?

於是我又做了以下實驗:

圖中,左上是正常的轉動,右上是translate之後的轉動,左下是rotate之後又再加上rotate,右下是既translate又rotate之後的rotate。

這個研究說明了,translate和rotate,不改變元素本身的旋轉中心坐標。

則結合這兩個研究成果,就實現了不同初始狀態的兩個搖桿機構的聯動:

這個試驗說明了,如果元素B想跟隨元素A平移和旋轉,則B需要找到A的旋轉中心(將A的中心坐標加上A的translate再減去B的translate)。

這就解決了所有的疑問和難題,之後我就做成了三角形割補正方形的兩個鉸鏈及搖桿動畫。

鉸鏈:

搖桿:

haberdasher's puzzle

哈伯達舍爾拼圖是將一個等邊三角形切成四塊,可以重新排列成一個正方形。這是亨利·杜德尼首次在1902年的《每週調度》上發表的最偉大的數學發現,後來又在《坎特伯雷拼圖》(1907)中作為第26號問題發表。隨附的圖表顯示了解決方案,杜德尼描述如下:

將AB線段平分於D點,BC線段平分於E點;延長AE至F點,使EF等於EB;將AF平分於G點,並描述弧AHF;延長EB至H點,EH即為所需正方形的邊長,從F點以EH的距離描述弧HJ等於JK;現在,從L點和K點分別向EJ線段垂直投影,分別在L點和M點。

這個解決方案的一個顯著特徵是,每一塊都可以在一個頂點處鉸接,形成一個可以折疊成正方形或原始三角形的鏈條。兩個鉸接點將三角形的邊平分,而第三個鉸接點和大塊的底角將底邊切割成大約0.982: 2.018的比例。杜德尼曾在1905年5月17日於皇家學會的會議上展示過這樣一個模型,該模型由拋光過的桃花心木和黃銅鉸鏈製成。

參考文獻:
1. 杜德尼,H. E. 《坎特伯雷拼圖》。倫敦:納爾遜,1907年。紐約米內奧拉:多佛,1958年重印。

Here's the original English text from the image:

haberdasher's puzzle

The haberdasher's puzzle is to cut an equilateral triangle into four pieces that can be rearranged to make a square. It was the greatest mathematical discovery of Henry Dudeney and published by him, first in the Weekly Despatch in 1902 and then as problem no. 26 in The Canterbury Puzzles (1907).¹ The accompanying diagram shows the solution, which Dudeney describes as follows:

Bisect AB in D and BC in E; produce the line AE to F making EF equal to EB; bisect AF in G and describe arc AHF; produce EB to H, and EH is the length of the side of the required square, from F with distance EH, describe arc HJ equal to JK; now from the points L and K drop perpendiculars on EJ at L and M.

A remarkable feature of the solution is that the each of the pieces can be hinged at one vertex, forming a chain that can be folded into the square or the original triangle. Two of the hinges bisect sides of the triangle, while the third hinge and the corner of the large piece on the base cut the base in the approximate ratio 0.982: 2.018. Dudeney showed just such a model of the solution, made of polished mahogany with brass hinges, at a meeting of the Royal Society on May 17, 1905.

Reference
1. Dudeney, H. E. The Canterbury Puzzles. London: Nelson, 1907. Reprinted Mineola, NY: Dover, 1958.

Leave a Comment