Guide · 09 of 09
Expressions & Math
Expressions appear in object properties (like the expr in curve f = <expr>), control bounds, and ${...} label interpolations. They're evaluated at runtime against the current state.
operators#
^ is exponentiation (e.g. x^2). All standard arithmetic. Standard precedence.
+ - * / ^ %
Example
math functions#
All standard math functions, called without a namespace prefix. Trig works in radians — deg/rad convert. mod is a true modulo (unlike the % operator, mod(-1, 3) is 2). fact, nCr and nPr are the counting functions; they return nothing usable for negative, non-integer, or out-of-range input.
sin cos tan asin acos atan atan2 sinh cosh tanh sec csc cot sqrt cbrt abs log log2 log10 exp pow hypot floor ceil round sign min max clamp lerp mod deg rad fact nCr nPr
Example
interpolation#
In label text, ${expr} is evaluated at runtime and shown rounded to 2 decimal places.
"text ${expr} more text"Example
f-strings#
Compile-time string interpolation. Used to generate unique object IDs and string values inside for loops. Uses {expr}, not ${expr}.
f"text {expr}"
Example