--- ray/doc/man/man1/rcalc.1 2003/04/27 06:08:03 1.2 +++ ray/doc/man/man1/rcalc.1 2007/09/04 17:36:41 1.8 @@ -1,4 +1,4 @@ -.\" RCSid "$Id" +.\" RCSid "$Id: rcalc.1,v 1.8 2007/09/04 17:36:41 greg Exp $" .TH RCALC 1 4/6/99 RADIANCE .SH NAME rcalc - record calculator @@ -9,6 +9,8 @@ rcalc - record calculator ][ .B \-l ][ +.B \-p +][ .B \-n ][ .B \-w @@ -54,6 +56,11 @@ A special form of the option may be followed immediately by a 'd' or an 'f' and an optional count, which defaults to 1, indicating the number of double or float binary values to read per record on the input file. +If the input is byte-swapped, the +.I \-iD +or +.I \-iF +options may be substituted. If binary input is specified, no format string or file is needed. .PP A @@ -66,7 +73,25 @@ or .I \-of options do not require a count, as this will be determined by the number of output channels in the given expressions. +If byte-swapped output is desired, the +.I \-oD +or +.I \-oF +options may be substituted. .PP +The +.I \-p +option specifies "passive mode," where characters that do not +match the input format are passed unaltered to the output. +This option has no effect unless +.I \-i +is also specified, and does not make much sense unless +.I \-o +is also given. +With both input and output formats, the passive mode can +effectively substitute information in the middle of a file +or stream without affecting the rest of the data. +.PP The variable and function definitions in each .I \-f source file are read and compiled. @@ -209,6 +234,16 @@ are evaluated. This provides a convenient method for avoiding inappropriate calculations. The following library of pre-defined functions and variables is provided: .TP 10n +.BR "in(n)" +Return the value for input column +.I n, +or the number of columns available in this record if +.I n +is 0. +This is an alternate way to get a column value instead of using +the $N notation, and is more flexible since it is programmable. +This function is disabled if an input format is used. +.TP .BR "if(cond, then, else)" if cond is greater than zero, then is evaluated, otherwise else is evaluated. @@ -258,12 +293,12 @@ trigonometric functions. inverse trigonometric functions. .TP .BR "atan2(y, x)" -inverse tangent of y/x (range -pi to pi). +inverse tangent of y/x (range \-pi to pi). .SH EXAMPLE To print the square root of column two in column one, and column one times column three in column two: .IP "" .2i -rcalc -e '$1=sqrt($2);$2=$1*$3' inputfile > outputfile +rcalc \-e '$1=sqrt($2);$2=$1*$3' inputfile > outputfile .SH AUTHOR Greg Ward .SH BUGS @@ -273,4 +308,4 @@ options, not in definitions. .PP Tabs count as single spaces inside fields. .SH "SEE ALSO" -calc(1), cnt(1), ev(1), getinfo(1), lam(1), tabfunc(1), total(1) +cnt(1), ev(1), getinfo(1), icalc(1), rlam(1), tabfunc(1), total(1)