The answer is a solution to an equation.
Download file: AnswerIsSolutionToEquation.pg
DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl', 'parserSolutionFor.pl', 'PGcourse.pl');
Preamble
Include the macro parserSolutionFor.pl.
Context('Vector')->variables->are(x => 'Real', y => 'Real');
$f = SolutionFor("x^2 = cos(y)", "(1, 0)");
#$f = SolutionFor("x^2 - y = 0", [ 2, 4 ]);
#$f = SolutionFor("x^2 - y = 0", Point(4, 2), vars => [ 'y', 'x' ]);
Setup
The function SolutionFor(equation, point, options) takes
an equation, a point that satisfies that equation, and options such as
vars => ['y', 'x'] in case you want to change the order
that the variables appear in ordered pairs (the default is lexicographic
ordering of the variables).
BEGIN_PGML
A solution to [`[@ $f->{f} @]`] is [`(x, y) =`] [___]{$f}
END_PGML
Statement
This is the problem statement in PGML.BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION ENDDOCUMENT();
Solution
A solution should be provided here.