Reference Manual
PMAC 2 Software Reference
368 PMAC Mathematical Features
SQRT
Function
Square root
Syntax
SQRT({expression})
Domain
Non-negative real numbers
Domain units
User-determined
Range
Non-negative real numbers
Range units
User-determined
Remarks
SQRT implements the positive square-root function of the mathematical expression
contained inside the following parentheses.
If the argument inside the parentheses is outside of the legal domain of non-negative
numbers, an arbitrary value will be returned. No error will be reported, and the
program will not stop. It is the programmer’s responsibility to check for possible
domain errors.
Example
P19=SQRT(P20) ; Takes the square root of P20
P50=SQRT(P8*P8+P9*P9) ; Pythagorean theorem calculation
TAN
Function
Trigonometric tangent
Syntax
TAN({expression})
Domain
All real numbers except +/-(2N-1)*90 degrees
Domain units
Radians/degrees
Range
All real numbers
Range units
none
Remarks
TAN implements the trigonometric tangent function of the mathematical expression
contained inside the following parentheses.
This function interprets its argument in degrees if I15 is set to the default value of 0; it
interprets its argument in radians if I15 is set to 1.
If the argument inside the parentheses approaches +/-(2N-1)*90 degrees (+/-90, 270,
450, etc.), the TAN function will “blow up” and a very large value will be returned. If
the argument inside the parentheses is exactly equal to one of these quantities, an
internal division-by-zero error will occur and the resulting value will saturate at +/-2
47
.
No error will be reported, and the program will not stop. It is the programmer’s
responsibility to check for possible domain errors.
Example
P60=TAN(30) ; Computes cosine of 30
Y(Q80*TAN(Q81)) ; Move Y axis to calculated value