|
From: <ray...@us...> - 2003-07-20 13:42:29
|
Update of /cvsroot/emc/documents/lyx In directory sc8-pr-cvs1:/tmp/cvs-serv27209 Modified Files: User_Gcode_Computation.lyx Log Message: added RS274NGC quote Index: User_Gcode_Computation.lyx =================================================================== RCS file: /cvsroot/emc/documents/lyx/User_Gcode_Computation.lyx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** User_Gcode_Computation.lyx 5 Jul 2003 01:44:29 -0000 1.1 --- User_Gcode_Computation.lyx 20 Jul 2003 13:42:26 -0000 1.2 *************** *** 29,32 **** \layout Standard ! (Write this) \the_end --- 29,107 ---- \layout Standard ! (This chapter needs examples) ! \layout Quotation ! ! Expressions and Binary Operations ! \layout Quotation ! ! An expression is a set of characters starting with a left bracket [ and ! ending with a balancing right bracket ]. ! In between the brackets are numbers, parameter values, mathematical operations, ! and other expressions. ! An expression may be evaluated to produce a number. ! The expressions on a line are evaluated when the line is read, before anything ! on the line is executed. ! An example of an expression is [ 1 + acos[0] - [#3 ** [4.0/2]]]. ! ! \layout Quotation ! ! Binary operations appear only inside expressions. ! Nine binary operations are defined. ! There are four basic mathematical operations: addition (+), subtraction ! (-), multiplication (*), and division (/). ! There are three logical operations: non-exclusive or (OR), exclusive or ! (XOR), and logical and (AND). ! The eighth operation is the modulus operation (MOD). ! The ninth operation is the "power" operation (**) of raising the number ! on the left of the operation to the power on the right. ! ! \layout Quotation ! ! The binary operations are divided into three groups. ! The first group is: power. ! The second group is: multiplication, division, and modulus. ! The third group is: addition, subtraction, logical non-exclusive or, logical ! exclusive or, and logical and. ! If operations are strung together (for example in the expression [2.0 / ! 3 * 1.5 - 5.5 / 11.0]), operations in the first group are to be performed ! before operations in the second group and operations in the second group ! before operations in the third group. ! If an expression contains more than one operation from the same group (such ! as the first / and * in the example), the operation on the left is performed ! first. ! Thus, the example is equivalent to: [((2.0 / 3) * 1.5) - (5.5 / 11.0)] , which ! simplifies to [1.0 - 0.5] , which is 0.5. ! ! \layout Quotation ! ! The logical operations and modulus are to be performed on any real numbers, ! not just on integers. ! The number zero is equivalent to logical false, and any non-zero number ! is equivalent to logical true. ! ! \layout Quotation ! ! 3.3.2.4 Unary Operation Value ! \layout Quotation ! ! A unary operation value is either "ATAN" followed by one expression divided ! by another expression (for example "ATAN[2]/[1+3]") or any other unary ! operation name followed by an expression (for example "SIN[90]"). ! The unary operations are: ABS (absolute value), ACOS (arc cosine), ASIN ! (arc sine), ATAN (arc tangent), COS (cosine), EXP (e raised to the given ! power), FIX (round down), FUP (round up), LN (natural logarithm), ROUND ! (round to the nearest whole number), SIN (sine), SQRT (square root), and ! TAN (tangent). ! Arguments to unary operations which take angle measures (COS, SIN, and ! TAN) are in degrees. ! Values returned by unary operations which return angle measures (ACOS, ! ASIN, and ATAN) are also in degrees. ! ! \layout Quotation ! ! The FIX operation rounds towards the left (less positive or more negative) ! on a number line, so that FIX[2.8] =2 and FIX[-2.8] = -3, for example. ! The FUP operation rounds towards the right (more positive or less negative) ! on a number line; FUP[2.8] = 3 and FUP[-2.8] = -2, for example. ! \the_end |