Expression Operators
|
Function
|
Example
|
Operators: Scalars and/or Vectors
|
||
Addition
|
a = b+c or V = U+W
|
|
Subtraction
|
a = b-c or V = U-W
|
|
*
|
Multiplication of two Scalars or a Scalar and a Vector
|
a = b*c or V = a*U (but not V = U * W)
|
Operator: Scalars Only
|
||
/
|
Division
|
a = b/c
|
exp(scalar)
|
Base e exponential function
|
a= exp(b) raises e to the power of b: a= eb
|
ln(scalar)
|
The natural logarithm function for e
|
a= ln(b) returns the natural log of b
|
sqrt(scalar)
|
square root function
|
a = sqrt(b)
|
^
|
exponential function
|
a= b^c raises b to the power of c: a= bc
|
Operator: Vectors Only
|
||
&
|
vector dot product
|
a = V&U (a = |V| |U| cos (angle))
|
^
|
vector cross product
|
V=U^W (|V| = |U| |W| x sin (angle) ), The right-hand-rule is applied. |
len (vector)
|
returns the length of vector V
|
a = len(V)
|
normalize(vector)
|
returns a normalized unit vector V/|V|
|
V = normalize(U)
|
rotate (vector, angle, direction, center)
|
Returns a rotated vector based on the rotation angle, RHR, rotational axis and an optional rotation center. (If no center is defined, it defaults to 0,0,0)
|
Vrot = rotate(V,alpha,U,W) where V is the vector to be rotated, alpha is the angle in radians, and U is the axis of rotation. The right-hand-rule is applied. W is an optional center point defined as a vector.
|
Expression Operators
|
Function
|
Example
|
true
|
logic true
|
|
false
|
logic false
|
|
<
|
less than
|
|
>
|
greater than
|
|
==
|
Equal in logical comparison
|
a = (b==3) ? 1 : 2
|
or
|
logical or
|
|
and
|
logical and
|
|
!
|
logical negation
|
!< not less than
|
a = expression ? b : c
|
a = b if expression is true;
a = c if expression is false
|
a = (b>3) ? 1 : 2 ==> ( If b is greater than 3, a = 1 otherwise a = 2 )
|
Transcendental Expressions
|
Function
|
Trigonometric
|
|
sin(radians)
|
sine function
|
cos(radians)
|
cosine function
|
cot(radians)
|
cotangent function
|
tan(radians)
|
tangent function
|
asin()
|
inverse sine function, returns value in rad
|
acos()
|
inverse cosine function, returns value in rad
|
acot()
|
inverse cotangent function, returns value in rad
|
atan()
|
inverse tangent function, returns value in rad
|
atan2(y,x )
|
two variable inverse tangent function, (-pi, pi), returns value in rad
|
Hyperbolic
|
|
sinh()
|
hyperbolic sine function
|
cosh()
|
hyperbolic cosine function
|
coth()
|
hyperbolic cotangent function
|
tanh()
|
hyperbolic tangent function
|
asinh()
|
inverse hyperbolic sine function
|
acosh()
|
inverse hyperbolic cosine function
|
acoth()
|
inverse hyperbolic cotangent function
|
atanh()
|
inverse hyperbolic tangent function
|
Expression Operators
|
Function
|
Example
|
abs(x)
|
absolute value function
|
|
max(x,y)
|
maximum function
|
a = max(b,c) ==> a= b if b >c or a=c if y>=b
|
min(x,y)
|
minimum function
|
a = min(b,c) ==> a= b if b <c or a=c if c<=b
|
mod(x,y)
|
modulus function,
|
a = mod(c,b) ==> a = the remainder of c divided by b
|
sgn(x)
|
returns a flag (-1, 0, or 1) indicating the sign
|
a= sgn(b) ==> a = -1 if b<0 a = 0 if b=0 a = 1 if b>0
|
step(x)
|
step function returns a 0 or 1 depending on the value relative to zero
|
a= step(b) ==> a = 0 if b<0 a = 1 if b>=0
|
Table Expressions
|
Function
|
table(filename,x)
|
Interpolates from a 1-D Table
|
table(filename, x ,y)
|
Interpolates from a 2-D Table
|
|
To add a comment, put a hash-mark “#” before the text. Do not insert comments before the xml line or line 1.
|