if (int_count_times_randomized <= 1){ //>
return 10;
} else {
return random_min_max_precision(10, 15, 0); //defined in setup_exercise_all.js
}
if (int_count_times_randomized <= 1){ //>
return 30;
} else {
return random_min_max_precision(20, 70, 0); //defined in setup_exercise_all.js
}
if (int_count_times_randomized == 0){
return true;
} else if (int_count_times_randomized == 1){
return false;
} else {
return (Math.random()>0.5); //Half the time ~boolean_adjacent~ is true, the other is false.
}
if (int_count_times_randomized <= 1){ //>
return 0;
} else {
return Math.random()*2*Math.PI;
}
Hint: Does the red side touch the angle?
Yes $\rightarrow$ adjacent side $\rightarrow$ use $\cos\theta$.
No $\rightarrow$ opposite side $\rightarrow$ use $\sin\theta$.
Solution
Since the red side [[return (~boolean_adjacent~)?"touches" : "does not touch"]] the angle, it is the [[return (~boolean_adjacent~)?"adjacent" : "opposite"]] side.
Recall the rules: adjacent $\rightarrow$ $\cos$, opposite $\rightarrow$ $\sin$.
$l = h [[return (~boolean_adjacent~)? String.raw`\cos`: String.raw`\sin`]] (\theta) = [[return ~r~]] [[return (~boolean_adjacent~)? String.raw`\cos`: String.raw`\sin`]] ([[return ~theta~]]^\circ ) = [[return (~boolean_adjacent~)? (~r~ * Math.cos(~theta~ * Math.PI/180)).toFixed(2) : (~r~ * Math.sin(~theta~ * Math.PI/180)).toFixed(2) ]]$.
If you do not get the right answer even if you typed in all the numbers correctly, your calculator may be set to the wrong mode. Your calculator must be in DEGREES mode instead of RADIANS mode, corresponding to the two common units for angles.
Is the red side adjacent or opposite to the highlighted angle?
Type "a" for adjacent or "o" for opposite:
return (~boolean_adjacent~)? "a" : "o"
not_number
$l =$
if (~boolean_adjacent~){
return (~r~ * Math.cos(~theta~ * Math.PI/180)).toFixed(2);
} else {
return (~r~ * Math.sin(~theta~ * Math.PI/180)).toFixed(2);
}
0.2