Formula

Works out a formula typed as text, with an input for every name in it.

Parameters

NameTypeDescription
ResultoutputFloatThe result of the formula.
FormulaStringThe formula to work out, such as amplitude * sin(time).
[Variables]FloatOne input for every name in the formula, in the order the names first appear.

The Formula operator works out a calculation written as text. Every name in the formula that is not a built-in function or constant becomes an input, so amplitude * sin(time) gives an input called amplitude and one called time. An input keeps its value and connections while its name stays in the formula, and renaming or removing the name removes the input.

A name starts with a letter and may continue with letters, digits and underscores. Capital and small letters make different names. The multiplication sign can be left out where the meaning is clear: 2x means 2 * x and a(b + c) means a * (b + c).

The formula can use + - * / ^ and %, where ^ raises to a power and % gives the remainder of a division. The built-in functions are abs, floor, ceil, sqrt, exp, pow, sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, ln, log, log10, fac, ncr and npr, and the constants are pi and e. Angles are in radians. log is the base 10 logarithm and ln the natural one.

A formula that cannot be read gives 0, and so does a calculation with no proper result, such as dividing by zero.

See also Math.

Keywords: expression, equation, calculate, variable, sin, cos, pow, sqrt