beta
cables is under heavy development.
There might be one or another bug, please let us know about it!

MathExpression Op

MathExpression

calculates a user defined mathematical expression


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)
a
log(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


Edit Documentation

Full Name
  • Ops.Math.MathExpression
Visibility
  • Core Op - Official cables op
Author


 

INPUT PORTS


Parameters

A (Number)

a input, default value if not connected: 0

B (Number)

b input, default value if not connected: 0

C (Number)

c input, default value if not connected: 0

D (Number)

d input, default value if not connected: 0

Expression

Expression (String)

mathematical expression to be calculated: the variables a, b, c, d can be used here

OUTPUT PORTS


Result (Number)

result of the equation

Expression Valid (boolean Number)

returns true if the expression is valid, false otherwise


Usages of MathExpression

  • Examples
  • Public
  • My Patches
  • Ops

Changelog


created opuser avatarsimod - 2020-07-23
Ops.User.simod.MathExpression renamed to Ops.Math.MathExpressionuser avatarsimod - 2020-07-23