MathExpression Op
calculates a user defined mathematical expression
Summary (oneliner)
<p>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.</p> <p>Here are a few example equations to get you started:</p> <p>(a+b)<em>c-d sin(a+b)-cos(c-d) a</em>log(b + c * 2) / pow(b, 4)</p> <p>For a reference of mathematical functions availible, please refer to the Javascript Math object: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math</a></p>
- 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
<p>a input, default value if not connected: 0</p>
<p>b input, default value if not connected: 0</p>
<p>c input, default value if not connected: 0</p>
<p>d input, default value if not connected: 0</p>
Expression
<p>mathematical expression to be calculated: the variables a, b, c, d can be used here</p>
OUTPUT PORTS
<p>result of the equation</p>
<i>boolean</i>
Number)<p>returns true if the expression is valid, false otherwise</p>