Difference between revisions of "ImplicitPlane1"

From WeBWorK_wiki
Jump to navigation Jump to search
(Created page with '<h2>Answer is an Equation for a Line or Plane</h2> 300px|thumb|right|Click to enlarge <p style="background-color:#f9f9f9;border:black solid 1px;paddi…')
 
(3 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
This PG code shows how to define an answer that is a line or plane.
 
This PG code shows how to define an answer that is a line or plane.
 
</p>
 
</p>
* Download file: [[File:ImplicitPlane1.txt]] (change the file extension from txt to pg when you save it)
 
  +
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalcMV/ImplicitPlane1.pg FortLewis/Authoring/Templates/DiffCalcMV/ImplicitPlane1.pg]
* File location in NPL: <code>FortLewis/Authoring/Templates/DiffCalcMV/ImplicitPlane1.pg</code>
+
* PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalcMV/ImplicitPlane1_PGML.pg FortLewis/Authoring/Templates/DiffCalcMV/ImplicitPlane1_PGML.pg]
   
 
<br clear="all" />
 
<br clear="all" />
Line 83: Line 83:
 
<p>
 
<p>
 
<b>Setup:</b>
 
<b>Setup:</b>
The first answer is a standard mulitivariable calculus question. There are several different ways to specify the input to <code>ImplicitPlane</code>, which are detailed in the [http://webwork.maa.org/pod/pg_TRUNK/macros/parserImplicitPlane.pl.html POD documentation]. It is also possible to do some more complicated manipulations with the vectors and points, which is detailed in the [http://webwork.maa.org/wiki/ImplicitPlane problem techniques section].
+
The first answer is a standard mulitivariable calculus question. There are several different ways to specify the input to <code>ImplicitPlane</code>, which are detailed in the [http://webwork.maa.org/pod/pg/macros/parserImplicitPlane.html POD documentation]. It is also possible to do some more complicated manipulations with the vectors and points, which is detailed in the [http://webwork.maa.org/wiki/ImplicitPlane problem techniques section].
 
</p>
 
</p>
 
<p>
 
<p>
Line 154: Line 154:
 
Context()->texStrings;
 
Context()->texStrings;
 
BEGIN_SOLUTION
 
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
 
 
Solution explanation goes here.
 
Solution explanation goes here.
 
END_SOLUTION
 
END_SOLUTION
Line 177: Line 176:
   
 
[[Category:Top]]
 
[[Category:Top]]
[[Category:Authors]]
+
[[Category:Sample Problems]]
  +
[[Category:Subject Area Templates]]

Revision as of 18:04, 7 April 2021

Answer is an Equation for a Line or Plane

Click to enlarge

This PG code shows how to define an answer that is a line or plane.


Templates by Subject Area

PG problem file Explanation

Problem tagging data

Problem tagging:

DOCUMENT();   

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"parserImplicitPlane.pl",
"parserVectorUtils.pl",
"AnswerFormatHelp.pl",
);     

TEXT(beginproblem());

Initialization:

Context("ImplicitPlane");

$A = non_zero_point3D(-5,5,1);
$N = non_zero_vector3D(-5,5,1);

$answer1 = ImplicitPlane($A,$N);

Context()->variables->are(x=>"Real",y=>"Real");

$answer2 = ImplicitPlane("4x+3y=12");

$answer3 = ImplicitPlane("x=3");

Setup: The first answer is a standard mulitivariable calculus question. There are several different ways to specify the input to ImplicitPlane, which are detailed in the POD documentation. It is also possible to do some more complicated manipulations with the vectors and points, which is detailed in the problem techniques section.

When the ImplicitPlane context has only two variables, it rephrases error messages in terms of lines. If you want students to be able to enter an equation for a line in the most general form, or if you have a vertical line to check (or just a constant equation such as x=3), you can use the ImplicitPlane context to reliably check these answers.

Context()->texStrings;
BEGIN_TEXT
(a) Enter an equation for the plane through
the point \( $A \) and perpendicular to
\( $N \).
$BR 
\{ ans_rule(20) \}
\{ AnswerFormatHelp("equations") \}
$BR
$BR
(b) Enter an equation for the line in the
xy-plane with x-intercept \( 3 \) and 
y-intercept \( 4 \).
$BR
\{ ans_rule(20) \}
\{ AnswerFormatHelp("equations") \}
$BR
$BR
(c) Enter an equation for the vertical line 
in the xy-plane through the point \( (3,1) \).
$BR
\{ ans_rule(20) \}
\{ AnswerFormatHelp("equations") \}
END_TEXT
Context()->normalStrings;

Main Text:

$showPartialCorrectAnswers = 1;

ANS( $answer1->cmp() );
ANS( $answer2->cmp() );
ANS( $answer3->cmp() );

Answer Evaluation:

Context()->texStrings;
BEGIN_SOLUTION
Solution explanation goes here.
END_SOLUTION
Context()->normalStrings;

COMMENT('MathObject version.');

ENDDOCUMENT();

Solution:

Templates by Subject Area