Degrees in Trigonometric Functions

Trigonometry: trig functions in degrees using context TrigDegrees

Complete Code

Download file: TrigDegrees.pg

PG problem file

Explanation

DOCUMENT();

loadMacros(
    'PGstandard.pl',         'PGML.pl',
    'contextTrigDegrees.pl', 'contextUnits.pl',
    'PGcourse.pl'
);

Preamble

Load the contextTrigDegrees.pl macro for the TrigDegrees context. Also load the contextUnits.pl which will require that the answer has units of degrees.

Context('TrigDegrees');

$y = Compute('sin(30)');

Context('Units')->withUnitsFor('angles');

$ang = Compute('30 degrees');

Setup

Select the TrigDegrees context to which evaluates trig functions in degrees. This applies to any formulas or student answers in this context.

The second answer is constructed with the NumberWithUnits method and the degree symbol is specified as the unit. Degree measures should always be given with the degree symbol.

BEGIN_PGML
Evaluate the following.  Give angles in degrees.

1. [`\sin(30^{\circ}) =`] [_]{$y}
2. [``\sin^{-1}\left(\frac{1}{2}\right) =``] [_]{$ang->with(sameUnits => 1)}
END_PGML

Statement

Inform the students to give angle measurements in degrees.

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution

A solution should be provided here.