…  
…  
2  
2  
3  sub _contextLimitedVector_init {}; # don't load it again 
3  sub _contextLimitedVector_init {}; # don't load it again 
4  
4  
5  =head3 Context("LimitedVector") 
5  =head3 Context("LimitedVector") 
6  
6  
7  ########################################################## 
7  ########################################################## 
8  # 
8  # 
9  # Implements a context in which vectors can be entered, 
9  # Implements a context in which vectors can be entered, 
10  # but no vector operations are permitted. So students will 
10  # but no vector operations are permitted. So students will 
11  # be able to perform operations within the coordinates 
11  # be able to perform operations within the coordinates 
12  # of the vectors, but not between vectors. 
12  # of the vectors, but not between vectors. 
13  # 
13  # 
14  # Vectors can still be entered either in < , , > or ijk format. 
14  # Vectors can still be entered either in < , , > or ijk format. 
15  # Most of the complication here is to handle ijk format 
15  # Most of the complication here is to handle ijk format 
16  # properly. Each coordinate vector is allowed to appear 
16  # properly. Each coordinate vector is allowed to appear 
17  # only once, so we have to keep track of that, and allow 
17  # only once, so we have to keep track of that, and allow 
18  # SOME vector operations, but only when one term is 
18  # SOME vector operations, but only when one term is 
19  # one of the coordinate constants, or one of the formulas 
19  # one of the coordinate constants, or one of the formulas 
20  # we've already OKed. 
20  # we've already OKed. 
21  # 
21  # 
22  # You control which format to use by setting the context 
22  # You control which format to use by setting the context 
23  # to one of the following: 
23  # to one of the following: 
24  # 
24  # 
25  # Context("LimitedVectorcoordinate"); 
25  # Context("LimitedVectorcoordinate"); 
26  # Context("LimitedVectorijk"); 
26  # Context("LimitedVectorijk"); 
27  # Context("LimitedVector"); # either one 
27  # Context("LimitedVector"); # either one 
28  # 
28  # 
29  
29  
30  =cut 
30  =cut 
31  
31  
32  # 
32  # 
33  # Handle common checking for BOPs 
33  # Handle common checking for BOPs 
…  
…  
244  $context{'LimitedVectorcoordinate'} = $context{LimitedVector}>copy; 
244  $context{'LimitedVectorcoordinate'} = $context{LimitedVector}>copy; 
245  $context{'LimitedVectorcoordinate'}>flags>set(vector_format => 'coordinate'); 
245  $context{'LimitedVectorcoordinate'}>flags>set(vector_format => 'coordinate'); 
246  $context{'LimitedVectorcoordinate'}>constants>undefine('i','j','k'); 
246  $context{'LimitedVectorcoordinate'}>constants>undefine('i','j','k'); 
247  
247  
248  Context("LimitedVector"); 
248  Context("LimitedVector"); 


249  


250  1; 