MATH(DOCS) The Optical Printer Control System MATH(DOCS)
NAME
math - math expressions in OPCS
MATH EXPRESSIONS
You can usually use math expressions in place of most numeric
arguments as long as the expression is ENCLOSED IN PARENTHESES,
and DOES NOT CONTAIN EMBEDDED SPACES. Example:
(3+(3*sqrt(16)*12))
Math can be done on frame counter values:
(cam+3)
For a complete list of all built in math operations, execute:
(?)
The following lists some of the operations supported by the
math expression parser:
/*** TYPICAL OPERATIONS ***/
(3+4-2*12/6) # add, subtract, multiply, divide
(533%256) # modulus
(2^4) # exponentiation (powers)
/*** OPCS VALUES ***/
cam - camera counter value
pro - main projector counter value
pro1 - main projector counter value
pro2 - aerial projector counter value
/*** MATH FUNCTIONS ***/
sqrt(), log(), exp(),
sin(), cos(), tan(),
asin(), acos(), atan(),
atan2(), radians(), degrees()
hex(), pi
/*** NUMERIC EXPRESSIONS ***/
-12 # negative 12
+34 # positive 34
0x3ff # hex representation for 1023 decimal
THE ONLINE CALCULATOR
To aid the operator, the above techniques can be used for printing
the answer to expressions by typing them alone on a line surrounded
by parentheses.
Example:
(3+(3*sqrt(16)*12))
..on a blank line (as if it were a command), the answer will be
printed to the screen:
147.000000
Camera, and both Aerial and Main Projector frame counters can
all be referenced in math expressions by their command names.
For instance, to send the Aerial Projector (pro2) to the same
frame as the Main Projector's (pro) current frame counter plus
5 frames:
pro2 >(pro+5)
..so if the Main Projector's frame counter is 1000, the
Aerial Projector will move to frame 1005.
Or to sync both projectors to camera's current frame counter:
seek >(cam) >(cam) 0
------ ------ ------
Aerial Main Camera
..so if the camera counter is 210, this will send both
aerial and main projectors to frame 210 as well.
BUGS
Needs logicals some day, like 'not()', 'xor()', 'and()', etc.
ORIGIN
Gregory Ercolano, Los Feliz California 12/15/89