## DESCRIPTION ## Parametric equations: parametric curve in space ## ENDDESCRIPTION ## KEYWORDS('parametric', 'curve in space') ## DBsubject('WeBWorK') ## DBchapter('WeBWorK Tutorial') ## DBsection('Fort Lewis Tutorial 2011') ## Date('01/30/2011') ## Author('Paul Pearson') ## Institution('Fort Lewis College') ## TitleText1('') ## EditionText1('') ## AuthorText1('') ## Section1('') ## Problem1('') ################################# # Initialization DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "parserVectorUtils.pl", "parserMultiAnswer.pl", ); TEXT(beginproblem()); ################################# # Setup Context("Vector2D"); #Context("Vector"); # for 3D vectors Context()->variables->are(t=>"Real"); Context()->variables->set(t=>{limits=>[0,5]}); Context()->flags->set( ijk=>0 ); $a = random(2,5,1); $Q = Point($a,$a**2); $multians = MultiAnswer(Vector(""),0,$a)->with( singleResult => 1, checker => sub { my ($correct,$student,$self) = @_; # get the parameters my ($f,$x1,$x2) = @{$student}; # extract student answers if ( ( ($f . i)**2 == ($f . j) ) && ($f->eval(t=>$x1) == Vector("<0,0>")) && ($f->eval(t=>$x2) == Vector("<$a,$a**2>")) ) { return 1; } elsif ( ( ($f . i)**2 == ($f . j) ) && ($f->eval(t=>$x1) == Vector("<0,0>")) ) { $self->setMessage(3,"Your right endpoint is not correct."); return 0; } elsif ( ( ($f . i)**2 == ($f . j) ) && ($f->eval(t=>$x2) == Vector("<$a,$a**2>")) ) { $self->setMessage(2,"Your left endpoint is not correct."); return 0; } elsif ( ( ($f . i)**2 == ($f . j) ) ) { $self->setMessage(2,"Your left endpoint is not correct."); $self->setMessage(3,"Your right endpoint is not correct."); return 0; } else { return 0; } } ); ##################################### # Main text Context()->texStrings; BEGIN_TEXT Find a vector parametric equation for the parabola \( y = x^2 \) from the origin to the point \( $Q \) using \( t \) as a parameter. $BR $BR \( \vec{r}(t) = \) \{$multians->ans_rule(20)\} for \{$multians->ans_rule(5)\} \( \leq t \leq \) \{$multians->ans_rule(5)\} END_TEXT Context()->normalStrings; ############################ # Answer evaluation $showPartialCorrectAnswers = 1; ANS( $multians->cmp() ); ############################ # Solution Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT();