Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create contextTrigDegrees.pl #221

Merged
merged 1 commit into from
Jul 3, 2015
Merged

Create contextTrigDegrees.pl #221

merged 1 commit into from
Jul 3, 2015

Conversation

paultpearson
Copy link
Member

A new macro that defines a context TrigDegrees where trig functions are defined in degrees. Using this context, trig functions will be evaluated in Perl mode as well as within MathObjects in degrees. Derivative methods are defined on these trig functions as well. This version of contextTrigDegrees.pl does not have the capability for using these trig functions in vector or matrices. Most of the heavy lifting was done by Davide Cervone (thanks, Davide!).

A new macro that defines a context TrigDegrees where trig functions are defined in degrees.  Using this context, trig functions will be evaluated in Perl mode as well as within MathObjects.  Derivative methods are defined on these trig functions as well.  This version of contextTrigDegrees.pl does not have the capability for using these trig functions in vector or matrices.
@goehle
Copy link
Member

goehle commented Jul 3, 2015

After testing this for a bit it looks good. The functions all behave appropriately and it works very well with math objects. (I was impressed that it even changed the automatic derivative of sin/cos/etc... to be correct.)

One thing for posterity. Through no fault of the authors, if this module is used in parserCustomization this will lead to some broken problems. In particular problems with various components specified "manually" will likely be wrong. For example:

  1. Derivatives of trig functions where the solution has been manually specified (e.g. Utah/Calculus_I/set4_The_Derivative/1210s4p3.pg).
  2. Problems with graphs of trig functions (e.g. ASU-topics/setTrigGraphs/p5.pg). If you add contextTrigDegrees to this problem (manually) then it changes how the graph and the answer behave, but breaks the problem overall.

goehle added a commit that referenced this pull request Jul 3, 2015
Create contextTrigDegrees.pl
@goehle goehle merged commit 1ef7f45 into openwebwork:develop Jul 3, 2015
@dpvc
Copy link
Member

dpvc commented Jul 3, 2015

@geoff, this context was not really intended to be used as a course-wide preference; I think Paul just intended it to be used in specific problems where degrees were desired by the problem author. I suspect that changing to log base 10 in the preferences would have a similar (though not quite so widespread) effect.

@goehle
Copy link
Member

goehle commented Jul 4, 2015

Makes sense. I just wanted to put it out there since was something that
sprang to mind, for me at least. For single problem use it works just
fine.

On Fri, Jul 3, 2015 at 6:50 PM, Davide P. Cervone notifications@github.com
wrote:

@geoff https://github.com/Geoff, this context was not really intended
to be used as a course-wide preference; I think Paul just intended it to be
used in specific problems where degrees were desired by the problem author.
I suspect that changing to log base 10 in the preferences would have a
similar (though not quite so widespread) effect.


Reply to this email directly or view it on GitHub
#221 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants