a + b
(ri:2, ri:2) -> ri:2
(ri:2, ?:1) -> ri:2
(?:1, ri:2) -> ri:2
(?t:1, ?t:1) -> ?t:1
(?t:?l, ?:1) -> ?t:?l
(?t:?l, ?t:?l) -> ?t:?l
Addition. Works on real numbers, complex numbers and tuples.
Tuples can be added element-wise or the same real number can be added
to each element of a tuples.
a && b
(?t:1, ?t:1) -> ?t:1
The logical conjunction of the two arguments.
a / b
(ri:2, ri:2) -> ri:2
(?t:1, ri:2) -> ri:2
(?:2, m2x2:4) -> v2:2
(?:3, m3x3:9) -> v3:3
(?t:1, ?t:1) -> ?t:1
(?t:?l, ?:1) -> ?t:?l
(?t:?l, ?t:?l) -> ?t:?l
Division. Works on real numbers, complex numbers, tuples, vectors
and matrices. A tuple can be divided by another element-wise or by
the same number for each element. Vectors can be divided by
matrices.
a == b
(?t:1, ?t:1) -> ?t:1
Returns 1 if the arguments are equal, otherwise 0.
a > b
(?t:1, ?t:1) -> ?t:1
Returns 1 if a is greater than b, otherwise 0.
a >= b
(?t:1, ?t:1) -> ?t:1
Returns 1 if a is greater or equal than b,
otherwise 0.
a < b
(?t:1, ?t:1) -> ?t:1
Returns 1 if a is less than b, otherwise 0.
a <= b
(?t:1, ?t:1) -> ?t:1
Returns 1 if a is less or equal than b, otherwise
0.
a % b
(?t:1, ?t:1) -> ?t:1
(?t:?l, ?:1) -> ?t:?l
(?t:?l, ?t:?l) -> ?t:?l
Remainder. Calculates the remainder of a division. Works on real
numbers and tuples. The remainder can be calculated for two tuples
element-wise or for one tuple and the same number for each element of
the tuple.
a * b
(ri:2, ri:2) -> ri:2
(?:1, ri:2) -> ri:2
(m2x2:4, m2x2:4) -> m2x2:4
(m3x3:9, m3x3:9) -> m3x3:9
(v2:2, m2x2:4) -> v2:2
(v3:3, m3x3:9) -> v3:3
(m2x2:4, v2:2) -> v2:2
(m3x3:9, v3:3) -> v3:3
(quat:4, quat:4) -> quat:4
(cquat:4, cquat:4) -> cquat:4
(hyper:4, hyper:4) -> hyper:4
(?t:1, ?t:1) -> ?t:1
(?t:?l, ?:1) -> ?t:?l
(?t:?l, ?t:?l) -> ?t:?l
Multiplication. Works on real numbers, complex numbers,
quaternions, hypercomplex numbers, tuples, vectors and matrices. Two
tuples can be multiplied element-wise or a tuple can be multipled by a
single number for each element. Vectors and matrices can be multipled
in both directions and two matrices can be multipled as well.
-x
(?t:?l) -> ?t:?l
Negation.
!a
(?t:1) -> ?t:1
The logical negation of the argument.
a != b
(?t:1, ?t:1) -> ?t:1
Returns 1 if the arguments are not equal, otherwise 0.
a || b
(?t:1, ?t:1) -> ?t:1
The logical disjunction of the two arguments.
a ^ b
(ri:2, ?t:1) -> ri:2
(ri:2, ri:2) -> ri:2
(?t:1, ri:2) -> ri:2
(?t:1, ?t:1) -> ?t:1
(?t:?l, ?:1) -> ?t:?l
Exponentiation of real and complex numbers and tuples. A tuple can
be exponentiated for each element by a single number.
a - b
(ri:2, ri:2) -> ri:2
(ri:2, ?:1) -> ri:2
(?:1, ri:2) -> ri:2
(?t:1, ?t:1) -> ?t:1
(?t:?l, ?:1) -> ?t:?l
(?t:?l, ?t:?l) -> ?t:?l
Subtraction. Works on real numbers, complex numbers and tuples.
One tuple can be subtracted from another element-wise or the same real
number can be subtracted from each element of a tuple.
a xor b
(?t:1, ?t:1) -> ?t:1
The logical exclusive disjunction of the two arguments.
abs(a)
(ri:2) -> nil:1
(quat:4) -> nil:1
(cquat:4) -> nil:1
(hyper:4) -> nil:1
(?t:1) -> ?t:1
(?t:?l) -> ?t:?l
Absolute value of real numbers, complex numbers (magnitude),
quaternions, hypercomplex numbers and vectors (Euclidian norm).
acos(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Arccosine of real and complex numbers.
acosh(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Hyperbolic arccosine of real and complex numbers.
alpha(c)
(rgba:4) -> nil:1
The alpha (opacity) component of the color c.
arg(a)
(ri:2) -> nil:1
The argument of a complex number.
asin(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Arcsine of real and complex numbers.
asinh(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Hyperbolic arcsine of real and complex numbers.
atan(y, x)
(?t:1, ?t:1) -> ?t:1
Arctangent of y/x, with the signs of the arguments taken
into account to determine the correct quadrant of the result.
atan(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Arctangent of real and complex numbers.
atanh(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Hyperbolic arctangent of real and complex numbers.
beta(a, b)
(?t:1, ?t:1) -> ?t:1
The complete beta function for positive real arguments.
blue(c)
(rgba:4) -> nil:1
The blue component of the color c.
ceil(a)
(?t:1) -> ?t:1
The ceiling of a number, defined as the smallest integer not
smaller than that number.
clamp(a, l, u)
(?t:?l, ?t:?l, ?t:?l) -> ?t:?l
Clamp each element of tuple a to be not less than the
corresponding element in l and not greater than the
corresponding element in u.
conj(a)
(ri:2) -> ri:2
The complex conjugate.
cos(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Cosine of real and complex numbers.
cosh(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Hyperbolic cosine of real and complex numbers.
crossp(a, b)
(?t:3, ?t:3) -> ?t:3
Cross product of two tuples/vectors with three elements.
deg2rad(a)
(?:1) -> nil:1
Convert degrees to radians.
det(a)
(m2x2:4) -> nil:1
(m3x3:9) -> nil:1
Determinant of a matrix.
dotp(a, b)
(?t:?l, ?t:?l) -> nil:1
Dot product of two tuples/vectors.
ell_int_D(phi, k, n)
(?t:1, ?t:1, ?t:1) -> ?t:1
Incomplete elliptic integral D in Legendre form.
ell_int_E(phi, k)
(?t:1, ?t:1) -> ?t:1
Incomplete elliptic integral E in Legendre form.
ell_int_Ecomp(k)
(?t:1) -> ?t:1
Complete elliptic integral E in Legendre form.
ell_int_F(phi, k)
(?t:1, ?t:1) -> ?t:1
Incomplete elliptic integral F in Legendre form.
ell_int_Kcomp(k)
(?t:1) -> ?t:1
Complete elliptic integral K in Legendre form.
ell_int_P(phi, k, n)
(?t:1, ?t:1, ?t:1) -> ?t:1
Incomplete elliptic integral P in Legendre form.
ell_int_RC(x, y)
(?t:1, ?t:1) -> ?t:1
Incomplete elliptic integral RC in Carlson form.
ell_int_RD(x, y, z)
(?t:1, ?t:1, ?t:1) -> ?t:1
Incomplete elliptic integral RD in Carlson form.
ell_int_RF(x, y, z)
(?t:1, ?t:1, ?t:1) -> ?t:1
Incomplete elliptic integral RF in Carlson form.
ell_int_RJ(x, y, z, p)
(?t:1, ?t:1, ?t:1, ?t:1) -> ?t:1
Incomplete elliptic integral RJ in Carlson form.
ell_jac_cn(u, m)
(?t:1, ?t:1) -> ?t:1
(ri:2, ?:1) -> ri:2
Jacobian elliptic function cn for real and complex arguments.
ell_jac_dn(u, m)
(?t:1, ?t:1) -> ?t:1
(ri:2, ?:1) -> ri:2
Jacobian elliptic function dn for real and complex arguments.
ell_jac_sn(u, m)
(?t:1, ?t:1) -> ?t:1
(ri:2, ?:1) -> ri:2
Jacobian elliptic function sn for real and complex arguments.
exp(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
The natural exponential function e^x for real and complex
numbers.
floor(a)
(?t:1) -> ?t:1
The floor of a number, defined as the largest integer not greater
than that number.
gamma(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
The (logarithm of the) gamma function for real and complex numbers.
gray(c)
(rgba:4) -> nil:1
The luminance value of the color c.
grayColor(g)
(?t:1) -> rgba:4
Returns a fully opaque gray RGBA color with luminance g,
i.e. rgba:[g,g,g,1].
grayaColor(g, a)
(?t:1, ?t:1) -> rgba:4
Returns a gray RGBA color with luminance g and alpha
component a, i.e. rgba:[g,g,g,a].
green(c)
(rgba:4) -> nil:1
The green component of the color c.
inintv(a, l, u)
(?t:1, ?t:1, ?t:1) -> ?t:1
Returns 1 if a lies in the interval defined by the lower
bound l and the upper bound u, otherwise 0.
lerp(p, a, b)
(?:1, ?t:?l, ?t:?l) -> ?t:?l
(?t:?l, ?t:?l, ?t:?l) -> ?t:?l
Linear interpolation between a and b, done
element-wise. The result is a if p is 0, b
if p is 1, and linearly interpolated in between. More
formally, the result is a*(1-t)+b*t.
log(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
The natural logarithm for real and complex numbers.
max(a, b)
(?t:?l, ?t:?l) -> ?t:?l
The larger of two numbers. For tuples, the larger number for
each pair of elements is determined.
min(a, b)
(?t:?l, ?t:?l) -> ?t:?l
The smaller of two numbers. For tuples, the smaller number for
each pair of elements is determined.
noise(a)
(?:3) -> nil:1
A solid noise function defined in three-dimensional space. Its
values lie between -1 and 1.
normalize(a)
(?t:?l) -> ?t:?l
Normalize a vector to Euclidian length 1.
pmod(a, b)
(?t:1, ?t:1) -> ?t:1
The remainder of a division, made positive if the dividend is
negative by adding the divisor.
print(val)
(?:?) -> nil:1
Print a tuple to standard output. Useful for debugging a script.
rad2deg(a)
(?:1) -> deg:1
Convert radians to degrees.
rand(a, b)
(?t:1, ?t:1) -> ?t:1
A random number between a and b.
red(c)
(rgba:4) -> nil:1
The red component of the color c.
rgbColor(r, g, b)
(?t:1, ?t:1, ?t:1) -> rgba:4
Returns a fully opaque RGBA color with red component r,
green component g and blue component b,
i.e. rgba:[r,g,b,1].
rgbaColor(r, g, b, a)
(?t:1, ?t:1, ?t:1, ?t:1) -> rgba:4
Returns an RGBA color with red component r, green
component g, blue component b and alpha component
a, i.e. rgba:[r,g,b,a].
scale(a, fl, fu, tl, tu)
(?t:?l, ?t:?l, ?t:?l, ?t:?l, ?t:?l) -> ?t:?l
Scale each element of a which is supposed to lie between
the corresponding elements of fl and fu to lie at
the same point between tl and tu, proportionately.
More formally, computes ((a-fl)/(fu-fl))*(tu-tl)+tl.
sign(a)
(?t:?l) -> ?t:?l
The sign of a number or tuple. The sign of a number is -1 if the
number is negative, 1 if the number is positive and 0 if the number is
0. For a tuple, calculates the sign element-wise.
sin(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Sine of real and complex numbers.
sinh(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Hyperbolic sine of real and complex numbers.
sqrt(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
The square root of a complex or real number. A real argument must
be positive, otherwise the result will not be definied.
sum(a)
(?t:?l) -> ?t:1
The sum of all elements of a tuple.
tan(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Tangent of real and complex numbers.
tanh(a)
(ri:2) -> ri:2
(?t:1) -> ?t:1
Hyperbolic tangent of real and complex numbers.
toHSVA(a)
(rgba:4) -> hsva:4
Conversion of an RGBA color value to HSVA.
toRA(arg)
(xy:2) -> ra:2
(ra:2) -> ra:2
Conversion of rectangular coordinates to polar coordinates.
toRGBA(a)
(hsva:4) -> rgba:4
Conversion of an HSVA color value to RGBA.
toXY(a)
(ra:2) -> xy:2
(xy:2) -> xy:2
Conversion of polar coordinates to rectangular coordinates.