Difference between revisions of "VectorParametricLines1"
(Created page with '<h2>Vector Parametric Lines</h2> 300px|thumb|right|Click to enlarge <p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;"> …') |
Paultpearson (talk | contribs) m |
||
Line 164: | Line 164: | ||
[[Category:Top]] |
[[Category:Top]] |
||
− | [[Category: |
+ | [[Category:Sample Problems]] |
+ | [[Category:Subject Area Templates]] |
Revision as of 15:52, 3 January 2012
Vector Parametric Lines
This PG code shows how to require students to enter a parametrized line that must go through certain points when t=0 and t=1, or allow them to enter an equation for any parametric line through two points.
- Download file: File:VectorParametricLines1.txt (change the file extension from txt to pg when you save it)
- File location in NPL:
FortLewis/Authoring/Templates/Parametric/VectorParametricLines1.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "parserVectorUtils.pl", "parserParametricLine.pl", ); TEXT(beginproblem()); |
Initialization:
We load |
Context("Vector")->variables->are(t=>"Real"); $P = non_zero_point3D(-9,9,1); $V = non_zero_vector3D(-9,9,1); $Q = Point($P + $V); $particular = Line($P,$V,'t'); $general = ParametricLine($P,$V); |
Setup:
For the answer which is a particular parametrization through two points at times t=0 and t=1, we use |
Context()->texStrings; BEGIN_TEXT (a) Find a vector parametric equation for the line that goes through the point \( $P \) when \( t = 0 \) and the point \( $Q \) when \( t = 1 \). $BR \( \vec{L}(t) = \) \{ ans_rule(30) \} $BR $BR (b) Find any vector parametric equation for the line that goes through the points \( $P \) and \( $Q \). $BR \( \vec{L}(t) = \) \{ ans_rule(30) \} END_TEXT Context()->normalStrings; |
Main Text: |
$showPartialCorrectAnswers = 1; ANS( $particular->cmp() ); ANS( $general->cmp() ); |
Answer Evaluation: |
Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT(); |
Solution: |