randFromArray([ ["in", "inch"], ["ft", "foot"], ["m", "meter"], ["cm", "centimeter"], ["", "unit"] ])
randRange(2, 9) randRange(2, 9) sqrt(B * B + H * H)

What is the area of the triangle?

init({ range: [[-2, B + 1], [-1, H + 1]], scale: 30 }); path([[0, 0], [0, H], [B, 0], true], {stroke: BLUE, fill: "#eee"}); label([B / 2, 0], B + "\\text{ " + UNIT + "}", "below"); label([0, H / 2], H + "\\text{ " + UNIT + "}", "left"); // Label hypotenuse if it's an integer if (HYP === round(HYP)) { label([B / 2, H * 0.55], HYP + "\\text{ " + UNIT + "}", "right"); } path([[0, 0.3], [0.3, 0.3], [0.3, 0]], { stroke: BLUE });
(B * H) / 2 square plural(UNIT_TEXT)
style({ stroke: GRAY, strokeWidth: 1, strokeDasharray: "-" }, function() { _(B).times(function(x) { path([[x + 61 / 60, 0], [x + 61 / 60, H]]); }); _(H).times(function(y) { path([[0, y + 61 / 60], [B, y + 61 / 60]]); }); });

The base of the triangle is pluralTex(B, UNIT_TEXT) and the height is pluralTex(H, UNIT_TEXT), so the area of the rectangle shown above is B \times H.

The triangle takes up half as much area as the rectangle, so the area of the triangle is \frac{1}{2} of B \times H.

 \text{area} = \frac{1}{2} \times B \times H = (B * H) / 2 

randRange(3, 9) randRange(2, 9) randRange(H + 1, floor(sqrt(H * H + B * B) - 1)) sqrt(HYP * HYP - H * H)

What is the area of the triangle?

init({ range: [[-2, B + 1], [-1, H + 1]], scale: 30 }); path([[0, 0], [TOP, H], [B, 0], true], {stroke: BLUE, fill: "#eee"}); label([B / 2, 0], B + "\\text{ " + UNIT + "}", "below"); graph.hypotenuseLabel = label([TOP * 0.5, H * 0.5], HYP + "\\text{ " + UNIT + "}", "left"); path([[TOP + 1/60, 0], [TOP + 1/60, H]], { stroke: BLUE, strokeWidth: 1, strokeDasharray: "- " }); graph.heightLabel = label([TOP, H * 0.4], H + "\\text{ " + UNIT + "}", TOP / B > 0.5 ? "left" : "right");
(B * H) / 2 square plural(UNIT_TEXT)
graph.hypotenuseLabel.remove(); graph.grid = raphael.set(); style({ stroke: GRAY, strokeWidth: 1, strokeDasharray: "-" }, function() { _(B + 1).times(function(x) { if (x !== TOP) { graph.grid.push(path([[x + 1 / 60, 0], [x + 1 / 60, H]])); } }); _(H).times(function(y) { graph.grid.push(path([[0, y + 61 / 60], [B, y + 61 / 60]])); }); }); graph.heightLabel.remove(); graph.heightLabel = label([0, H / 2], H + "\\text{ " + UNIT + "}", TOP / B > 0.5 ? "left" : "left");

The base of the triangle is pluralTex(B, UNIT_TEXT) and the height is pluralTex(H, UNIT_TEXT), so the area of the rectangle shown above is B \times H.

The triangle takes up half as much area as the rectangle (look at the left part and the right part separately to see how), so the area of the triangle is \frac{1}{2} of B \times H.

graph.leftBox = path([[-1, -1], [-1, H + 1], [TOP, H + 1], [TOP, -1], true], { stroke: false, fill: "#f8f8f8", opacity: 0.0 }); graph.rightBox = path([[B + 1, -1], [B + 1, H + 1], [TOP + 1 / 60, H + 1], [TOP + 1/60, -1], true], { stroke: false, fill: "#f8f8f8", opacity: 0.0 }); $("#left-part").bind("mouseover vmouseout", function(event) { if (event.type === "mouseover") { graph.rightBox.animate({ opacity: 0.8 }, 50); } else { graph.rightBox.animate({ opacity: 0.0 }, 50); } } );$("#right-part").bind("mouseover vmouseout", function(event) { if (event.type === "mouseover") { graph.leftBox.animate({ opacity: 0.8 }, 50); } else { graph.leftBox.animate({ opacity: 0.0 }, 50); } } );

 \text{area} = \frac{1}{2} \times B \times H = (B * H) / 2 

randRange(3, 9) randRange(2, 9) randFromArray([ randRange(-5, -1), randRange(B + 1, B + 5) ])

What is the area of the triangle?

init({ range: [[min(0, TOP) - 2, max(B, TOP) + 1], [-1, H + 1]], scale: 30 }); path([[0, 0], [TOP, H], [B, 0], true], {stroke: BLUE, fill: "#eee"}); label([B / 2, 0], B + "\\text{ " + UNIT + "}", "below"); if (TOP > 0) { label([TOP * 0.5, H * 0.6], round(sqrt(TOP * TOP + H * H)) + "\\text{ " + UNIT + "}", "left"); } else { label([(B + TOP) * 0.5, H * 0.6], round(sqrt((B - TOP) * (B - TOP) + H * H)) + "\\text{ " + UNIT + "}", "right"); } path([[TOP + 1/60, 0], [TOP + 1/60, H]], { stroke: BLUE, strokeWidth: 1, strokeDasharray: "- " }); label([TOP, H * 0.4], H + "\\text{ " + UNIT + "}", TOP < 0 ? "left" : "right");
(B * H) / 2 square plural(UNIT_TEXT)

The area of any triangle is \frac{1}{2} \text{base} \times \text{height}.

The base of the triangle is pluralTex(B, UNIT_TEXT) and the height is pluralTex(H, UNIT_TEXT).

 \text{area} = \frac{1}{2} \times B \times H = (B * H) / 2