This is from the Robcad help manual...
Functions
Kinematics
general
HEADER of commands which enable defining a joint as a function joint. These commands define functions which receive the values of the independent joint or joints, and which return the value of the function (dependent) joint.
definition
A function joint is a joint the movement of which is totally dependent on the motion of one or more other joints and which therefore does not constitute an independent, accessible degree of freedom. It is not listed in the data window together with the data for the active mechanism, and cannot be actuated by the drive command nor from the Workcell Motion/joint jog panel. If a motion command moves an independent joint, any function joints dependent thereon also move according to their functional dependence.
current joint
For these commands, the function joint for which the function is written is either the current joint as specified for the current command under the Edit Joint header, or is another, specified joint. The name of the current joint is displayed in the data window.
functions
A functionjoint function consists of an expression expr surrounded by double quotation marks "", i.e., "expr".
When expr includes a reference to an independent joint, that reference can assume any of four different forms:
t# d#
Designate a rotational or prismatic joint, respectively, numbered # in the order of the joints as determined when the mechanism is defined by the mechanism define command. This order is determined by the system and is subject to change if the mechanism is subsequently redefined. The maximum allowable number of joints is 64.
T(name) D(name)
Designate a rotational or prismatic joint, respectively, specified by its name determined when the joint was defined or as subsequently renamed by the user.
The format of expr itself has one or more of the forms listed below. In all of the forms, the spaces as shown are optional; thus (mnp) and ( mnp ) are equally valid.
( string )
One of seven forms enclosed in parentheses ( ):
DenavitHartenberg parameters: one of a i o c s d t f followed by one or more digits from 1 to 9. Examples: (a1), (s5), (t32). The digit 0 cannot be the first digit: (d08) is not allowed.
TCP matrix: one of n o a p followed by one of x y z. Examples: (nx), (ay).
Inverse TCP matrix: m followed by one of n o a followed by p. Examples: (mnp), (map).
Tool matrix: h followed by two digits each in the range 0 to 3. Examples: (h10), (h33).
Base matrix: b followed by two digits each in the range 0 to 3. Examples: (b03), (b32).
0 or ±1: 0 or 1 or –1. Examples: (0), (−1).
Sine or cosine abbreviation: Uppercase S or C for rotational joints, or lowercase s or c for prismatic joints, followed by one or more digits from 0 to 9, to express the sine or cosine of the specified joint in radians. This expression abbreviates references to joints in the format d# or t#; it does not abbreviate expressions using D(name) or T(name).
Examples: (S9) means (sin(t9)) for rotational joint 9; (s9) means (sin(d9)) for prismatic joint 9. (C1) similarly means (cos(t1)) and (c1) means (cos(d1)). An expression like (sin(T(j2))) cannot be abbreviated.
( number )
A real number. A minus sign – is prefixed if the value is negative. If the value is a decimal fraction a decimal point . is appended and followed by one or more digits; if the fraction is less than 1 the leading zero may be omitted. If the value is a whole number the .0 portion may be omitted. Examples: (–0.21), (–.21), (200.03), (762).
sin  cos  tan ( expr )
The respective trigonometric value of expr in radians. Examples: (sin(t3)), (cos(T(j3))), (tan(D(j1)/a3)).
asin ( expr )
The arc sine of
expr, returning values in the range
−π/2 to
π/2.
Example: (asin(nx)).
acos ( expr )
The arc cosine of expr, returning values in the range 0 to π. Example: (acos(nx0y–ny0x)).
atan ( expr )
The arc tangent of expr, returning values in the range −π/2 to π/2. Example: (atan(31.7)).
atan2 ( expr1 , expr2 )
The arc tangent of expr1/expr2, returning values in the range −π to π. Example: (atan2(31.7,1.7)).
sqrt ( expr )
The square root of expr ≥ 0. Example: (sqrt(4)).
ln ( expr )
The natural logarithm of expr ≥ 0. Example: (ln(4)).
exp ( expr )
Expr constituted as an exponent. Example: (exp(2)).
pow ( expr1 , expr2 )
Expr1 raised to the power expressed by the exponent consisting of expr2. Example: (pow(10, 2)) returns 100.
abs ( expr )
The absolute value of expr. Example: (abs(–3)) returns 3.
floor ( expr )
The largest integer not greater than expr. Example: (floor(27.9)) returns 27.
ceil ( expr )
The smallest integer not less than expr. Example: (ceil(27.9)) returns 28.
int ( expr )
The integer portion of expr; the fractional portion is truncated. Example: (int(27.9)) returns 27.
sgn ( expr )
The sign of expr, returning 1 if expr is positive, –1 if expr is negative, and 0 if expr is zero. Example: (sgn(−3)) returns –1.
! ( expr )
Not expr, where expr is Boolean.
rad ( expr )
The conversion of expr to radians.
deg ( expr )
The conversion of expr to degrees.
( expr1 expr2 )
( expr * expr2 )
The product of expr1 and expr2; the sign * is optional.
( expr1 + expr2 )
The sum of expr1 and expr2; expr2 may itself be a sum of two or more expressions. Example: (2+(3+(−3))) returns 2. The parentheses are required.
( expr1 / expr2 )
The quotient of expr1 divided by expr2; expr2 may be a sum of two or more expressions. Example: (6/(1+2)) returns 2. The parentheses are required.
( expr1 % expr2 )
The remainder of expr1 divided by expr2; expr2 may be a sum of two or more expressions. Example: (9%7) returns 2.
( expr1 == expr2 )
( expr1 != expr2 )
( expr1 >= expr2 )
( expr1 <= expr2 )
( expr1 > expr2 )
( expr1 < expr2 )
Return 1 if the indicated comparisons are true, 0 if the comparisons are false.
(bexpr1 && bexpr2 )
Boolean and: evaluates Boolean expressions bexpr1 and bexpr2 in the order given and returns 1 if they are both true, 0 otherwise. If bexpr1 is false, this function returns 0 and exits without evaluating bexpr2.
( bexpr1  bexpr2 )
Boolean or: evaluates Boolean expressions bexpr1 and bexpr2 in the order given and returns 0 if they are both false, 1 otherwise. If bexpr1 is true, this function returns 1 and exits without evaluating bexpr2.
implementation notes
1

The Robcad functionjoint implementation is heavily dependent on nested parentheses. When formulating a formula, ensure that the parentheses are properly placed and balanced.

2

The command line and editor commands verify usersupplied functions and issue error messages if the syntax is incorrect.
