I am writing a question where I want to display the valuesand as fractions, so students are able to identify the representative angle that they are coming from.
I am using the Fractions Context, but I do not succeed after evaluating the functions. A sample code can be found below. As you notice, I tried several formats but I get displayed either "0.5" or "" for example. Is there a way to achieve this without using arrays to have the fractions stored? I want to avoid this approach as I would like to randomize the angle to either or .
Thanks in advance!
$showPartialCorrectAnswers = 1;
$theta = list_random(Formula("0"),Formula("pi/6"), Formula("pi/4"), Formula("pi/3"), Formula("pi/2"));
$a11 = Compute(cos($theta));
$a12 = -sin($theta);
$a21 = Formula(sin($theta));
$a22 = Formula(cos($theta));
The following matrix is the rotation matrix with angle [`\theta = [$theta] `].
[$a11] & [$a12] \\
[$a21] & [$a22]