MathExpression Op
calculates a user defined mathematical expression
Summary (oneliner)
With this op, you can write your own mathematical expression to be calculated. You can use up to 4 numbers (a, b, c, d) in this equation. Just type in the lower-case letter of the port you want to use in the equation input.
Here are a few example equations to get you started:
(a+b)c-d
sin(a+b)-cos(c-d)
alog(b + c * 2) / pow(b, 4)
For a reference of mathematical functions availible, please refer to the Javascript Math object: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math
- Ops.Math.MathExpression
- Core Op - Official cables op
- MIT
Documentation (markdown)
Issues
Example patch id
Youtube ids (comma seperated)
Op Licence
Caniuse query
Example Patch Math expression example
INPUT PORTS
Parameters
a input, default value if not connected: 0
b input, default value if not connected: 0
c input, default value if not connected: 0
d input, default value if not connected: 0
Expression
mathematical expression to be calculated: the variables a, b, c, d can be used here
OUTPUT PORTS
result of the equation
returns true if the expression is valid, false otherwise