This repository has been archived by the owner on May 11, 2021. It is now read-only.
/
area_of_squares_and_rectangles.html
255 lines (244 loc) · 11.2 KB
/
area_of_squares_and_rectangles.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!DOCTYPE html>
<html data-require="math graphie word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Finding dimensions given area</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="UNIT,UNIT_TEXT">randFromArray([
["in", new Plural(function(num) {
return $.ngettext("inch", "inches", num);
})],
["ft", new Plural(function(num) {
return $.ngettext("foot", "feet", num);
})],
["m", new Plural(function(num) {
return $.ngettext("meter", "meters", num);
})],
["cm", new Plural(function(num) {
return $.ngettext("centimeter", "centimeters", num);
})],
["", new Plural(function(num) {
return $.ngettext("unit", "units", num);
})]
])</var>
</div>
<div class="problems">
<div id="square-find-area">
<div class="vars">
<var id="S">randRange(2, 8)</var>
<var id="AREA">$._("area")</var>
</div>
<p class="question"><span data-if="isSingular(S)" data-unwrap="">
One side of a square is <code><var>S</var></code>
<var>UNIT_TEXT</var> long. What is its area?
</span><span data-else="" data-unwrap="">
One side of a square is <code><var>S</var></code>
<var>plural_form(UNIT_TEXT, S)</var> long. What is its area?
</span></p>
<div class="solution" data-type="multiple">
<span class="sol" data-forms="integer"><var>S * S</var></span> square
<var>plural_form(UNIT_TEXT)</var>
</div>
<div class="hints">
<div class="graphie" id="area">
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");
</div>
<p>
The area is the length times the width.
</p>
<div>
<div class="graphie" data-update="area">
_(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]]);
});
});
</div>
<p data-if="isSingular(S)">
The length is <var>S</var> <var>UNIT_TEXT</var> and
the width is <var>S</var> <var>UNIT_TEXT</var>, so the
area is <code><var>S</var>\times<var>S</var></code>
square <var>plural_form(UNIT_TEXT, S * S)</var>.
</p><p data-else="">
The length is <var>S</var> <var>plural_form(UNIT_TEXT, S)</var> and
the width is <var>S</var> <var>plural_form(UNIT_TEXT, S)</var>, so the
area is <code><var>S</var>\times<var>S</var></code>
square <var>plural_form(UNIT_TEXT, S * S)</var>.
</p>
</div>
<div>
<p><code>
\qquad\text{<var>AREA</var>} = <var>S</var> \times <var>S</var>
= <var>S * S</var>
</code></p>
<p>
We can also count <var>S * S</var>
square <var>plural_form(UNIT_TEXT, S * S)</var>.
</p>
<div class="graphie" data-update="area">
_(S * S).times(function(n) {
label([n % S + 0.5, S - floor(n / S) - 0.5],
n + 1, "center", false)
.css({ color: GRAY });
});
</div>
</div>
</div>
</div>
<div id="square-find-side">
<div class="vars">
<var id="S">randRange(2, 8)</var>
</div>
<p class="question">
The area of a square is <code><var>S * S</var></code>
square <var>plural_form(UNIT_TEXT, S * S)</var>. How long is each side?
</p>
<div class="solution" data-type="multiple">
<span class="sol" data-forms="integer"><var>S</var></span>
<var>plural_form(UNIT_TEXT)</var>
</div>
<div class="hints">
<div>
<div class="graphie" id="square">
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{" + $._("? %(UNIT)s", {UNIT: UNIT}) + "}", "above",
{ "color": PINK });
// I18N: This is something like ? cm
label([0, 2.5], "\\text{" + $._("? %(UNIT)s", {UNIT: UNIT}) + "}", "left",
{ "color": PINK });
</div>
</div>
<div>
<div class="graphie" data-update="square">
path([[0, 0], [0, 5]],
{ strokeWidth: 4, stroke: PINK });
path([[0, 5], [5, 5]],
{ strokeWidth: 4, stroke: PINK });
</div>
<p>
The area is the length times the width.
</p>
<p><code>\qquad \pink{\text{?}} \times \pink{\text{?}} =
<var>S * S</var>\text{ <var>UNIT</var>}
</code></p>
</div>
<div>
<p><code>\qquad \pink{<var>S</var>} \times
\pink{<var>S</var>} =
<var>S * S</var>\text{ <var>UNIT</var>}
</code></p>
<p data-if="isSingular(S)">
The sides of a square are all the same length, so each
side must be <code><var>S</var></code>
<var>UNIT_TEXT</var> long.
</p><p data-else="">
The sides of a square are all the same length, so each
side must be <code><var>S</var></code>
<var>plural_form(UNIT_TEXT, S)</var> long.
</p>
</div>
</div>
</div>
<div id="rectangle">
<div class="vars" data-ensure="L !== W">
<var id="L">randRange(2, 9)</var>
<var id="W">randRange(2, 9)</var>
<var id="AREA">$._("area")</var>
</div>
<p class="question">
<span data-if="isSingular(L)">A rectangle is
<code><var>L</var></code> <var>UNIT_TEXT</var>
long.</span><span data-else="">A rectangle is
<code><var>L</var></code> <var>plural_form(UNIT_TEXT, L)</var>
long.</span>
<span data-if="isSingular(W)">The rectangle is also
<code><var>W</var></code> <var>UNIT_TEXT</var>
wide. What is its area?</span><span data-else="">The rectangle is also
<code><var>W</var></code> <var>plural_form(UNIT_TEXT, W)</var>
wide. What is its area?</span>
</p>
<div class="solution" data-type="multiple">
<span class="sol" data-forms="integer"><var>L * W</var></span> square
<var>plural_form(UNIT_TEXT)</var>
</div>
<div class="hints">
<div class="graphie" id="area">
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");
</div>
<p>
The area is the length times the width.
</p>
<div>
<div class="graphie" data-update="area">
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]]);
});
});
</div>
<p>
<span data-if="isSingular(L)">
The length is <var>L</var> <var>UNIT_TEXT</var>.
</span><span data-else="">
The length is <var>L</var> <var>plural_form(UNIT_TEXT, L)</var>.
</span>
<span data-if="isSingular(W)">
The width is <var>W</var> <var>UNIT_TEXT</var>.
</span><span data-else="">
The width is <var>W</var> <var>plural_form(UNIT_TEXT, W)</var>.
</span>
<span>Thus the
area is <code><var>L</var>\times<var>W</var></code>
square <var>plural_form(UNIT_TEXT, L * W)</var>.</span>
</p>
</div>
<div>
<p><code>
\qquad\text{<var>AREA</var>} = <var>L</var> \times <var>W</var>
= <var>L * W</var>
</code></p>
<p>
We can also count <var>L * W</var>
square <var>plural_form(UNIT_TEXT, L * W)</var>.
</p>
<div class="graphie" data-update="area">
_(L * W).times(function(n) {
label([n % L + 0.5, W - floor(n / L) - 0.5],
n + 1, "center", false)
.css({ color: GRAY });
});
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>