[system] / trunk / pg / macros / contextLimitedVector.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/contextLimitedVector.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5372 Revision 5373
2 2
3sub _contextLimitedVector_init {}; # don't load it again 3sub _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("LimitedVector-coordinate"); 25 # Context("LimitedVector-coordinate");
26# Context("LimitedVector-ijk"); 26 # Context("LimitedVector-ijk");
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{'LimitedVector-coordinate'} = $context{LimitedVector}->copy; 244$context{'LimitedVector-coordinate'} = $context{LimitedVector}->copy;
245$context{'LimitedVector-coordinate'}->flags->set(vector_format => 'coordinate'); 245$context{'LimitedVector-coordinate'}->flags->set(vector_format => 'coordinate');
246$context{'LimitedVector-coordinate'}->constants->undefine('i','j','k'); 246$context{'LimitedVector-coordinate'}->constants->undefine('i','j','k');
247 247
248Context("LimitedVector"); 248Context("LimitedVector");
249
2501;

Legend:
Removed from v.5372  
changed lines
  Added in v.5373

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9