shuffle([null]. concat(randRangeUnique(5, 16, 2))) _.map(SIDES, function(s) { if (s === null) { return randRange(20, 140); } return null; }) solveTriangle({ sides: SIDES.slice(), angles: ANGLES.slice(), sideLabels: SIDES.slice(), angleLabels: _.map(ANGLES, function(a) { return a == null ? a : a + "^\\circ"; }), vertexLabels: ["A", "B", "C"] }) SIDES.indexOf(null) ["BC", "AC", "AB"][UNKNOWN] "abc"[UNKNOWN] SIDES[(UNKNOWN + 1) % 3] SIDES[(UNKNOWN + 2) % 3] roundTo(1, sqrt(KNOWN_SIDE_1 * KNOWN_SIDE_1 + KNOWN_SIDE_2 * KNOWN_SIDE_2 - 2 * KNOWN_SIDE_1 * KNOWN_SIDE_2 * cos(ANGLES[UNKNOWN] * PI / 180))) rand(2) ? randRange(-20, 20) : randRange(160, 200)

Find `UNKNOWN_MEASURE`.

Round to the nearest tenth.

TRIANGLE = addTriangle(_.extend(TRIANGLE, { xPos: 1, yPos: 1, width: 10, height: 6, rot: ROTATION })); init({ range: [[0, TRIANGLE.width + 2], [0, TRIANGLE.height + 2]] }); TRIANGLE.draw();
SOLUTION

You can use the law of cosines:

`\qquad \pink{UNKNOWN_SIDE}^2 \quad = \quad \blue{"abc"[(UNKNOWN + 1) % 3]}^2 + \green{"abc"[(UNKNOWN + 2) % 3]}^2 - 2\blue{"abc"[(UNKNOWN + 1) % 3]} \green{"abc"[(UNKNOWN + 2) % 3]} \space\cos(\pink{"ABC"[UNKNOWN]})`

TRIANGLE.sideLabels = _.map(SIDES, function(s, n) { return s == null ? "abc"[n] : "abc"[n] + " = " + s; }); TRIANGLE.sideLabels[UNKNOWN] = "\\pink{" + TRIANGLE.sideLabels[UNKNOWN] + "}"; TRIANGLE.angleLabels[UNKNOWN] = "\\pink{" + TRIANGLE.angleLabels[UNKNOWN] + "}"; TRIANGLE.sideLabels[(UNKNOWN + 1) % 3] = "\\blue{" + TRIANGLE.sideLabels[(UNKNOWN + 1) % 3] + "}"; TRIANGLE.sideLabels[(UNKNOWN + 2) % 3] = "\\green{" + TRIANGLE.sideLabels[(UNKNOWN + 2) % 3] + "}"; TRIANGLE.color = GRAY; TRIANGLE.draw();

Plug in the known values:

`\qquad \pink{UNKNOWN_SIDE}^2 \quad = \quad \blue{KNOWN_SIDE_1}^2 + \green{KNOWN_SIDE_2}^2 - 2(\blue{KNOWN_SIDE_1}) (\green{KNOWN_SIDE_2}) \space\cos(\pink{ANGLES[UNKNOWN]^\circ})`

`\qquad \pink{UNKNOWN_SIDE}^2 \quad = \quad KNOWN_SIDE_1 * KNOWN_SIDE_1 + KNOWN_SIDE_2 * KNOWN_SIDE_2 - 2 * KNOWN_SIDE_1 * KNOWN_SIDE_2 \cdot\cos(\pink{ANGLES[UNKNOWN]^\circ})`

Evaluate and simplify the right side:

`\qquad \pink{UNKNOWN_SIDE}^2 \quad \approx \quad roundTo(9, KNOWN_SIDE_1 * KNOWN_SIDE_1 + KNOWN_SIDE_2 * KNOWN_SIDE_2 - 2 * KNOWN_SIDE_1 * KNOWN_SIDE_2 * cos(ANGLES[UNKNOWN] * Math.PI / 180))`

Take the positive square root of both sides (we only need to worry about the positive square root because the side of a triangle can't have negative length):

`\qquad \pink{UNKNOWN_SIDE} \quad \approx \quad \sqrt{roundTo(9, KNOWN_SIDE_1 * KNOWN_SIDE_1 + KNOWN_SIDE_2 * KNOWN_SIDE_2 - 2 * KNOWN_SIDE_1 * KNOWN_SIDE_2 * cos(ANGLES[UNKNOWN] * Math.PI / 180)) }`

Evaluate and round to the nearest tenth:

`\qquad \pink{UNKNOWN_MEASURE} \quad = \quad \pink{UNKNOWN_SIDE} \quad \approx \quad SOLUTION`

TRIANGLE.sideLabels[UNKNOWN] = "\\pink{" + UNKNOWN_SIDE + " \\approx " + SOLUTION + "}"; TRIANGLE.draw();
randRange(5, 15, 3) solveTriangle({ sides: SIDES.slice(), angles: [null, null, null], sideLabels: SIDES.slice(), vertexLabels: ["A", "B", "C"] }) randRange(0, 2) "ABC"[UNKNOWN] SIDES[(UNKNOWN + 1) % 3] SIDES[(UNKNOWN + 2) % 3] fraction( KNOWN_SIDE_1 * KNOWN_SIDE_1 + KNOWN_SIDE_2 * KNOWN_SIDE_2 - SIDES[UNKNOWN] * SIDES[UNKNOWN], 2 * KNOWN_SIDE_1 * KNOWN_SIDE_2) roundTo(0, acos( (KNOWN_SIDE_1 * KNOWN_SIDE_1 + KNOWN_SIDE_2 * KNOWN_SIDE_2 - SIDES[UNKNOWN] * SIDES[UNKNOWN]) / (2 * KNOWN_SIDE_1 * KNOWN_SIDE_2)) / PI * 180) rand(2) ? randRange(-20, 20) : randRange(160, 200)

Find `m\angle UNKNOWN_ANGLE`.

Round to the nearest degree.

TRIANGLE = addTriangle(_.extend(TRIANGLE, { xPos: 1, yPos: 1, width: 10, height: 6, rot: ROTATION })); init({ range: [[0, TRIANGLE.width + 2], [0, TRIANGLE.height + 2]] }); TRIANGLE.draw();
SOLUTION `\Large{^\circ}`

You can use the law of cosines:

`\qquad \pink{"abc"[UNKNOWN]}^2 \quad = \quad \blue{"abc"[(UNKNOWN + 1) % 3]}^2 + \green{"abc"[(UNKNOWN + 2) % 3]}^2 - 2\blue{"abc"[(UNKNOWN + 1) % 3]} \green{"abc"[(UNKNOWN + 2) % 3]} \space\cos(\pink{"ABC"[UNKNOWN]})`

TRIANGLE.sideLabels = _.map(SIDES, function(s, n) { return "abc"[n] + " = " + s; }); TRIANGLE.sideLabels[UNKNOWN] = "\\pink{" + TRIANGLE.sideLabels[UNKNOWN] + "}"; TRIANGLE.vertexLabels[UNKNOWN] = "\\pink{" + "ABC"[UNKNOWN] + "}"; TRIANGLE.sideLabels[(UNKNOWN + 1) % 3] = "\\blue{" + TRIANGLE.sideLabels[(UNKNOWN + 1) % 3] + "}"; TRIANGLE.sideLabels[(UNKNOWN + 2) % 3] = "\\green{" + TRIANGLE.sideLabels[(UNKNOWN + 2) % 3] + "}"; TRIANGLE.color = GRAY; TRIANGLE.draw();

Rewrite the law of cosines to solve for `\cos(\pink{"ABC"[UNKNOWN]})`:

`\qquad \cos(\pink{"ABC"[UNKNOWN]}) \quad = \quad \dfrac{ \blue{"abc"[(UNKNOWN + 1) % 3]}^2 + \green{"abc"[(UNKNOWN + 2) % 3]}^2 - \pink{"abc"[UNKNOWN]}^2 }{2\blue{"abc"[(UNKNOWN + 1) % 3]} \green{"abc"[(UNKNOWN + 2) % 3]}}`

Plug in the known values:

`\qquad \cos(\pink{"ABC"[UNKNOWN]}) \quad = \quad \dfrac{ \blue{KNOWN_SIDE_1}^2 + \green{KNOWN_SIDE_2}^2 - \pink{SIDES[UNKNOWN]}^2 }{2(\blue{KNOWN_SIDE_1}) (\green{KNOWN_SIDE_2})}`

Simplify the right side:

`\qquad \cos(\pink{"ABC"[UNKNOWN]}) \quad = \quad COS_UNKNOWN`

Evaluate the inverse cosine to find `m\angle UNKNOWN_ANGLE` and round to the nearest degree:

`\qquad \pink{m\angle UNKNOWN_ANGLE} \quad = \quad \cos^{-1}\left(COS_UNKNOWN\right) \quad \approx \quad \pink{SOLUTION^\circ}`

TRIANGLE.angleLabels[UNKNOWN] = "\\pink{" + SOLUTION + "^\\circ}"; TRIANGLE.draw();