[Home] [Puzzles & Projects] [Delphi Techniques] [Math Topics] [Library] [Utilities]


Problem Description
Cut a square into four pieces that can be reassembled into an equilateral triangle with the same area.
Background & TechniquesA geometric dissection is a division of a polygon into pieces that can be rearranged to form a polygon of a different shape. The self taught mathematician and British puzzleist, H. E. Dudeney, published this interesting geometric dissection in 1902. This program allows you to print a square and triangle of appropriate size so you can work on it yourself, or print the set of polygons that you can rearrange into either shape. There is also a button to bring up a form with some of the construction details, for those that may be interested. As a programming exercise, there were two challenges. First was to determine where to draw the lines which form the polygons. The construction usually proceeds from the triangular form  the problem then being to translate these corner points appropriately to the square. I added a PointPerpendicularLine function to define the last two polygon lines. Also a Dist function to locate the offsets for polygon corners when redrawing them on the square The second challenge was transferring the image to the printer. Simply "stretchdrawing" the image canvas to the printer canvas works, but the printout appears rather coarse. (Since typical screen resolution is around 100 pixels per inch and a typical printer prints at 600 pixels per inch, the printed pixels will be about 6 times larger than on the screen image.) It's much better to redraw the image on the printer canvas. The "trick" used here is to generalize the drawing routines so that the same code is used for the onscreen displays and for the printer canvas. Running/Exploring the ProgramSuggestions for Further ExplorationsI had planned to animate the solution  the polygons can be "hinged" so that with three shared corners as hinge points a you can rearrange them into either shape. You can find several Java versions on the web, so it can't be that hard to do in Delphi. Just too many other things to do right now  we'll get back to it one of these days. Apparently there are many other dissections, octagon to square, pentagon to square, etc.

[Feedback] [Newsletters (subscribe/view)] [About me]Copyright © 20002016, Gary Darby All rights reserved. 