

1  =head1 NAME 


2  


3  contextLimitedVector.pl  Allow vector entry but now vector operations. 


4  


5  =head1 DESCRIPTION 


6  


7  Implements a context in which vectors can be entered, 


8  but no vector operations are permitted. So students will 


9  be able to perform operations within the coordinates 


10  of the vectors, but not between vectors. 


11  


12  Vectors can still be entered either in < , , > or ijk format. 


13  Most of the complication here is to handle ijk format 


14  properly. Each coordinate vector is allowed to appear 


15  only once, so we have to keep track of that, and allow 


16  SOME vector operations, but only when one term is 


17  one of the coordinate constants, or one of the formulas 


18  we've already OKed. 


19  


20  You control which format to use by setting the context 


21  to one of the following: 


22  


23  Context("LimitedVectorcoordinate"); 


24  Context("LimitedVectorijk"); 


25  Context("LimitedVector"); # either one 


26  


27  =cut 


28  
1  loadMacros("MathObjects.pl"); 
29  loadMacros("MathObjects.pl"); 
2  
30  
3  sub _contextLimitedVector_init {LimitedVector::Init()}; # don't load it again 
31  sub _contextLimitedVector_init {LimitedVector::Init()}; # don't load it again 
4  


5  =head3 Context("LimitedVector") 


6  


7  ########################################################## 


8  # 


9  # Implements a context in which vectors can be entered, 


10  # but no vector operations are permitted. So students will 


11  # be able to perform operations within the coordinates 


12  # of the vectors, but not between vectors. 


13  # 


14  # Vectors can still be entered either in < , , > or ijk format. 


15  # Most of the complication here is to handle ijk format 


16  # properly. Each coordinate vector is allowed to appear 


17  # only once, so we have to keep track of that, and allow 


18  # SOME vector operations, but only when one term is 


19  # one of the coordinate constants, or one of the formulas 


20  # we've already OKed. 


21  # 


22  # You control which format to use by setting the context 


23  # to one of the following: 


24  # 


25  # Context("LimitedVectorcoordinate"); 


26  # Context("LimitedVectorijk"); 


27  # Context("LimitedVector"); # either one 


28  # 


29  


30  =cut 


31  
32  
32  ################################################## 
33  ################################################## 
33  # 
34  # 
34  # Handle common checking for BOPs 
35  # Handle common checking for BOPs 
35  # 
36  # 