I am looking at this problem:
Library/Union/setMVlinesplanes/an12_6_15.pg
It generates implicit equations for a few planes, using ImplicitPlane($P,$N) to construct them.
For some reason, the planes are typeset like this:
8y−2x+6z=36
9x+12y−13z=−15
2y−2x+3z=−5
27z−(17x+4y)=19.
Note how:
* the variables appear in some random order,
* sometimes the variables are parenthesized in a weird way, for example 27z−(17x+4y)=19.
I find this behavior undesirable because it makes the question seem like a "trick question": most of the time we write variables in alphabetical or some other predetermined order, and writing them in random order is a gratuitous complication (unless the very point of the question is to standardize a formula, which in this case it is not).
My question: how can I turn this behavior off, so that the implicit planes are typeset in standard format, i.e.
-2x+8y+6z=36
9x+12y-13x=-15
-2x+2y+3z=5
-17x-4y+27z=19.
The strange thing is that I see nothing in the problem definition that randomizes the variables. All planes are uniformly generated. I tried altering the setting
Context()->reduction->set('(-x)-y'=>0);
but it doesn't make a difference. The documentation of ImplicitPlane here
http://webwork.maa.org/wiki/ImplicitPlane
does not mention that the order of variables will be randomized. The documentation here
http://webwork.maa.org/pod/pg_TRUNK/macros/parserImplicitPlane.pl.html
says that we can specify the order, for example ImplicitPlane($P,$N, ['x','y','z']). However, when I tried this, the output didn't change at all; it was the same as before.
Is there some setting that I am missing? Thanks, -- Peter
Upon further investigation, I answered my own question as follows: in the problem in question, we have
Context("Vector")->variables->are(t=>'Real');
Context()->reduction->set('(-x)-y'=>0);
and the further down in the same problem:
Context("ImplicitPlane");
So any updates done to the "Vector" context (including the reduction->set in the original problem text) apparently have no effect for the later typesetting of the implicit planes. However, if I put
Context()->noreduce("(-x)-y","(-x)+y");
*after* the Context("ImplicitPlane"), then the undesirable formatting can indeed be turned off. The reason my earlier efforts had no effect is that I put the "noreduce" command after Context("Vector") near the top of the problem.
For this problem, I suggest adding
Context("ImplicitPlane");
Context()->noreduce("(-x)-y","(-x)+y");
Thanks, -- Peter
Context("Vector")->variables->are(t=>'Real');
Context()->reduction->set('(-x)-y'=>0);
and the further down in the same problem:
Context("ImplicitPlane");
So any updates done to the "Vector" context (including the reduction->set in the original problem text) apparently have no effect for the later typesetting of the implicit planes. However, if I put
Context()->noreduce("(-x)-y","(-x)+y");
*after* the Context("ImplicitPlane"), then the undesirable formatting can indeed be turned off. The reason my earlier efforts had no effect is that I put the "noreduce" command after Context("Vector") near the top of the problem.
For this problem, I suggest adding
Context("ImplicitPlane");
Context()->noreduce("(-x)-y","(-x)+y");
Thanks, -- Peter