A function transforms zero or more textual or numerical parameters
into another value.
Functions are used inside an expression, and support remote rendering.
The user can create its own custom functions but only built-in functions
and official plugins can create functions that support teleportation.
Core functions
WARNING! In BeamToIX 4.x these core functions will move core-functions plugin.
To prevent breaking changes include now the js script core-functions.js on the html file.
BeamToIX has the following core functions:
sin - 'sine' trigonometric function.
cos - 'cosine' trigonometric function.
tan - 'tangent' trigonometric function.
exp - 2^x
log - ln
log10 - base 10 logarithm.
abs - absolute value.
sign - sign function v != 0 ? v / |v| : 0.
random - random number between [0, 1].
ceil- always rounds up.
floor- always rounds down.
sqrt - square root.
round - round to the nearest integer value.
downRound - similar to round, but it guaranties that if fractional
part is 0.5, it will always round down.
toNumber - converts a textual parameter into a numerical parameter.
toString - converts a numerical parameter into a textual parameter.
uppercase - returns the uppercase of the textual parameter.
lowercase - returns the lowercase of the textual parameter.
capitalize -returns the uppercase of the first letter of each word
substr - returns the a section of the 1st parameter.
The 2nd parameter is the start value and the 3rd parameter is the length.
If the 3rd parameter is less than 0, than is considered until the end.
iff - if the 1st numerical parameter is different from 0,
it returns the 2nd parameter, otherwise it returns the 3rd paramter.
This function doesn't supports lazy evaluation.
case - the 1st numerical parameter is a zero index to select which
parameters to return.
This function doesn't supports lazy evaluation.
get - returns the numerical N-value of a 0-base array.
slice - returns a subarray starting from start to end-1 of a 0-base array.
Description
A function transforms zero or more textual or numerical parameters into another value. Functions are used inside an expression, and support remote rendering. The user can create its own custom functions but only built-in functions and official plugins can create functions that support teleportation.
Core functions
WARNING! In BeamToIX 4.x these core functions will move
core-functionsplugin. To prevent breaking changes include now the js scriptcore-functions.json the html file.BeamToIX has the following core functions:
sin- 'sine' trigonometric function.cos- 'cosine' trigonometric function.tan- 'tangent' trigonometric function.exp- 2^xlog- lnlog10- base 10 logarithm.abs- absolute value.sign- sign functionv != 0 ? v / |v| : 0.random- random number between [0, 1].ceil- always rounds up.floor- always rounds down.sqrt- square root.round- round to the nearest integer value.downRound- similar to round, but it guaranties that if fractional part is 0.5, it will always round down.toNumber- converts a textual parameter into a numerical parameter.toString- converts a numerical parameter into a textual parameter.uppercase- returns the uppercase of the textual parameter.lowercase- returns the lowercase of the textual parameter.capitalize-returns the uppercase of the first letter of each wordsubstr- returns the a section of the 1st parameter. The 2nd parameter is the start value and the 3rd parameter is the length. If the 3rd parameter is less than 0, than is considered until the end.iff- if the 1st numerical parameter is different from 0, it returns the 2nd parameter, otherwise it returns the 3rd paramter. This function doesn't supports lazy evaluation.case- the 1st numerical parameter is a zero index to select which parameters to return. This function doesn't supports lazy evaluation.get- returns the numerical N-value of a 0-base array.slice- returns a subarray starting fromstarttoend-1of a 0-base array.Examples
Example
Example
Example
Example
Example