Functions: Difference between revisions
Content added Content deleted
Pneumarian (talk | contribs) m (Added picture) |
Pneumarian (talk | contribs) m (Added the basic mathematical functions, as well as IF) |
||
Line 1: | Line 1: | ||
When writing out measurement equations in Seamly, there are many mathematical functions that one may use to make them work seamlessly. This is [to be] a list of the functions, with a one-line example of how to actually use them in equations. |
When writing out measurement equations in Seamly, there are many mathematical functions that one may use to make them work seamlessly. This is [to be] a list of the functions, with a one-line example of how to actually use them in equations. Functions are served by the muparser math library.<ref>https://forum.seamly.net/t/math-functions-nested-if-statement/2053</ref> |
||
[[File:MeasurementDialogFunctionsTable.png|alt=The Functions table in the Measurement Dialog is an excellent place to find most of the available algebraic functions of Seamly.|thumb|A picture of the Functions table.]] |
[[File:MeasurementDialogFunctionsTable.png|alt=The Functions table in the Measurement Dialog is an excellent place to find most of the available algebraic functions of Seamly.|thumb|A picture of the Functions table.]] |
||
<br /> |
|||
== Basic Functions == |
|||
These are functions which are so basic that they didn't get included in the list |
|||
+ plus (3+4=7) |
|||
- minus (3-4=-1) |
|||
<nowiki>*</nowiki> times (3*4=12) |
|||
/ dividedby (3/4=.75) |
|||
^ to the power of (3^4=81) |
|||
== Advanced Functions == |
|||
Most of these functions are found in the table, however there are several which depend on your ability to construct an IF function in Seamly. As such, I will discuss the IF statement, (which is not in the list,) first, & then proceed in alphabetical order as the functions appear in the list. It may be better to list them by branch of mathematics, but for now the list, & thus the alphabet, has priority. |
|||
=== IF function === |
|||
* '''if a<b then c else d''' looks like '''( a<b ? c : d)''' in Seamly2D formulas. |
|||
* '''if e<f then f else g''' looks like '''(e<f ? f : g)''' |
|||
* When d is another test, then it looks like: '''( a<b ? c : (e<f ? f : g) )'''<ref>[https://forum.seamly.net/t/math-functions-nested-if-statement/2053/5?u=pneumarian https://forum.seamly.net/t/math-functions-nested-if-statement/2053/5]</ref> |