Chapter II. Functions
Built-in functions
The following functions are currently (as of 3.3.0
) built-in
- Trigonometry
sin
(vectorised)cos
(vectorised)tan
(vectorised)
- Hyperbolic trigonometry
sinh
(vectorised)cosh
(vectorised)tanh
(vectorised)
- Reverse trigonometry
asin
(vectorised)acos
(vectorised)atan
(vectorised)
- Exponentiation
exp
(vectorised)ln
(aliaslog
) (vectorised)
- Vectors
norm
- Matrices
det
invert
- Plot
plot
termplot
- Other
sqrt
(vectorised)factorial
(aliasfact
)abs
ceil
floor
round
Trigonometry
For trigonometry, the input is assumed to to in radians
, if it is in degrees
you need to add a second argument (can be anything, like true
) to the function
call.
Exp/ln
If you use the exp
function you can pass the base you want to work with
as a second argument. If nothing is supplied, we assume natural base.
Root
You can add a second argument to sqrt
for the nth
root instead
of the 2nd root.
User defined functions
You can define your own functions with the following syntax
(warning: it might change in 4.0.0
)
Partial functions
You can use a user-defined function to declare a partial function, to have a cos in degrees for example.