Difference between revisions of "ImplicitPlane1"

From WeBWorK_wiki
Jump to navigation Jump to search
(add historical tag and give links to newer problems.)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
{{historical}}
  +
  +
<p style="font-size: 120%;font-weight:bold">This problem has been replaced with [https://openwebwork.github.io/pg-docs/sample-problems/DiffCalcMV/ImplicitPlane.html a newer version of this problem]</p>
  +
 
<h2>Answer is an Equation for a Line or Plane</h2>
 
<h2>Answer is an Equation for a Line or Plane</h2>
   
Line 6: Line 10:
 
</p>
 
</p>
 
* 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 OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalcMV/ImplicitPlane1.pg FortLewis/Authoring/Templates/DiffCalcMV/ImplicitPlane1.pg]
  +
* 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 42: Line 47:
   
 
loadMacros(
 
loadMacros(
"PGstandard.pl",
+
'PGstandard.pl',
"MathObjects.pl",
+
'MathObjects.pl',
"parserImplicitPlane.pl",
+
'parserImplicitPlane.pl',
"parserVectorUtils.pl",
+
'parserVectorUtils.pl',
"AnswerFormatHelp.pl",
+
'PGML.pl',
  +
'PGcourse.pl'
 
);
 
);
   
Line 55: Line 60:
 
<p>
 
<p>
 
<b>Initialization:</b>
 
<b>Initialization:</b>
  +
  +
* The <tt>parserVectorUtils.pl</tt> macro is used for the <tt>non_zero_point3D</tt> function below.
  +
* The <tt>parserImplicitPlane.pl</tt> macro includes the context and the <tt>ImplicitPlane</tt> function to parse and create implicit planes.
 
</p>
 
</p>
 
</td>
 
</td>
Line 65: Line 73:
 
<td style="background-color:#ffffdd;border:black 1px dashed;">
 
<td style="background-color:#ffffdd;border:black 1px dashed;">
 
<pre>
 
<pre>
Context("ImplicitPlane");
+
Context('ImplicitPlane');
  +
Context()->variables->are(x=>'Real',y=>'Real', z=> 'Real');
   
 
$A = non_zero_point3D(-5,5,1);
 
$A = non_zero_point3D(-5,5,1);
Line 71: Line 79:
   
 
$answer1 = ImplicitPlane($A,$N);
 
$answer1 = ImplicitPlane($A,$N);
 
  +
$answer2 = ImplicitPlane('4x+3y=12');
Context()->variables->are(x=>"Real",y=>"Real");
 
  +
$answer3 = ImplicitPlane('x=3');
 
$answer2 = ImplicitPlane("4x+3y=12");
 
 
$answer3 = ImplicitPlane("x=3");
 
 
</pre>
 
</pre>
 
</td>
 
</td>
Line 82: Line 86:
 
<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 95: Line 99:
 
<td style="background-color:#ffdddd;border:black 1px dashed;">
 
<td style="background-color:#ffdddd;border:black 1px dashed;">
 
<pre>
 
<pre>
Context()->texStrings;
 
  +
BEGIN_PGML
BEGIN_TEXT
 
  +
a. Enter an equation for the plane through the point [` [$A] `] and perpendicular to [` [$N] `].
(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;
 
</pre>
 
<td style="background-color:#ffcccc;padding:7px;">
 
<p>
 
<b>Main Text:</b>
 
</p>
 
</td>
 
</tr>
 
   
<!-- Answer evaluation section -->
 
  +
+ [______________]{$answer1}
   
<tr valign="top">
 
  +
b. Enter an equation for the line in the [` xy `]-plane with [` x `]-intercept [` 3 `] and [` y `]-intercept [` 4 `].
<td style="background-color:#eeddff;border:black 1px dashed;">
 
  +
<pre>
 
  +
+ [______________]{$answer2}
$showPartialCorrectAnswers = 1;
 
  +
  +
c. Enter an equation for the vertical line in the [` xy `]-plane through the point [` (3,1) `].
   
ANS( $answer1->cmp() );
 
  +
+ [______________]{$answer3}
ANS( $answer2->cmp() );
 
  +
ANS( $answer3->cmp() );
 
  +
[@ helpLink('equation') @]*
  +
END_PGML
 
</pre>
 
</pre>
<td style="background-color:#eeccff;padding:7px;">
+
<td style="background-color:#ffcccc;padding:7px;">
 
<p>
 
<p>
<b>Answer Evaluation:</b>
+
<b>Main Text:</b>
 
</p>
 
</p>
 
</td>
 
</td>
 
</tr>
 
</tr>
 
<!-- Solution section -->
 
   
 
<tr valign="top">
 
<tr valign="top">
 
<td style="background-color:#ddddff;border:black 1px dashed;">
 
<td style="background-color:#ddddff;border:black 1px dashed;">
 
<pre>
 
<pre>
Context()->texStrings;
 
  +
BEGIN_PGML_SOLUTION
BEGIN_SOLUTION
 
 
Solution explanation goes here.
 
Solution explanation goes here.
END_SOLUTION
 
  +
END_PGML_SOLUTION</pre>
Context()->normalStrings;
 
 
COMMENT('MathObject version.');
 
 
ENDDOCUMENT();
 
</pre>
 
 
<td style="background-color:#ddddff;padding:7px;">
 
<td style="background-color:#ddddff;padding:7px;">
 
<p>
 
<p>

Latest revision as of 06:30, 18 July 2023

This article has been retained as a historical document. It is not up-to-date and the formatting may be lacking. Use the information herein with caution.

This problem has been replaced with a newer version of this problem

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',
  'PGML.pl',
  'PGcourse.pl'
);     

TEXT(beginproblem());

Initialization:

  • The parserVectorUtils.pl macro is used for the non_zero_point3D function below.
  • The parserImplicitPlane.pl macro includes the context and the ImplicitPlane function to parse and create implicit planes.

Context('ImplicitPlane');
Context()->variables->are(x=>'Real',y=>'Real', z=> 'Real');

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

$answer1 = ImplicitPlane($A,$N);
$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.

BEGIN_PGML
a. Enter an equation for the plane through the point [` [$A] `] and perpendicular to [` [$N] `].

    + [______________]{$answer1}

b. Enter an equation for the line in the [` xy `]-plane with [` x `]-intercept [` 3 `] and [` y `]-intercept [` 4 `].

    + [______________]{$answer2}

c. Enter an equation for the vertical line in the [` xy `]-plane through the point [` (3,1) `].

    + [______________]{$answer3}

[@ helpLink('equation') @]*
END_PGML

Main Text:

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

Solution:

Templates by Subject Area