randomTriangle() [ "B", "C", "Both", "None" ] randFromArray( ANSWERS ) ANSWER === "B" || ANSWER === "Both" ? shuffle( MAIN ) : randomTriangle( MAIN ) ANSWER === "C" || ANSWER === "Both" ? shuffle( MAIN ): randomTriangle( MAIN ) function(){ var tr = new Triangle( [ 3, -2 ], MAIN, 5, {} ); tr.labels = { "name" : "A", "angles" : clearArray( tr.niceAngles, [ 0, 2 ] ) }; tr.rotate( randRange( 0, 360 ) ); tr.boxOut( [ [ [ -4, 1.5 ], [ 10, 1.5 ] ] ], [ 0, -0.5 ] ); return tr; }() function(){ var trA = new Triangle( [ 2, -8 ], B, randRange( 400, 600 )/100, { } ); trA.labels = { "name" : "B", "angles" : clearArray( trA.niceAngles, [ 0, 1 ] ) }; trA.rotate( randRange( 0, 360 ) ); trA.color = "blue"; trA.boxOut( [ [ [ -1, -10 ], [ -1, 20 ] ] ], [ 0.5, 0 ] ); trA.boxOut( TR.sides, [ 0, -1 ] ); return trA; }() function(){ var trB = new Triangle( [ 7, -6 ], C, randRange( 400, 600 )/100, {} ); trB.labels = { "name" : "C", "angles" : clearArray( trB.niceAngles, [ 0, 2 ] ) }; trB.rotate( randRange( 0, 360 ) ); trB.color = "red"; trB.boxOut( [ [ [ 13, -10 ], [ 13, 20 ] ] ], [ -0.5, 0 ] ); trB.boxOut( TR.sides, [ 0, -1 ] ); trB.boxOut( TR_A.sides, [ 0, -1 ] ); return trB; }()
Which triangles are similar to triangle `A`?
init({ range: [ [-1, 13 ], [ -14, 2.5 ] ], scale: 35 }) TR.draw(); TR.drawLabels(); style({ stroke: "blue", }); TR_A.draw(); TR_A.drawLabels(); style({ stroke: "red", }); TR_B.draw(); TR_B.drawLabels();
• B
• C
• Both
• None

Two triangles are similar if their angles are congruent (equal).

We see that triangle `A` has angles of `MAIN[ 0 ]` and `MAIN[ 2 ]`. The third angle is therefore `180 - MAIN[ 0 ] - MAIN[ 2 ] = MAIN[ 1 ]`

TR.labels.angles = TR.niceAngles; TR.drawLabels();

Triangle `B` has angles of `B[ 0 ]` and `B[ 1 ]`. The third angle is `180 - B[ 0 ] - B[ 1 ] = B[ 2 ]`. Therefore triangle `B` is not similar to triangle `A`.

style({ stroke: "blue", }); TR_A.labels.angles = TR_A.niceAngles; TR_A.drawLabels();

Triangle `C` has angles of `C[ 0 ]` and `C[ 2 ]`. The third angle is `180 - C[ 0 ] - B[ 2 ] = C[ 1 ]`. Therefore triangle `C` is not similar to triangle `A`.

style({ stroke: "red", }); TR_B.labels.angles = TR_B.niceAngles; TR_B.drawLabels();