# Khan/khan-exercises

Fetching contributors…
Cannot retrieve contributors at this time
212 lines (200 sloc) 8.98 KB
 Area problems
randFromArray(metricUnits.concat([genericUnit]))
randRange(2, 8) i18n._("area")

One side of a square is S plural_form(UNIT_TEXT, S) long. What is its area?

S * S square plural_form(UNIT_TEXT)
init({ range: [[-1, S + 1], [-1, S + 1]], scale: 30}); path([[0, 0], [S, 0], [S, S], [0, S], true], { stroke: BLUE, fill: "#eee" }); label([S / 2, S], S + "\\text{ " + UNIT + "}", "above"); label([0, S / 2], S + "\\text{ " + UNIT + "}", "left");

The area is the length times the width.

_(S - 1).times(function(y) { style({ stroke: GRAY, strokeWidth: 1, strokeDasharray: "-" }, function() { path([[0, y + 61 / 60], [S, y + 61 / 60]]); path([[y + 61 / 60, 0], [y + 61 / 60, S]]); }); });

The length is S plural_form(UNIT_TEXT, S) and the width is S plural_form(UNIT_TEXT, S), so the area is S\timesS square plural_form(UNIT_TEXT, S * S).

\qquad\text{AREA} = S \times S = S * S

We can also count S * S square plural_form(UNIT_TEXT, S * S).

_(S * S).times(function(n) { label([n % S + 0.5, S - floor(n / S) - 0.5], n + 1, "center", false) .css({ color: GRAY }); });
randRange(2, 8)

The area of a square is S * S square plural_form(UNIT_TEXT, S * S). How long is each side?

S plural_form(UNIT_TEXT)
init({ range: [[-1, 6], [-1, 6]] }); path([[0, 0], [5, 0], [5, 5], [0, 5], true], { stroke: BLUE, fill: "#eee" }); // I18N: This is something like ? cm label([2.5, 5], "\\text{" + i18n._("? %(UNIT)s", {UNIT: UNIT}) + "}", "above", { "color": PINK }); // I18N: This is something like ? cm label([0, 2.5], "\\text{" + i18n._("? %(UNIT)s", {UNIT: UNIT}) + "}", "left", { "color": PINK });
path([[0, 0], [0, 5]], { strokeWidth: 4, stroke: PINK }); path([[0, 5], [5, 5]], { strokeWidth: 4, stroke: PINK });

The area is the length times the width.

\qquad \pink{\text{?}} \times \pink{\text{?}} = S * S\text{ UNIT}

\qquad \pink{S} \times \pink{S} = S * S\text{ UNIT}

The sides of a square are all the same length, so each side must be S plural_form(UNIT_TEXT, S) long.

randRange(2, 8) randRange(W + 1, 9) i18n._("area")

A rectangle is L plural_form(UNIT_TEXT, L) long and W plural_form(UNIT_TEXT, W) wide. What is its area?

L * W square plural_form(UNIT_TEXT)
init({ range: [[-1, L + 1], [-1, W + 1]], scale: 30 }); path([[0, 0], [L, 0], [L, W], [0, W], true], { stroke: BLUE, fill: "#eee" }); label([L / 2, W], L + "\\text{ " + UNIT + "}", "above"); label([L, W / 2], W + "\\text{ " + UNIT + "}", "right");

The area is the length times the width.

style({ stroke: GRAY, strokeWidth: 1, strokeDasharray: "-" },function() { _(L - 1).times(function(x) { path([[x + 61 / 60, 0], [x + 61 / 60, W]]); }); _(W - 1).times(function(y) { path([[0, y + 61 / 60], [L, y + 61 / 60]]); }); });

The length is L plural_form(UNIT_TEXT, L). The width is W plural_form(UNIT_TEXT, W). So the area is L\timesW square plural_form(UNIT_TEXT, L * W).

\qquad\text{AREA} = L \times W = L * W

We can also count L * W square plural_form(UNIT_TEXT, L * W).

_(L * W).times(function(n) { label([n % L + 0.5, W - floor(n / L) - 0.5], n + 1, "center", false) .css({ color: GRAY }); });