ENVISION includes a mathematical expression language that can be used to evaluate map-based mathematical expressions. This is used in a variety of “standard” plug-ins, and can be accessed using user-defined plug-ins. This language allows for expressions that can contain:

Available operators and functions are specified below.

OperatorDescriptionExample
+ Addition 1 + 2
* Subtraction and unary minus1-2
* Multiplication 1*2
/ Division 1/2
^ Power 2^2
% Modulo 2%1
& Logical AND MYFIELD & 2
| Logical OR MYFIELD | 2
! Logical NOT ! MYFIELD
>, >= Greater or equal to MYFIELD > 3
<, <= Less than or equal to MYFIELD <= 3
!= Not equal MYFIELD != 3
== Equal MYFIELD == 3
OperatorReturn ValueExample
abs(x) Absolute Value of xabs(-12) => 12
acos(x) Inverse Cosine of x (radians)
asin(x) Inverse Sine of x (radians)
atan(x) Inverse Tan of x (radians)
avg(x,y,z...) Average value of the argumentsavg(1,3) => 2
ceil(x) Value of x rounded up to nearest integerceil(2.3) => 3
cos(x) Cosine of x (radians)
cosh(x) Hyperbolic cosign of x (radians)
floor(x) Value of x rounded down to nearest integerfloor(2.3) => 3
if(cond,trueEx, falseEx)Conditional expression - if 'cond' is true, return value of 'trueEx', otherwise, return the value of 'falseEx'
log(x) Natural Log of x
log10(x) Log base 10 of x
max(x,y,z,…) Maximum value of the argument list
min(x,y,z,…) Minimum value of the argument list
rand(x) Uniform Random value between (0,1)
rand(min, max) Uniform Random value between (min,max)
round(x) Value of x rounded to the nearest integer
sin(x) Sine of x (radians)
sinh(x) Hyperbolic Sine of x (radians)
sqrt(x) Square Root of x
sum(x,y,z,…) Sum of the argument list
tan(x) Tangent of x (radians)
tanh(x) Hyperbolic Tangent of x (radians)

Expression can be nested to an unlimited depth. Examples of valid expressions include:

For more details on the expression evaluator used in Envision, see http://www.codeproject.com/Articles/7335/An-extensible-math-expression-parser-with-plug-ins