Formula: Syntax
QuickField formula is an expression composed of the following elements:
numeric constants
integer (Ex: 123)
fixed-point (Ex: 123.45 123. 0.123 .123)
floating-point (Ex: 1e12 5.39e+8 0.1E-12 .2E+2)
arithmetic operators
+ addition (Ex: 2+2)
- subtraction (Ex: 3-5)
* multiplication (Ex: 1.23*0.12)
/ division (Ex: 1E5/0.01)
^ raising to a power (Ex: 3.14^2)
unary operators
+ sign retaining (Ex: +180)
- sign change (Ex: -180)
embedded functions (see detailed description in Formula: Functions)
abs - absolute value
sign - sign
max - maximum
min - minimum
step - step-function by 1
impulse - impulse segment
sin - sine
cos - cosine
tan - tangent
asin - arc sine
acos - arc cosine
atan - arc tangent
atan2 - arc tangent with two arguments
exp - exponent
log - natural logarithm
sqrt - square root
pow - raising to a power
saw - saw-tooth periodic function
embedded constants (see detailed description in Formula: Constants and Predefined Variables)
pi - pi
e - e
predefined variables (see detailed description in Formula: Constants and Predefined Variables)
t - current time
x - Cartesian coordinate x
y - Cartesian coordinate y
r - polar coordinate r
phi - polar coordinate φ in degrees
parentheses (change the order of operations)
space and tabulation characters
Notes:
- Numerical values should not contain group separators. Dot ('.') should be used as decimal separator regardless of regional settings.
- Both e and E are allowed to separate mantissa and magnitude in floating point values.
- The names of embedded functions, constants and predefined variables are case insensitive.
- Any name can be enclosed in double quotes. For example, sin (t) is equivalent to "sin"(t).
- Operation precedence (highest to lowest): ^, then * and /, then + and -. This order can be changed with parentheses.
- Any number of spaces can be inserted in any part of formula without any impact on that formula, provided the spaces are not inside any name.
- Function arguments should be placed inside parentheses after the name of the function. They should be separated with commas (',').