Skip to main content

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​

NameTypeDescription
anumberVariable a in the expression.
bnumberVariable b in the expression.
cnumberVariable c in the expression.
dnumberVariable d in the expression.

Outputs​

NameTypeDescription
outputnumberThe result of the expression.

Configuration​

  • Expression: The formula, in mathjs syntax, using a, b, c and d. For example sqrt(a^2 + b^2) or round(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.