EAB Model Documentation Help

Math Variables and Functions

This page contains a list of variables and functions available when defining formulas.

Variables

  • pi: π (Math.PI)

  • e: Euler's number (Math.E)

  • tau: τ (2.0 * Math.PI)

  • phi: Golden ratio ((1.0 + Math.Sqrt(5.0)) / 2.0)

  • inf: Positive Infinity (double.PositiveInfinity)

  • nan: Not a Number (double.NaN)

  • degToRad: Degrees to Radians conversion (Math.PI / 180.0)

  • radToDeg: Radians to Degrees conversion (180.0 / Math.PI)

  • DBH: Diameter at Breast Height

  • AGE: Age of the tree

  • INJECTION: Injection variable

  • HEALTHY: Health status (1 if Healthy, 0 otherwise)

  • DECLINING: Health status (1 if Declining, 0 otherwise)

  • DEAD: Health status (1 if Dead, 0 otherwise)

  • LOCATION: Location factor

Functions

  • sin(x): Sine function

  • cos(x): Cosine function

  • tan(x): Tangent function

  • asin(x): Arcsine function

  • acos(x): Arccosine function

  • atan(x): Arctangent function

  • atan2(y, x): Arctangent of y/x

  • sinh(x): Hyperbolic sine function

  • cosh(x): Hyperbolic cosine function

  • tanh(x): Hyperbolic tangent function

  • sqrt(x): Square root function

  • cbrt(x): Cube root function

  • root(x, y): x-th root of y

  • exp(x): Exponential function

  • abs(x): Absolute value function

  • log(x): Natural logarithm function

  • log10(x): Base 10 logarithm function

  • log2(x): Base 2 logarithm function

  • logn(x, base): Logarithm with a specified base

  • pow(x, y): Power function (x^y)

  • mod(x, y): Modulus function (x % y)

  • min(x, y): Minimum of two values

  • max(x, y): Maximum of two values

  • floor(x): Floor function

  • ceil(x): Ceiling function

  • round(x): Round to the nearest integer

  • sign(x): Sign function

  • clamp(x, min, max): Clamp function (restrict x between min and max)

  • lerp(t, a, b): Linear interpolation between a and b with parameter t

  • inverseLerp(t, a, b): Inverse linear interpolation parameter between a and b with given value t

Last modified: 20 February 2024