This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
formula [Wed May 26 11:33:19 2010] Alexander |
formula [Tue Jan 12 13:37:10 2021] (current) Alexander |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Formula Syntax ====== | + | Page moved to [[expressions]]. |
- | Formula editor is used in the following cases: | + | |
- | * [[Set Column Formula]] | + | |
- | * [[fitting|Custom Fit Curve]] | + | |
- | * Cell editing in [[Table]] | + | |
- | + | ||
- | MagicPlot uses standard [[wp> | + | |
- | + | ||
- | === Syntax Highlighting === | + | |
- | MagicPlot formula editor highlights expression syntax. It also marks matching brackets: | + | |
- | {{: | + | |
- | + | ||
- | ===== General Rules ===== | + | |
- | === Case Sensitivity === | + | |
- | MagicPlot formula translator is generally **case sensitive**, | + | |
- | + | ||
- | Note that '' | + | |
- | + | ||
- | === Entering Numbers === | + | |
- | You can use only dot ('' | + | |
- | Comma ('','' | + | |
- | + | ||
- | You can use '' | + | |
- | + | ||
- | === Using Spaces and Line Breaks === | + | |
- | You can freely insert space characters and line breaks in formula, but do not break function names, numbers, operators. You do not need to enter special characters to indicate line break. | + | |
- | + | ||
- | ===== Functions ===== | + | |
- | You can see a list of all available functions and their descriptions in // | + | |
- | + | ||
- | MagicPlot uses functions of Java programming language library '' | + | |
- | + | ||
- | ==== Trigonometric Functions ==== | + | |
- | MagicPlot supports all standard trigonometric functions ('' | + | |
- | + | ||
- | You can use the following functions to convert angles units: | + | |
- | + | ||
- | * '' | + | |
- | * '' | + | |
- | + | ||
- | == Examples == | + | |
- | * '' | + | |
- | * '' | + | |
- | + | ||
- | ==== Constants ==== | + | |
- | The predefined constants are: | + | |
- | + | ||
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | + | ||
- | ===== Boolean Logic ===== | + | |
- | MagicPlot can interpret boolean logic expressions. Zero and negative values (''< | + | |
- | You can use simple logical operators which are described below. Use '' | + | |
- | + | ||
- | === ' | + | |
- | + | ||
- | The basic logical function is '' | + | |
- | + | ||
- | == Examples == | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | + | ||
- | === Equality Checking === | + | |
- | + | ||
- | You have to be careful if you need to check equality of two values. Due to inaccuracy of computer calculations the result of evaluation is always approximate. For example, result of '' | + | |
- | + | ||
- | Generally, if you want to check equality of two values you need to use some equality threshold for relative difference. That is, you should compare the modulus of relative difference of two values '' | + | |
- | + | ||
- | == Examples == | + | |
- | * '' | + | |
- | * '' | + | |
- | + | ||
- | ===== Operators ===== | + | |
- | ^ Operator | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | ''/'' | + | |
- | | ''< | + | |
- | | ''< | + | |
- | | ''&'' | + | |
- | + | ||
- | === Operations Priority === | + | |
- | Operators with **lower** precedence value are evaluated **earlier**. You can use brackets to change calculation sequence. | + | |
- | + | ||
- | Expression is evaluated left-to-right, | + | |
- | + | ||
- | The reason exponentiation is right-associative is that a repeated left-associative exponentiation operation would be less useful. Multiple appearances could (and would) be rewritten with multiplication: | + | |
- | + | ||
- | ^ Operations | + | |
- | | '' | + | |
- | | ''< | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | ''<'', | + | |
- | | '' | + | |
- | | ''&'' | + | |
- | |''< | + | |
- | |'' | + | |
- | + | ||
- | == Examples == | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + |