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 HeightAGE
: Age of the treeINJECTION
: Injection variableHEALTHY
: 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 functioncos(x)
: Cosine functiontan(x)
: Tangent functionasin(x)
: Arcsine functionacos(x)
: Arccosine functionatan(x)
: Arctangent functionatan2(y, x)
: Arctangent of y/xsinh(x)
: Hyperbolic sine functioncosh(x)
: Hyperbolic cosine functiontanh(x)
: Hyperbolic tangent functionsqrt(x)
: Square root functioncbrt(x)
: Cube root functionroot(x, y)
: x-th root of yexp(x)
: Exponential functionabs(x)
: Absolute value functionlog(x)
: Natural logarithm functionlog10(x)
: Base 10 logarithm functionlog2(x)
: Base 2 logarithm functionlogn(x, base)
: Logarithm with a specified basepow(x, y)
: Power function (x^y)mod(x, y)
: Modulus function (x % y)min(x, y)
: Minimum of two valuesmax(x, y)
: Maximum of two valuesfloor(x)
: Floor functionceil(x)
: Ceiling functionround(x)
: Round to the nearest integersign(x)
: Sign functionclamp(x, min, max)
: Clamp function (restrict x between min and max)lerp(t, a, b)
: Linear interpolation between a and b with parameter tinverseLerp(t, a, b)
: Inverse linear interpolation parameter between a and b with given value t