Skip to content
This repository
Newer
Older
100644 218 lines (193 sloc) 9.652 kb
eb168d32 » igorT
2011-07-20 Add exercise -- trigonometry 1
1 <!DOCTYPE html>
a5025b82 » mwahl
2012-02-19 Accept improper fractions, fix trig function display issue, tag all t…
2 <!-- TODO: Improve hints -->
eb168d32 » igorT
2011-07-20 Add exercise -- trigonometry 1
3 <html data-require="math graphie math-format">
4 <head>
4e4cb9b1 » beneater
2012-04-10 lint: tabs->spaces and jQuery->$ for exercises
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 <title>Trigonometry 1</title>
7 <script src="../khan-exercise.js"></script>
8 <script>
9 function fractionSQRoot(b, root){
10 var natRoot = KhanUtil.splitRadical( root )[0];
11 var underRoot = KhanUtil.splitRadical( root )[1];
12 var d = KhanUtil.reduce( natRoot * underRoot, b )[0];
13 var n = KhanUtil.reduce( natRoot * underRoot, b )[1];
14 if ( d === 1 ){
15 if ( n !== 1 ) {
16 return n + "\\sqrt{" + underRoot +"}";
17 }
18 else{
19 return "\\sqrt{" + underRoot + "}";
20 }
21
22 }
23 else if ( underRoot !== 1 ) {
24 if ( n !== 1 ) {
25 return "\\dfrac{" + n + "\\sqrt{" + underRoot +"} }{"+ d + "}";
26 }
27 else {
28 return "\\dfrac{ \\sqrt{" + underRoot + "}}{" + d + "}";
29 }
30 }
31 else {
32 return "\\dfrac{" + n + "}{" + d + "}";
33 }
34 }
35
36 function betterTriangle(width, height, A, B, C, a, b, c) {
37 var scale = 5 / Math.sqrt(width * width + height * height);
38 width *= scale;
39 height *= scale;
40
41 with ( KhanUtil.currentGraph ) {
42 // Leave some space for the labels
43 init({ range: [[-1.5, width + 1], [-1, height + 1]] });
44
45 path([ [0, 0], [width, 0], [0, height], true ]);
46
47 label( [0, height], A, "above left" );
48 label( [0, 0], C, "below left" );
49 label( [width, 0], B, "below right" );
50
51 label( [0, height/2], b, "left" );
52 label( [width/2, 0], a, "below" );
53 label( [width/2, height/2], c, "above right", {
54 labelDistance: 3
55 } );
56 }
57 }
58 </script>
eb168d32 » igorT
2011-07-20 Add exercise -- trigonometry 1
59 </head>
60 <body>
4e4cb9b1 » beneater
2012-04-10 lint: tabs->spaces and jQuery->$ for exercises
61 <div class="exercise">
62 <div class="vars">
63 <var id="AC">randRange(3, 10)</var>
64 <var id="BC">randRange(3, 10)</var>
65 <var id="CB">BC</var>
66 <var id="AB">AC * AC + BC * BC</var>
67 <var id="AB_STRING">formattedSquareRootOf(AC * AC + BC * BC)</var>
68 <var id="ANGLE">randFromArray([
69 "ABC",
70 "BAC"
71 ])</var>
72 <var id="OPPOSITE_NAME">(ANGLE.substring(0,1) + ANGLE.substring(2))</var>
73 <var id="OPPOSITE_VALUE">
74 (function(){
75 if ( OPPOSITE_NAME === "AC" ){
76 return AC;
77 }
78 else if ( OPPOSITE_NAME === "BC" ){
79 return CB;
80 }
81 return AB_STRING;
82 })()
83 </var>
84
85 <var id="HYPOTENUSE_NAME">"AB"</var>
86 <var id="HYPOTENUSE_VALUE">AB_STRING</var>
87
88 <var id="ADJACENT_NAME">ANGLE.substring(1)</var>
89 <var id="ADJACENT_VALUE">
90 (function(){
91 if ( ADJACENT_NAME === "AC" ){
92 return AC;
93 }
94 else if ( ADJACENT_NAME === "BC" ){
95 return BC;
96 }
97
98 return AB_STRING;
99 })()
100 </var>
101 <var id="SIMPLE_TAN">
102 fraction( OPPOSITE_VALUE, ADJACENT_VALUE, false, false, false, false)
103 </var>
104 <var id="TAN">
105 fractionReduce( OPPOSITE_VALUE, ADJACENT_VALUE, false, false)
106 </var>
107 <var id="SIMPLE_SIN">
108 "\\frac{" + OPPOSITE_VALUE + "}{" + formattedSquareRootOf(AB) + "}"
109 </var>
110 <var id="SIN">
111 fractionSQRoot( OPPOSITE_VALUE , AB )
112 </var>
113 <var id="SIMPLE_COS">
114 "\\frac{" + ADJACENT_VALUE + "}{" + formattedSquareRootOf(AB) + "}"
115 </var>
116 <var id="COS">
117 fractionSQRoot( ADJACENT_VALUE , AB )
118 </var>
119
120
121 </div>
122
123 <div class="problems">
124 <div id="sinTrig1">
125 <div class="problem">
126 <p><code>\overline{AC}</code> is <code><var>AC</var></code> units long</p>
127 <p><code>\overline{BC}</code> is <code><var>BC</var></code> units long</p>
128 <p><code>\overline{AB}</code> is <code><var>AB_STRING</var></code> units long</p>
129 </div>
130 <div class="question">
131 <p>What is <code>\sin(\angle <var>ANGLE</var>)</code> ?</p>
132
133 <div class="graphie">
134 betterTriangle( BC, AC, "A", "B", "C", BC, AC, AB_STRING );
135 path([ [ 0.4, 0 ], [ 0.4, 0.4 ], [ 0, 0.4 ] ]);
136 </div>
137 </div>
138
139 <div class="solution"><code><var>SIN</var></code></div>
140 <ul class="choices" data-show="4" data-none="true">
141 <li data-if="COS !== SIN"><code><var>COS</var></code></li>
142 <li><code><var>SIN</var></code></li>
143 <li><code><var>TAN</var></code></li>
144 <li><code>\dfrac{1}{<var>AB</var>}</code></li>
145 <li><code>\dfrac{1}{<var>BC</var>}</code></li>
146 <li><code>\dfrac{1}{<var>AC</var>}</code></li>
147 <li><code>\dfrac{2 \sqrt{2}}{<var>AC</var>}</code></li>
148 </ul>
149
150 <div class="hints">
151 <p><b>SOH</b> CAH TOA</p>
152 <p><b>S</b>in = <b>O</b>pposite over <b>H</b>ypotenuse</p>
153 <p>opposite <code>= \overline{<var>OPPOSITE_NAME</var>} = <var>OPPOSITE_VALUE</var></code></p>
154 <p>hypotenuse <code>= \overline{<var>HYPOTENUSE_NAME</var>} = <var>AB_STRING</var></code></p>
155 <p><code>\sin(\angle <var>ANGLE</var>)=<var>SIMPLE_SIN</var></code></p>
156 <p data-if="SIN !== SIMPLE_SIN"><code>=<var>SIN</var></code></p>
157 </div>
158 </div>
159
160 <div id="cosTrig1" data-type="sinTrig1">
161 <div class="problem">
162 <p><code>\overline{AC}</code> is <code><var>AC</var></code> units long</p>
163 <p><code>\overline{BC}</code> is <code><var>BC</var></code> units long</p>
164 <p><code>\overline{AB}</code> is <code><var>AB_STRING</var></code> units long</p>
165 </div>
166 <div class="question">
167 <p>What is <code>\cos(\angle <var>ANGLE</var>)</code> ?</p>
168
169 <div class="graphie">
170 betterTriangle( BC, AC, "A", "B", "C", BC, AC, AB_STRING );
171 path([ [ 0.4, 0 ], [ 0.4, 0.4 ], [ 0, 0.4 ] ]);
172 </div>
173 </div>
174
175 <div class="solution"><code><var>COS</var></code></div>
176
177 <div class="hints">
178 <p>SOH <b>CAH</b> TOA</p>
179 <p><b>C</b>os = <b>A</b>djacent over <b>H</b>ypotenuse</p>
180 <p>adjacent <code>= \overline{<var>ADJACENT_NAME</var>} = <var>ADJACENT_VALUE</var></code></p>
181 <p>hypotenuse <code>= \overline{<var>HYPOTENUSE_NAME</var>} = <var>AB_STRING</var></code></p>
182 <p><code>\cos(\angle <var>ANGLE</var> )=<var>SIMPLE_COS</var></code></p>
183 <p data-if="COS !== SIMPLE_COS"><code>=<var>COS</var></code></p>
184 </div>
185 </div>
186
187 <div id="tanTrig1" data-type="sinTrig1">
188 <div class="problem">
189 <p><code>\overline{AC}</code> is <code><var>AC</var></code> units long</p>
190 <p><code>\overline{BC}</code> is <code><var>BC</var></code> units long</p>
191 <p><code>\overline{AB}</code> is <code><var>AB_STRING</var></code> units long</p>
192 </div>
193 <div class="question">
194 <p>What is <code>\tan(\angle <var>ANGLE</var>)</code> ?</p>
195
196 <div class="graphie">
197 betterTriangle( BC, AC, "A", "B", "C", BC, AC, AB_STRING );
198 path([ [ 0.4, 0 ], [ 0.4, 0.4 ], [ 0, 0.4 ] ]);
199 </div>
200 </div>
201
202 <div class="solution"><code><var>TAN</var></code></div>
203
204 <div class="hints">
205 <p>SOH CAH <b>TOA</b></p>
206 <p><b>T</b>an = <b>O</b>pposite over <b>A</b>djacent</p>
207 <p>opposite <code>= \overline{<var>OPPOSITE_NAME</var>} = <var>OPPOSITE_VALUE</var></code></p>
208 <p>adjacent <code>= \overline{<var>ADJACENT_NAME</var>} = <var>ADJACENT_VALUE</var></code></p>
209 <p><code>\tan(\angle <var>ANGLE</var>)=<var>SIMPLE_TAN</var></code></p>
210 <p data-if="TAN !== SIMPLE_TAN"><code>=<var>TAN</var></code></p>
211 </div>
212 </div>
213
214 </div>
215
216 </div>
217 </body>
218 </html>
Something went wrong with that request. Please try again.