Difference between revisions of "ScalingTranslating1"
Paultpearson (talk | contribs) m |
(add historical tag and give links to newer problems.) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | {{historical}} |
||
+ | |||
+ | <p style="font-size: 120%;font-weight:bold">This problem has been replaced with [https://openwebwork.github.io/pg-docs/sample-problems/Algebra/ScalingTranslating.html a newer version of this problem]</p> |
||
+ | |||
+ | |||
<h2>Scaling and Translating Functions</h2> |
<h2>Scaling and Translating Functions</h2> |
||
Line 5: | Line 10: | ||
This PG code shows how to add a named function to the context and use it to asses whether students know their graph transformations. |
This PG code shows how to add a named function to the context and use it to asses whether students know their graph transformations. |
||
</p> |
</p> |
||
− | * Download file: [[File:ScalingTranslating1.txt]] (change the file extension from txt to pg when you save it) |
||
+ | * File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Precalc/ScalingTranslating1.pg FortLewis/Authoring/Templates/Precalc/ScalingTranslating1.pg] |
||
− | * File location in NPL: <code>FortLewis/Authoring/Templates/Precalc/ScalingTranslating1.pg</code> |
||
+ | * PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Precalc/ScalingTranslating1_PGML.pg FortLewis/Authoring/Templates/Precalc/ScalingTranslating1_PGML.pg] |
||
<br clear="all" /> |
<br clear="all" /> |
Latest revision as of 05:05, 18 July 2023
This problem has been replaced with a newer version of this problem
Scaling and Translating Functions
This PG code shows how to add a named function to the context and use it to asses whether students know their graph transformations.
- File location in OPL: FortLewis/Authoring/Templates/Precalc/ScalingTranslating1.pg
- PGML location in OPL: FortLewis/Authoring/Templates/Precalc/ScalingTranslating1_PGML.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "AnswerFormatHelp.pl", "parserFunction.pl", ); TEXT(beginproblem()); |
Initialization:
We must load |
Context("Numeric"); parserFunction(f => "sin(e*x)+5.5*pi"); $answer = Formula("f(x-2) + 1"); |
Setup:
The |
Context()->texStrings; BEGIN_TEXT A function \( f(x) \) is shifted to the right \( 2 \) units and up \( 1 \) unit. Find a formula for this shifted function in terms of the function \( f(x) \). $BR $BR Answer = \{ ans_rule(20) \} \{ AnswerFormatHelp("formulas") \} END_TEXT Context()->normalStrings; |
Main Text: |
$showPartialCorrectAnswers = 1; ANS( $answer->cmp() ); |
Answer Evaluation: |
Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT(); |
Solution: |