Functions: Difference between revisions
Pneumarian (talk | contribs) m (added summary/hint given in Seamly dialog.) |
Pneumarian (talk | contribs) (Added a few use indications) |
||
Line 28: | Line 28: | ||
==== acos - arcus cosine function working with radians ==== |
==== acos - arcus cosine function working with radians ==== |
||
Use: '''acos(''N'')''' where -1≤''N''≤1 |
|||
acos(-1)=3.14159 |
|||
acos(1)=0 |
|||
(-1≤''N''≤1) |
|||
==== acosD - arcus cosine function working with degrees ==== |
==== acosD - arcus cosine function working with degrees ==== |
||
Use: '''acosD(''N'')''' where -1≤''N''≤1 |
|||
acosD(-1)=180 |
|||
acosD(1)=0 |
|||
(-1≤''N''≤1) |
|||
==== acosh - hyperbolic arcus cosine function ==== |
==== acosh - hyperbolic arcus cosine function ==== |
||
Use: '''acosh(''N'')''' where ''N''≥1 |
|||
acosh(1)=0 |
|||
acosh(2)=1.31696 |
|||
(''N'' ≥ 1) |
|||
==== asin - arcus sine function working with radians ==== |
==== asin - arcus sine function working with radians ==== |
||
Use: '''asin(''N'')''' where -1≤''N''≤1 |
|||
==== asinD - arcus sine function working with degrees ==== |
==== asinD - arcus sine function working with degrees ==== |
||
Use: '''asinD(''N'')''' where -1≤''N''≤1 |
|||
==== asinh - hyperbolic arcus sine function ==== |
==== asinh - hyperbolic arcus sine function ==== |
||
Use: '''asinh(''N'')''' |
|||
==== atan - arcus tangens function working with radians ==== |
==== atan - arcus tangens function working with radians ==== |
||
Use: '''atan(''N'')''' |
|||
==== atanD - arcus tangens function working with degrees ==== |
==== atanD - arcus tangens function working with degrees ==== |
||
Use: '''atanD(''N'')''' |
|||
==== atanh - hyperbolic arcur tangens function ==== |
==== atanh - hyperbolic arcur tangens function ==== |
||
Use: '''atanh(''N'')''' where -1<''N''<1 |
|||
==== avg - (average,) mean value of all arguments ==== |
==== avg - (average,) mean value of all arguments ==== |
||
Use: '''avg(''N1'';(''N2''))''' this does seem to be limited to two variables. |
|||
==== cos - cosine function working with radians ==== |
==== cos - cosine function working with radians ==== |
||
Use: '''cos(''N'')''' |
|||
==== cosD - cosine function working with degrees ==== |
==== cosD - cosine function working with degrees ==== |
||
Use: '''cosD(''N'')''' |
|||
==== cosh - hyperbolic cosine ==== |
==== cosh - hyperbolic cosine ==== |
||
Use: '''cosh(''N'')''' |
|||
==== degTorad - converts degrees to radian ==== |
==== degTorad - converts degrees to radian ==== |
||
Use: '''degTorad(''N'')''' |
|||
==== exp - e raised to the power of x ==== |
==== exp - e raised to the power of x ==== |
||
Use: |
|||
==== fmod - Returns the floating-point remainder of numer/denom (rounded towards zero) ==== |
==== fmod - Returns the floating-point remainder of numer/denom (rounded towards zero) ==== |
||
Line 79: | Line 82: | ||
==== log2 - logarithm to the base 2 ==== |
==== log2 - logarithm to the base 2 ==== |
||
==== |
====[[Max (function)|max]] - max of all arguments ==== |
||
==== |
====[[Min (function)|min]] - min of all arguments ==== |
||
==== radTodeg - converts radian to degrees ==== |
==== radTodeg - converts radian to degrees ==== |
Revision as of 23:52, 13 May 2020
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.[1]
![The Functions table in the Measurement Dialog is an excellent place to find most of the available algebraic functions of Seamly.](http://static.miraheze.org/seamlywiki/thumb/c/c9/MeasurementDialogFunctionsTable.png/300px-MeasurementDialogFunctionsTable.png)
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)
* 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) )[2]
abs - absolute value
abs(3-4)=1[3]
acos - arcus cosine function working with radians
Use: acos(N) where -1≤N≤1
acosD - arcus cosine function working with degrees
Use: acosD(N) where -1≤N≤1
acosh - hyperbolic arcus cosine function
Use: acosh(N) where N≥1
asin - arcus sine function working with radians
Use: asin(N) where -1≤N≤1
asinD - arcus sine function working with degrees
Use: asinD(N) where -1≤N≤1
asinh - hyperbolic arcus sine function
Use: asinh(N)
atan - arcus tangens function working with radians
Use: atan(N)
atanD - arcus tangens function working with degrees
Use: atanD(N)
atanh - hyperbolic arcur tangens function
Use: atanh(N) where -1<N<1
avg - (average,) mean value of all arguments
Use: avg(N1;(N2)) this does seem to be limited to two variables.
cos - cosine function working with radians
Use: cos(N)
cosD - cosine function working with degrees
Use: cosD(N)
cosh - hyperbolic cosine
Use: cosh(N)
degTorad - converts degrees to radian
Use: degTorad(N)
exp - e raised to the power of x
Use: