Features & Development

request trigDegrees context

request trigDegrees context

by Dick Lane -
Number of replies: 3
For some parts of a Trigonometry class, it would be very convenient to state problems in terms of degrees rather than radians.

At the moment, this can be done only by using the clever kludge presented in
        http://webwork.maa.org/wiki/TrigFunctionsDegrees1
A new trigDegrees context would be a very useful alternative.

This might be considered analogous to the already-granted request for "mixed numbers" in Fraction context to use with middle-school classes.

FWiW: I promise to not return with a subsequent request for angles measured in grads or mils.  ;-)
In reply to Dick Lane

Re: request trigDegrees context

by Dick Lane -
Is there a safe way to put the 190 lines of degree-based function stuff into a separate file (to go in the macros folder for a course) and then include/load it into a problem with a single line command?
In reply to Dick Lane

Re: request trigDegrees context

by Dick Lane -
Attached problem has two parts requiring exact expression that are checked in a context where radian-vs-degree distinction is irrelevant and one part where DEGREE is enforced.  I will welcome suggestion about ways to improve this.


In the meantime (i.e., prior to having a genuine trigDegree context), I would like to note two minor discordant things.

a)  If a decimal value is entered for 1st or 3rd item, the message says "You are not allowed to type decimal numbers in this problem".  Since my code plays games with context for each item (i.e. preventing a decimal answer in two cases but allowing it in two others), I would prefer that message to be something of the form "A decimal answer is not acceptable for this item" because the prohibition is not global.

b)  Although any reasonable use of arctan, arcsin, arccos will be scored as correct for the exact angle-size item, the "Entered" display shows the radian value rather than the degree value.  FWiW: I added the subsequent "good decimal approximation" item for smallest angle to distract attention from that minor discordance.  (Asking that for the hypotenuse length was done to have a parallel structure in the problem statement.)


I will welcome suggestions, clever or kludgie, to work-around the current lack of a trigDegree context.
In reply to Dick Lane

Re: request trigDegrees context

by Michele Titcombe -

See WeBWorK wiki page (updated July 2021) : https://webwork.maa.org/wiki/TrigFunctionsDegrees1

Sample PG code shows how to use the context TrigDegrees to redefine trigonometric functions so they evaluate in degrees rather than radians.