5. SARRUS LINKAGE – JSP
The JSP Code

The JSP applet code given below was used to produce the diagram at right.

My first attempt at constructing this figure resulted in the hinge LK moving too far to the right, and finishing up below the ABCD plane. I found that I could correct this by halving the vertical and horizontal movement.

With this more complicated applet, I found it helpful to include a lot of comments and labels within the program itself.



       
<APPLET CODE="GSP.class"
WIDTH=375 HEIGHT=300 ALIGN=left>
<PARAM NAME=Frame VALUE=1>
<PARAM NAME=BackRed VALUE=255>
<PARAM NAME=BackGreen VALUE=255>
<PARAM NAME=BackBlue VALUE=200>
<PARAM NAME=Construction VALUE="

{Define base square}
{1} FixedPoint (115, 285) [label ('A')];
{2} FixedPoint (210, 285) [label ('B')];
{3} FixedPoint (285, 215) [label ('C')];
{4} FixedPoint (185, 215) [label ('D')];
{5} Segment (1, 2) [thick, color (100, 50, 50)]; {AB}
{6} Segment (2, 3) [thick, color (100, 50, 50)]; {BC}
{7} Segment (3, 4) [thick, color (100, 50, 50)]; {CD}
{8} Segment (4, 1) [thick, color (100, 50, 50)]; {DA}
{9} Polygon (1, 2, 3, 4) [color (150, 50, 50)]; {ABCD}

{Define left side lower 'square'}
{10} Circle by radius (1, 5) [hidden];
{11} Point on object (10, -1.57) [label ('J')];
{12} Segment (1, 11) [thick, color (0, 100, 0)]; {AJ}
{13} Translation (11, 70, 70) [label ('M')];
{14} Segment (11, 13) [thick, color(100, 100, 100)]; {JM}
{15} Polygon (1, 4, 13, 11) [color (0, 200, 0)]; {ADMJ}

{Define left side upper 'square'}
{16} Parallel (5, 11) [hidden];
{17} Reflection (1, 16) [label ('E')];
{18} Translation (17, 70, 70) [label ('H')];
{19} Segment (17, 18) [thick, color (0, 100, 0)]; {EH}
{20} Segment (11, 17) [thick, color (0, 100, 0)]; {JE}
{21} Polygon (11, 13, 18, 17) [color (0, 200, 0)]; {JMHE}

{Define top square}
{22} Translation (17, 100, 0) [label('F')];
{23} Translation (18, 100, 0) [label('G')];
{24} Segment (18, 23) [thick, color (100, 50, 50)]; {HG}
{25} Segment (17, 22) [thick, color (100, 50, 50)]; {EF}
{26} Segment (22, 23) [thick, color (100, 50, 50)]; {FG}
{27} Polygon (17, 22, 23, 18) [layer (2), color (150, 50, 50)]; {EFGH}

{Define back hinge and adjacent squares}
{28} Circle by radius (23, 5) [hidden]; {centre G}
{29} Circle by radius (3, 5) [hidden]; {centre C}
{30} Intersect1 (28, 29) [hidden]; {K*)}
{31} Segment (3, 23) [hidden]; {CG}
{32} Midpoint (31) [hidden]; {call this T}
{33} Segment (30, 32) [hidden]; {K*T}
{34} Midpoint (33) [hidden]; {K**}

{35} Perpendicular (5, 34) [hidden]; {vert line thru K**}
{36} FixedPoint (0, 115) [hidden]; {initial LK** y-coordinate}
{37} Perpendicular (35, 36) [hidden]; {initial LK** line}
{38} Intersect (35, 37) [hidden]; {K** projection on LK** line}
{39} Segment (34, 38) [hidden];
{40} Midpoint (39) [label ('K')]; {midpoint of vertical projection segment}

{41} Translation (40, -100, 0) [label('L')];

{44} Segment (23, 40) [thick, color (0, 100, 0)]; {GK}
{45} Segment (40, 41) [thick, color(100, 100, 100)]; {KL}
{46} Polygon (23, 18, 41, 40) [color (100,100, 200)]; {GHLK}

{47} Segment (3, 40) [thick, color (0, 100, 0)]; {CK}
{48} Polygon (3, 4, 41, 40) [color (100, 100, 200)]; {CDLK}

{Path of point J}
{49} Circle by radius (1, 5) [color (155, 50, 50)];

{Path of point H}
{50} Line (4, 18) [color (155, 50, 50)];

">
</APPLET>
Choose the window size to accommodate edge lengths of easy size to work with.

We define a pale yellow background.





This is the easy part!






This is our first use of the Polygon command for shading the interior of a polygon.


We shall take J as the driving point for this applet.
Because of the nature of this linkage, there are lots of parallels, and the Translation command is useful.



Notice that in the movement of the linkage, E is always the reflection of A in a horizontal line through J.






This is straightforward.





In {27} we use the layer command to place the top square 'on top'. Lower numbers imply lower position.

Now the fun starts! The point K* defined by {30} is the obvious candidate, being equidistant from C and G. However, proceding with this choice gives an unrealistic linkage. This is becasue this linkage is 3-dimensional, and in real life there is some 'fore-shortening' of some of the links. The point K** moves like K*, but only half the horizontal distance.

The choice of K** is still not realistic: in particular, the point K** finishes up below ABCD as J moves towards line AB. We therefore construct K to move down only half the distance of K**.

I would like to say this was all carefully calculated, but there was some trial and error as well!


The applet now works well.

Choosing these two square blue rather than green gives better definition during the movement of the linkage.




We sketch the path of point J. It would be good if JSP allowed the sketching of just an arc.

We sketch the vertical path traced out by point H. Neither of these paths has any constraining effect on the point tracing it.

Exercises

1. In your program, you might try adding a ‘traced’ command to points J and H. You will find that these traces exactly follow the indicated paths.

2. Think about the construction of this linkage. How much is required mathematically? How much is required mechanically?

3. If you haven’t thought about this already, check why the midpoint arguments relating to the pictorial representation of the movement of K actually work.