Difference between revisions of "ScalingTranslating1"
Jump to navigation
Jump to search
(Created page with '<h2>Scaling and Translating Functions</h2> 300px|thumb|right|Click to enlarge <p style="background-color:#f9f9f9;border:black solid 1px;padding:…') |
Paultpearson (talk | contribs) m |
||
Line 151: | Line 151: | ||
[[Category:Top]] |
[[Category:Top]] |
||
− | [[Category: |
+ | [[Category:Sample Problems]] |
+ | [[Category:Subject Area Templates]] |
Revision as of 15:36, 3 January 2012
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.
- Download file: File:ScalingTranslating1.txt (change the file extension from txt to pg when you save it)
- File location in NPL:
FortLewis/Authoring/Templates/Precalc/ScalingTranslating1.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: |