Advanced Math
Runs on: Shared (backend or chatbox overlay).
Evaluates a formula written in mathjs syntax. Up to four number inputs, a, b, c and d, are the variables in your expression. Use it when a single arithmetic operation isn't enough. Built-in functions such as sqrt, abs, round, floor, ceil, sin, cos, min and max work and can be combined.
Inputs
| Name | Type | Description |
|---|---|---|
a | number | Variable a in the expression. |
b | number | Variable b in the expression. |
c | number | Variable c in the expression. |
d | number | Variable d in the expression. |
Outputs
| Name | Type | Description |
|---|---|---|
output | number | The result of the expression. |
Configuration
- Expression: The formula, in mathjs syntax, using
a,b,candd. For examplesqrt(a^2 + b^2)orround(a / b * 100).
Example
A viewer redeems channel points and types two numbers. Extract them with Regex Extract nodes, wire them to a and b, and set the expression to round(sqrt(a^2 + b^2)) to compute the hypotenuse, then post it to chat.