########################################################### # # Example showing how to use the Parser's function # answer checker. # DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "Parser.pl", "parserUtils.pl", ); TEXT(beginproblem()); ########################################################### # # The setup # $context = Context('Vector'); $context->variables->are(t=>'Real'); $context->constants->add( p0 => Point(pi,sqrt(2),3/exp(1)), v => Vector(exp(1),log(10),-(pi**2)), ); $context->constants->set(v => {TeX => '\boldsymbol{v}'}); # make it print nicer $L = Formula("p0+tv"); $v = Formula('v'); ########################################################### # # The problem text # Context()->texStrings; BEGIN_TEXT Suppose \(p_0\) is a point and \($v\) a vector in \(n\)-space. $PAR Then the vector-parametric form for the line through \(p_0\) in the direction of \(v\) is$PAR ${BBLOCKQUOTE} \(L(t)\) = \{ans_rule(30)\}. ${EBLOCKQUOTE} END_TEXT Context()->normalStrings; ########################################################### # # The answers # ANS($L->cmp); ########################################################### ENDDOCUMENT(); # This should be the last executable line in the problem.